Skip to main content
All CollectionsConnect your Devices
Connect the Bivocom Router TR321 to Ubidots via MQTT
Connect the Bivocom Router TR321 to Ubidots via MQTT

Learn how to send Modbus data to Ubidots via MQTT over a 4G cellular network using the Bivocom 4G IoT Router TR321

Santiago Pachon Robayo avatar
Written by Santiago Pachon Robayo
Updated over 3 months ago

The Bivocom Router model TR321 is an industrial IoT device compatible with 4G LTE, and LTE CAT M1/NB-IoT, to meet your needs for data speed and bandwidth, as well as your budget for a low-cost router.

It was designed for industrial IoT and M2M applications like digital signage, kiosks, ATMs, smart grid (switchgear, recloser, meter), IP cameras, HVAC, air compressors, and Industry 4.0, which require a cost-effective basic router with Ethernet port and serial port RS232 and RS485.

By using this guide you will learn how to set up the TR321 Router connected to a Modbus slave tool simulating an IoT sensor via serial port (RS232, RS485) or Ethernet port (RJ45), to forward all data collected to the Ubidots cloud IoT platform via MQTT over 4G cellular network.

Requirements

1. Create a new blank device in your Ubidots account

Step 1: As indicated in the GIF below, generate a new blank device. In this example we named the device "mms", but you can assign any device name and label of your choice.

Step 2: Obtain the device token and save a copy of it because you will need that token for the MQTT router settings.

2. Bivocom Router Settings and MQTT configuration

Step 1. Connect your laptop with the Bivocom Router’s LAN port using an ethernet cable, then log into the Bivocom management WEB UI found at IP address 192.168.1.1

Step 2. At the “Basic Setting”, enable the ‘Data Collect’ feature, and enter the ‘Collect Period’, and the ‘Report Period’. Make sure to ‘Save & Apply’.

Step3. At the “Interface Setting” label, select the corresponding COM port. In this case, we chose RS232 cable to communicate via Modbus, as seen below.

Step 4. In the “Modbus Rules Setting”, follow the slave device datasheet to get this information. The 'Factor Name' will be the device name on Ubidots.

Step 5. In “Server Setting”, set the Server Address to “industrial.api.ubidots.com” and the 'Server Port' to 1883, set the Encapsulation Type as "Transparent".

Step 6. The MQTT Public Topic format should be set to /v1.6/devices/{DEVICE_LABEL}. In this case, since we labeled the device in Ubidots as "mms", we will set the topic to "/v1.6/devices/mms".

To connect to our MQTT broker, use your Ubidots device TOKEN as the MQTT username and MQTT password, then enter a unique Client ID (any string).

3. Simulate data with the Modbus Slave Tool and check data stored at Ubidots

Step 1. In this case, we use Modbus Slave to simulate the slave device.

Step 2. At Ubidots, we can see the “a1” value and “a2” value.

This is just a quick guide on how to enable data collected via RS232 in Modbus protocol of Bivocom IoT TR321 router by transparent data transmission mode, and send the data via MQTT to the Ubidots IoT platform over 4G cellular network. For more info about that device, please contact Bivocom support at support@bivocom.com or info@bivocom.com.

Did this answer your question?