All Collections
Connect your Devices
Connect a MultiConnect Conduit LoRa-to-GPRS Gateway to Ubidots over TCP/UDP
Connect a MultiConnect Conduit LoRa-to-GPRS Gateway to Ubidots over TCP/UDP

Learn to setup and send data from your LoRa devices to the Conduit Gateway and on to Ubidots for data enablement.

Isabel Lopez avatar
Written by Isabel Lopez
Updated over a week ago

The MultiConnect® Conduit™ is a programmable gateway with an open development environment to enable machine-to-machine (M2M) connectivity using various wireless interfaces, including GPRS, 3G, 4G and LoRa.

By following this guide you will be able to forward data received in the Multitech Gateway by different LoRa nodes or hardware and POST the data using a structured TCP/UDP protocol to Ubidots.

Requirements

Step-by-Step

  1. Setting up the Hardware

  2. Setting up the Gateway System

  3. Send (PUBLISH) Data to Ubidots

  4. Summary

1. Setting up the Hardware

Install the LoRa mCard

1. Disconnect power to the gateway.

2. At the back of the gateway's housing, determine where you want to install the accessory card. You can install the card in either the AP1 or AP2 port. Remove the port cover to insert the mCard.

3. Slide the card into the opening gently until you feel the card connectors are fully connected to the internal connector.

4. Use a small screwdriver to attach the card bracket to the housing with the screw from the port cover.

5. Attach the LoRa antenna to the LoRa mCard.

Install a SIM card (optional)

1. At the front of the Conduit housing, remove the screw that secures the nameplate to the Conduit and remove the nameplate.

2. Locate the SIM card holder in the upper right corner of the opening. If a SIM card is installed and needs to be removed, slide it out of the SIM card hold.

3. Gently push the new SIM card into SIM card holder face up with the cut corner to the right establishing SIM connection with the Conduit gateway.

4. If not installing a battery or micro SD card, reattach the MultiTech nameplate to the Conduit using the screw removed in previous step.

To install a Micro SD card or a battery, please refer to MultiTech’s website.

2. Setting up the Gateway System

Setting up the Ethernet connection

1. Connect the Ethernet cable between the MultiConnect Conduit and your PC, then connect the power cord and wait for the Status LED to begin blinking.

2. The MultiTech gateway ships with a static IP address 192.168.2.1. You should manually set your computer’s ethernet IP address to 192.168.2.5 so that it’s within the same subnet of the gateway. You can follow this link to configure an IP if you do not know how. 

3. Open an Internet browser and type the default address for the device: http://192.168.2.1. When the login page appears, type the default user name (“admin”) and default password (“admin”).

4. Next, go to the "Setup" and select Network Interfaces:

5. Then, click on the "pencil" to edit eth0:

6. Change the Type to LAN and Mode to DHCP Client:

Setting up the LoRa Radio

1. Go back to Setup and click on Lora Network Server:

2. Set the desired Lora network name, Frequency Sub-Band, and Passphrase.

Setting up a Mobile connection (optional)

To enable your Conduit gateway to access the Internet through a mobile interface:

1. Go to Cellular –> Cellular Configuration to display the Cellular Configuration window.

2. Check the “Enabled” box to enable it.

3. Enter the APN provided by your mobile operator in the field located in the Modem Configuration section of the window:

4. Click on “Submit” to complete.

3. Sending (PUBLISH) Data to Ubidots 

Node-RED allows you to create your own programming functions to handle the gateway data by using a simple and visual interface. We’ll use Node-RED to relay the LoRa data to the Ubidots cloud, where the LoRa devices data can be put to good use in your Ubidots account.

1. To connect Node-RED to Ubidots click on “Apps” then “Node-RED”.

2. A new login page will appear; use the default “admin” user and “admin” password used for the main Conduit interface.

  • From the Node-RED menu in the upper right corner, select “Import” -> “Clipboard.” Then copy and paste the code provided below. 


Clipboard:

[{"id":"23666640.f89f6a","type":"tcp out","host":"industrial.api.ubidots.com","port":"9012","beserver":"client","base64":false,"end":true,"name":"","x":624,"y":271,"z":"fd59daf8.04e3e","wires":[]},{"id":"b54266ab.fe579","type":"debug","name":"","active":true,"console":"false","complete":"true","x":648,"y":180,"z":"fd59daf8.04e3e","wires":[]},{"id":"72c3c42f.26c294","type":"function","name":"Function Ubidots","func":"var TOKEN = \"{Assign_your_Ubidots_Token}\";\nvar VARIABLES = [\"var-1\", \"var-2\", \"var-3\"];\nvar USER_AGENT = \"mDot/1.0\";\nvar payload  = msg.payload;\nvar values = payload.split(\",\");\nvar last_index = values.length - 1;\n\nif (last_index > 2 || last_index < 0) {\n    return null;\n}\n\nvar data = {};\ndata.payload = USER_AGENT + \"|POST|\" + TOKEN + \"|lora:my-lora-device=>\";\n\nfor (i = 0; i <= last_index - 1; i++){\n   data.payload += VARIABLES[i] + \":\" + values[i] + \",\";\n}\n\ndata.payload += VARIABLES[last_index] + \":\" + values[last_index]\ndata.payload += \"|end\";\nreturn data;","outputs":1,"noerr":0,"x":380,"y":179,"z":"fd59daf8.04e3e","wires":[["23666640.f89f6a","b54266ab.fe579"]]},{"id":"47bd1557.66acec","type":"lora in","name":"","datatype":"utf8","x":189,"y":182,"z":"fd59daf8.04e3e","wires":[["72c3c42f.26c294"]]}]
  • Click on Ok to place the block diagram in your Node-RED project.

  • Now you will see something like this:

  • Double click on label named Function Ubidots and you’ll see a code snippet. In this code, change “TOKEN” for your unique Ubidots account token.

Sending data from your LoRa devices to the Conduit Gateway

The variables are defined into the "VARIABLES" array in the Ubidots function provided above. Accordingly, you will be able to send values to Ubidots following the format below: 

value-1,value-2,value-3

This tutorial has been tested with the LoRa mDot Modules from MultiTech. Check out the device tutorials here:

IMPORTANT NOTE: The mDot device lets you to send a packet with 11 bytes max payload limit; please ensure that the total number of the bytes of the package does not exceed 11, the library does not make any check of byte size.  

4. Summary

With this simple tutorial you are able to POST the data received from the LoRa nodes in the Multitech Conduit Gateway to Ubidots Cloud where the data can be enabled to influence good decision making.

Now its time to create Ubidots Dashboards to visualize your data and deploy your IoT solution!  Happy Hacking! :) 

Other readers have also found useful...

Did this answer your question?