Introduction
The purpose of this tutorial is to guide the Industrial IoT community to simply connect any sensor or machine to Fogwing IIoT Platform using Bivocom TG501 Industrial LTE/WCDMA RTU gateway. You should go through the article fully to understand the steps involved and prepare to connect with Fogwing IIoT Platform. Hope you can enjoy this learning.
What is Fogwing?
Fogwing is the No-code Industrial IoT Platform available as a SaaS for small and medium enterprises. Fogwing provides comprehensive features to deploy IoT devices and management the devices remotely. Fogwing also provides data storage, data driven alerts and IoT data analytics features as part of the product functions. To learn more about Fogwing features visit here.
What is Bivocom TG501?
Bivocom TG501 is an industrial cellular RTU designed for remote monitoring and control applications, such as, water & waste water management, pump station, gas & oil, smart energy, smart grid, smart building, precision agriculture, etc. It has rich I/O for connecting to diverse sensors and controllers, with built in protocol MQTT, Modbus RTU, TCP/UDP, that allows user to transfer the data from field devices to cloud.
To connect TG501 to Fogwing IIoT platform and send data, you need to follow the following steps.
Create an Account In Fogwing IIoT Platform
Step 1: Signup
Please visit Fogwing Portal and sign up by filling the registration details requested. You can also watch video instructions to understand various features and functions of the platform here. You will receive an email with a set of instructions and confirmation of account creation within few seconds.
Step 2: Login and create an application
Login to your fogwing account using your credentials, once you logged in, you will see a get started page which will give an overview on how to use Fogwing IIoT platform. The dashboard page will show details about the edge and map view etc.
Go to Applications page -> click on Add and fill in the required information and submit. Application is virtual workspace to group the set of edge devices for application specific functionalities.
Step 3: Add an Edge device
Next, go to Edge Devices page and click on Add button fill in the required information. Select the previously created application and enable Auto Generate IoT Hub Access. If you enable Auto Generate IoT Hub Access option then system will automatically create the access credentials for your device to connect to the Fogwing Cloud. You will receive an email with Fogwing IoT Hub access details.
Note: If you enable Test mode, your data will be deleted after 15 days, if offline alert is enabled an email will be sent when the device is connected/disconnected.
Step 4: IoT Hub Access
Now you can go to IoT Hub Access page and click on the action icon of the edge you created to see IoT Hub interface options. If you want your device to connect through MQTT (preferred by Fogwing ) click on MQTT access to see MQTT credentials and other MQTT related information for edge device.
If you haven’t enable Auto Generate IoT Hub Access while adding an edge device in Step 3 then you need to create IoT hub access. Go to IoThub access page and select the edge device which was created previously, set username and password then submit it.
An email will be set with Fogwing IoT Hub Access information after creating IoT Hub Access manually.
How to connect RS485 sensor to Fogwing IIoT Platform?
To connect RS485 based sensor to Fogwing IIoT Platform, we will be using Bivocom TG501 Mini RTU device. Before go through the configuration, the following pre-requisites should be ready.
Pre-requisites:
· XY-MD02 Temperature & Humidity Sensor or any RS485 sensor
Step 1: Download the configuration tool
The bivocom TG501 config tool is integrated with configuration, debug and firmware upgrade functions. You can go to Bivocom website to download the config tool from the download section or contact the Bivocom support team if required.
Step 2: Configuration of Bivocom TG501
1. Connect TG501 to your laptop or computer through RS232 (refer Bivocom user guide to connect TG501 to computer or laptop) then open Bivocom configuration tool. Usually, tool detects the port and baud rate automatically if not the select the port to which the TG501 is connected, Select baud rate and then click on Open Port.
2.Click on Config, then click on Reload. The window will pop-up asking to restart the device, turn OFF the TG501 power adapter then turn it ON. Wait until it shows as Loading device parameters success in the log window.
Now the device is in Configuration mode. When the device is in configuration mode it will be offline.
3. In Basic setting, enter the Device ID to identify the TG501 for device management. If you have multiple devices connected to the cloud server, please make sure all the IDs are unique. Enter the card number of SIM inserted in this device. Also, set the work mode as DTU and MODBUS Work Mode is disabled as shown in the figure below.
4. In Com setting enable the communication port which you are using to read data and set baud rate. Here We are using the XY-MD02 sensor which is connected to RS485-0 and baud rate is 9600.
5. In the Network Address, you need to select data center through which you want to send data (here using Center 1 so set Data center as 1). Set Protocol as FTCP and select port used for communication with the sensor (I am using RS485-0), enter the fogwing IoThub Address and set MQTT port as 1883.
6. In Other settings, you can set APN and other settings which are set according to the network provider of the SIM that you are using in TG501. Make sure that the FTCP transfer is set as Yes.
7. Now in MODBUS setting, you need to set Device ID, Function code etc based on the sensor you are using (Here we have set for XY-MD02 sensor). You can set time interval to collect data from the sensor in collect(sec).
Note: Baud rate of Com setting and baud rate of MODBUS setting should be the same.
8. Finally, you need to enter MQTT credentials that will be sent through mail or you can find it in IoT Hub access --> MQTT access of the edge which you created earlier. You can set the time interval to send data to Fogwing in Topic up time(sec) as shown in the figure below.
Note: Fogwing accepts data only in JSON format so please select the data format as JSON
9. After all these configurations are made properly click on Save, wait until the parameters are set successfully. If parameters are set successfully, you can see set success message in log window as shown in the figure below. Then click on Restart, now the device restart and the device will be online and starts sending data to Fogwing.
10. Now go to Fogwing IIoT Platform portal, access your account, go to Data Management -> Data Storage page where you can see all the data received in the cloud.
How to connect Digital sensor to Fogwing IIoT Platform?
To connect digital sensor to Fogwing IIoT Platform, we will be using Bivocom TG501 Mini RTU device. Before go through the configuration, the following pre-requisites should be ready.
Pre-requisites:
· Inductive proximity sensor or any Digital sensor
Step 1: Download the configuration tool
The bivocom TG501 config tool is integrated with configuration, debug and firmware upgrade functions. You can go to Bivocom website to download the config tool from the download section or contact the Bivocom support team if required.
Step 2: Configuration of Bivocom TG501
1. Connect TG501 to your laptop or computer through RS232 (refer Bivocom user guide to connect TG501 to computer or laptop) then open Bivocom configuration tool usually tool detects the port and baud rate automatically. If not, then select the port to which the TG501 is connected, select baud rate and then click on Open Port.
2. Click on Config, then click on Reload and window will pop-up asking to restart the device. Turn OFF the TG501 power adapter then turn it ON and wait until it shows Loading device parameters success in the log window. Now the device is in Configuration mode.
Note: When the device is in configuration mode it will be offline.
3. Click on Channel setting, select any channel and in Hardware section select DI1 keep the port open to read data, set the parameter name to be displayed in payload.
4. In Basic setting, enter the Device ID to identify the TG501 and for device management, if you have multiple devices connected to the server, please make sure all IDs are unique and enter the number of SIM inserted in the device. Set the work mode as DTU and MODBUS Work Mode is disabled as shown in the figure below.
5. Since you are reading digital data, all RS485 and RS232 ports must be disabled in Com setting.
6. Now in Network Address, you need to select Data center through which you want to send data (we are using Center 1 so I have set Data center as 1) set Protocol as FTCP and select port used for communication with the sensor (we are using DI1), enter the Fogwing IoThub -> MQTT Address and set port as 1883.
7. In Other settings, you can set APN and other settings which are set according to the network provider of the SIM that you are using in TG501. Make sure the FTCP transfer is set as Yes.
8. Finally, you need to enter MQTT credentials that sent through mail or you can find it in Fogwing Portal -> IoT Hub access --> MQTT access of the edge which you created earlier. You can set the time interval to send data to Fogwing in Topic up time(sec) as shown in the figure below.
9. After all these configurations are made properly, click on Save, wait until the parameters are set successfully. If parameters are set successfully. You can see set success message in log window as shown in the figure below. Now, click on Restart, the device restart and the device will be online and starts sending data to Fogwing IIoT Platform.
10. Now go to Fogwing IIoT Platform portal, access your account, go to Data Management -> Data Storage page where you can see all the data received in the cloud.
Hope that you are able to complete the above steps and start receiving data in Fogwing IIoT platform as per the instructions provided.
All Bivocom devices are tested and certified to connect with Fogwing IIoT Platform. If the TG501 does not address your requirements, you can try with other Bivocom devices. To learn more about the list of Bivocom devices tested and certified, you may visit here: https://www.fogwing.io/iot-devices/bivocom/
If you are facing any challenges or issues, you can contact our Bivocom support team or Fogwing support team or you can ask your question in Fogwing community.
What's next?
Once you are familiar on how to connect Bivocom devices to Fogwing IIoT Platform, next step is to explore and learn about other Fogwing IIoT Platform features.
For any feedback and enquires on the functionalities of Reports, write to our support team at Fogwing support team