Skip to content

Implementations that use multiple components

This sections describes how to implement functionalities which refer to several software or hardware IoTize components.

Build a relay between your Tap and IoTize Studio

Why a relay ?

IoTize Studio is not able to communicate directly with your Tap with BLE or NFC, and anyway it is unlikely that your PC has BLE or NFC.

To overcome this problem you can setup a relay with the Tap Manager App. This connects your smartphone to the Tap through BLE or NFC, and to your PC through your IP network.

It is necessary to build a relay between your Tap and IoTize Studio on the PC in order to:

  • Apply the configuration from IoTize Studio to the Tap (or vice versa)
  • Test your monitoring 'Web App' from IoTize Studio

Target Settings

Types of relay and recommendations

There are 2 relay modes: Socket relay and MQTT relay

  • Socket relay
    • this is the simplest mode to implement, and also offer the highest data transfert rate
    • this mode is recommended by default
    • this mode requires that your mobile device and your PC have access to a common IP network, for example through :
      • a company WiFi network
      • the WiFi hotspot of your mobile device
  • MQTT relay
    • this mode is based on an MQTT broker
    • an implementation is provided by IoTize for TapNLink Primers (and more generally for Taps which have been provisioned in IoTize cloud platforms)
    • for standard Taps, you have to implement your own broker (contact us)
    • this mode can work in ALL network configurations

Detailed implementation

  1. Network settings
    • Define the network settings of your mobile device
      • Enable NFC (if you want to trigger the connection using NFC, which is simpler) and BLE connections
      • Connect your mobile device to the WiFi network OR setup your mobile device as a WiFi hotspot
    • Connect your PC to the same WiFi network used by the relay
  2. Connection Tap <---> mobile device

    • Tap your mobile device on your Tap (or launch Tap Manager manually)
    • Open the navigation menu (swipe your finger from the very left to right), then:

      • Set up relay

      Target Settings Phone menu

      • if no device is selected:

        • Click to select a device and select your Tap.
        • Scan for modules if your Tap is not displayed.
      • check your Tap name and Tap Serial Number are correct

      • select the socket mode (mandatory for a first connection)
      • note the IP address
      • start the relay

      Phone menu

  3. IoTize Studio manipulations

    • In IOTZ Explorer (upper left hand part) click on Studio
    • In the details view (underneath the Explorer pane), find the section Connection to Tap
    • Set the option Protocol to 'Socket' (mandatory for a first connexion) Image
    • Enter the IP address in the Socket host name/IP field
    • Launch the test connection (the upper bar) Image
    • The first connection triggers the recovery of your Tap Serial Number (with a message) Image
    • From now on, you can use the relay to configure your Tap and to test your monitoring app from IoTize Studio Image
  4. Monitoring of exchanges

    • You can see from Tap Manager (menu...) the number of packets which have been exchanged (in the menu...)
    • Look at the logs displayed in the output window of IoTize Studio
  5. Implmentation of the MQTT mode

    • To use an MQTT relay, both the PC and the mobile device must access the MQTT broker through an Internet access
    • Change connection mode to 'MQTT relay' in both Tap Manager and IoTize Studio
    • Restart the relay in Tap Manager then Test Connection again in IoTize Studio
    • Check the connection on both sides
  6. Complementary information to reinforce the security in MQTT mode (for advanced users)

    • Netkey encrypts the communication in MQTT mode
    • This is a shared key mechanism
    • This key can be copied to the Tap (or read from the Tap) when you configure it using 'Socket mode'
    • To bypass the recovery of this key from the Tap by the smartphone
      • copy the BRK file (generated in the project directory on your PC)
      • install this file in the IoTize Directory in your smartphone