Skip to content

Setup a communication channel between Taps and IoTize Studio

In order to work on your PC for building or testing configurations you will need to setup a communication channel between your PC and Taps. This section describes how to setup and configure such a communication channel.

Use direct BLE communication

The easiest way to work with Taps is to use the BLE communication channel. But, to do so you need to use a BLE enabled PC and Windows 10 (version 10586 or higher) operating system. If your PC does not have a built-in BLuetooth support, you have the possibility to purchase and use an USB Bluetooth Adapter Dongle. Please note that before purchasing such a dongle you should make sure that they can properly work with Windows 10 BLE manager as all of them are not fully functional with Windows BLE peripheral manager.

Enable BLE on Windows 10

To enable BLE communication on Windows 10 and verify BLE connectivity with your Tap, use the following steps: 1. Open Settings. 2. Click on Devices. 3. Click on Bluetooth & other devices. 4. Turn on the Bluetooth toggle switch.

BLE settings

  1. Click the Add Bluetooth or other device button to scan BLE peripherals and find your Tap. It might take a moment, but the device will appear in the list, click it to connect.

BLE settings

Configure IoTize Studio for a direct BLE communication

To enable IoTize Studio to use the BLE communication channel, use the following steps: 1. In IOTZ Explorer expand Sensor_demo.iotz Configuration. 2. Click on Studio and in the details, set Connection to Tap | Protocol to 'BLE'. 3. Click on (...) button beside BLE deveice name/address. IoTize Studio will scan and display the list of available Taps. Select your Tap from the list and verfiy that you can properly connect to your device.

Target Settings

Setup a relay between your Tap and IoTize Studio

Why a relay ?

If you don't have Windows 10 installed on your PC or you can not use the direct BLE communication channel with your Tap, you still have the possibility to setup a relay using the Tap Manager App. This relay connects your smartphone to the Tap via BLE or NFC, and to your PC via your IP network.

You need a relay between your Tap and IoTize Studio 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 offers the highest data transfer 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
    • this mode is not yet available from an iOS device.

Detailed implementation

IoTize Studio uses Tap Manager to communicate with your Tap via your mobile device.

You need to start a socket relay on the smartphone and connect to the Tap.

Start socket relay on an Android device

  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. Connect Tap to 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

      • 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

    If Tap Manager has problems creating a Socket connection, try setting up the relay again, or just click on the Socket menu and change the port number. Phone menu

    Phone menu

Start socket relay on an iOS device

  1. Network settings

    • Define the network settings of your mobile device
      • 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. Go to your phone settings and change Tap Manager App settings to enable the Developer Mode.

    Tap Manager Settings

  3. Start a communication relay from the mobile phone using Tap Manager

    • Start a BLE connection with your device.
    • Tap Manager will automatically open the Relay page and start listening to clients. The IP address displayed on the page corresponds to the socket server address. You should use this address to initiate a connection between Iotize Studio and the phone.

    Tap Manager Relay Page

Configure IoTize Studio

  1. Configure IoTize Studio (on your PC) to find the socket relay, and your Tap:

    • In IOTZ Explorer expand Sensor_demo.iotz Configuration
    • Click on Studio, in the details, set Connection to Tap / Protocol to 'Socket' (mandatory for a first connection) 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
  2. Monitoring of exchanges

    • You can see from Tap Manager (Monitoring menu) the number of packets which have been exchanged.
    • Look at the logs displayed in the output window of IoTize Studio
  3. To use an MQTT relay instead of a Socket 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.
  4. 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
    • Contact IoTize for more details