This is an example using the SensorTag Bluetooth module from Texas Instruments to send data to TagoIO. There is no code modification needed in the SensorTag side, and as it uses the MQTT protocol, only a configuration setup is needed. For the connectivity, the SensorTag uses Bluetooth to communicate to a mobile device. Texas Instruments offers a mobile app that converts this communication to a MQTT protocol and pushes the data to cloud using cellular or wifi technology.
Learn more about the SensorTag CC2650 and how to get started.
In this example, all the data from the sensors will be post to TagoIO. We will visualize the sensor information on the dashboard in real-time. In the current hardware version that was tested here, the SensorTag contains 10 sensors including support for light, digital microphone, magnetic sensor, humidity, pressure, accelerometer, gyroscope, magnetometer, object temperature, and ambient temperature. There is no native way to control the LED or Buzzer of the module using MQTT subscribe method.
Click on Devices , then click on 'Add Device' button. Select the connector type: MQTT, look for the SensorTag device.
When a device is created, go to details of your device, then copy the token generated for it.
First, download the App for Android or Apple devices called SensorTag. Make sure that you select the right App for your CC2650 Bluetooth SensorTag, as other similar versions may be available for download. Install it, and follow the steps showed here.
Open the App, and push the power key on your SensorTag so that it starts to communicate with your mobile device, then click on Cloud configuration, make sure that the Bluetooth module of your device is enable, then click on your device on the list.
Click in All, or if you have multiples SensorTag click on + icon on top right, then select Advanced Configuration.
In the Advanced cloud config section, select the MQTT Protocol and then configure the following fields:
Broker Address: mqtt.tago.io (without https://)
Broker Port: 1883
Username: tagoio
Password: <Enter here the Device-token (copied on last step)>
Publish Topic: data
Subscribe Topic: (not used - leave as is)
Publish rate: 5000 (may change later)
One example of a configuration screen is showed in the figure below. The highlighted fields are the ones that you need to enter with the information as mentioned above.
Now, you can turn the switch on of the App as showed below to start pushing data to TagoIO.
If the configuration is correct and you have a network connection, some data should already have arrived in your account.
You can see the data arriving on Live Inspector, it's a tab on your device details, your device is connected on TagoIO but the data will not be saved on your bucket yet, you should create an Action to choose a MQTT topic. This last step is important because will can have a lot topics and just save one and not another.
Click on Action, create a new one, select MQTT Topic as the type of trigger, and Insert data to device bucket as the type of action. Then select your device and type data, on topic, save and you are done.