This tutorial will describe a quick and easy way on how to connect a LoRa Node to a LoRaWAN Gateway, make an integration to the Ubidots platform using The Things Network (TTN) as a LoRa Server and display the data in a nice looking dashboard. This example is applicable to any LoRa Node and LoRaWAN Gateway combo, as long as the payload format the node is sending is LPP, and TTN is configured to decode it properly and has an integration with Ubidots.
For reference, you can check the full Quick Start Guide for each device here:
2. Initial Hardware Setup2.1 Setting Up Your Gateway- Step 1: Attach the antenna
First and foremost, screw on the antenna to the SMA connector on the front panel of the gateway, if you are using RAK7258. For RAK7249 screw on the antennas. All 5 of them should be installed (Wi-Fi, LoRa, LTE on the top, and GPS on the bottom).
Note: Do not power the device if an antenna port has been left open (not connected to the antenna)
- Step 2: Power on the Gateway
It is recommended you use the 12V DC adapter that comes with the gateway in case you are using the RAK7258. For RAK7249 best use a cable and an injector (the gateway supports PoE).
- Step 3: Connecting to the Gateway
Use either the Ethernet Port or Wi-Fi (by default the Gateway works in AP mode). In both modes, you can access the Management UI via a web browser pointing to the IP address of the Gateway (check your router DHCP list).
Wi-FiAPMode - by default the Gateway is configured to work in Access Point (AP) Mode. It has the following parameters:
Wi-Fi :
SSID: RAK72XX_xxxx (no password is required to connect via Wi-Fi)
Web UI:
Connect via a browser, by default the IP address 192.168.230.1 is where you will find the Gateway Web UI.
UI user: root
UI password: root
WAN port (DHCP IP) mode - Connect the Ethernet cable to the port marked “ETH” and the other end to your Router. Use the same credentials for the Web UI as for AP mode
- Step 4: Connecting the Gateway to TTN
The Gateway EUI can be found either on the sticker on the casing or via the LoRa Gateway → LoRa Packet Forwarder → General Setup page (see figure below)
Go to your TTN console (you need to register an account first) and register your new gateway using the link
Note: Make sure to select the “I’m using the legacy packet forwarder” option, before entering the Gateway EUI.
Select your Frequency Plan depending on your location. This should populate the Router field. Optionally you can choose to enter the Gateway coordinates in the map’s upper right corner and select if the gateway is indoor or outdoor via the Antenna placement field below the map.
Upon successful registration you should see the following screen:
Your Gateway should now be registered with TTN and you should be able to forward LoRa packets.
Note: By Default, the Gateway is set to connect to TTN (using it as its LoRa Network server). For detailed information about advanced configuration options refer to the RAKwireless document hub: https://doc.rakwireless.com/2.2 Setting up your Nodes
We are going to use the RAK7204 for the purpose of this tutorial, in fact, several of them can be used to put in every room of an office for example. You can get them here. These are LoRa Environmental Nodes that measure Temperature, Humidity among others so they seem perfect for the task of generating some data quick and easy.
You can refer to the RAK7204 Quick Start Guide on how to connect the RAK7204 to The Things Network (TTN). It is quite straight forward, however, there are important steps to be taken (for example update firmware, import keys, etc.), which we best leave to the comprehensive guide in order to not burden this tutorial too much, as some may already be familiar with the procedure or have a couple of those already working.
3. Setting up TTN and Ubidots to Work Together3.1 Setting up your NodesAssuming you have followed the RAK7204 Quick Start Guide you should now have one or more Nodes connected to TTN and sending data. In order to use Ubidots you need to be transmitting in LPP format and have an integration with Cayenne. The RAK7204 is preconfigured to use the LPP data format standard, so you only need to add change the payload format of your application to Cayenne (see Figure 4 below)
Note: In case you are not using the RAK7204 but another Node, you can always write a custom decoder/encoder to have the same effect as using the built-in Cayenne LPP one. This, however, is out of the scope of this tutorial as it is device-specific.
Now that your Payload Format has been set Ubidots is ready to receive your data in, however, you need to make an Integration to it in the next step.
3.2 Creating an Ubidots AccountGo to the Ubidots Home Page, click on the GET STARTED FOR FREE button that is in the middle of the screen (Figure 4) and proceed. There is a standard form to fill and afterward, you will see a waiting screen and in a couple of seconds, your account will be created.
Now that you have registered in Ubidots you have only a few steps left in order to have your data visible in the Dashboard.
- Step 1: Add integration to Ubidots in TTN
Go to the Applications → Integrations → add integration as shown in Figure 6:
In the screen that follow you will find the Ubidots integration in the lower right as shown in Figure 7.
You will be taken to the Integration configuration screen where you need to enter a Process ID, select an Access Key (choose default key), and a Token (refer to Figure 8 for an example. The aforementioned token can be found in your Ubidots user panel shown in Figure 9. Copy and paste it in the Token field in TTN. Once you are done press the “Add integration” button in the lower right that will turn green.
After you have completed adding the Integration to TTN everything should be set. You will only need to go to your Devices tab in Ubidots where you should see your RAK7204 device (Figure 10). If there is a device that has been auto-created everything has worked out well.
Note: By default, the device will be named with the Device EUI, you can change it to a more appropriate name as we have done in figure 10.
Now the only thing left to do is go to your dashboard and populate it with widgets as we have. If you examine Figure 11 you can see that you can go to the Dashboard by clicking on the Ubidots logo or on the Data → Dashboards menu. For adding a new widget using the blue plus button on the top right.
As you can see in Figure 12 there is a wide range of widgets to choose from. We are using the Gauge as an example.
After you choose a widget you will see a screen like the one in Figure 13. Upon clicking the Add variables button (in the grayed-out area on the right in the red square in the figure) you will see the window on the right where you can select your device and choose one of the variables (in our case there are 5 of them). This will create the widget and extract this particular variable data and display it.
And you are done. You can play with your visualization, create something to Figure 11 where we display the Battery level, Temperature, Humidity and Atmosphere pressure in the top row. The bottom row is a graph representing how the Temperature and Humidity Change over time. Feel free to experiment and tailor your dashboard in a way that is most productive for you. That is what is so great about this Integration, the ability to customize!


_Owo51ooXAa.png?auto=compress%2Cformat&w=40&h=40&fit=min&dpr=2)


_Owo51ooXAa.png?auto=compress%2Cformat&w=60&h=60&fit=min&dpr=2)
_M6kErcYJ84.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments