Tutorial Helium Light Hotspot with Dragino LPS8 DLOS8 | DIY Helium packet forwarder LoRaWAN Gateway
Hey, what's up, Guys! Akarsh here from CETech.
Today we have with us one of our old friends, The Dragino LPS8 Gateway. You can check the previous article on LPS8 Gateway from here and a video based on it from here. As we said in the introduction article of the LPS8 Gateway, we will be making some fun projects. So here we are back with the LPS8 8 Channel Gateway from Dragino and we are going to connect it with the Helium Network and after connecting it we will configure it to become a Light Hotspot. We also have a LoRaWAN Node with us which will be acting as a beacon and transmitting some messages continuously. When the whole thing is done, we will be able to see any message from our beacon on the Helium Console through the Gateway, which will act as a real miner but will not be able to mine Helium tokens on the Proof of Coverage Concept as such. Though in nearby future, Helium is planning to incentivize the data transfer as a Packet Forwarder which we are making here, and if everything goes by plan then you will be able to earn helium tokens based on data credits you spent or the number of beacons, etc, but this whole thing is under beta testing right now and nothing is finalized yet.
Now let's get to the fun part.
Get PCBs for Your Projects Manufactured
PCBONLINE is an electronics manufacturing service provider with three production bases. They provide middle and high-end PCB manufacturing, PCB assembly, electronic components for assembly, box builds, and PCB design services. Their one-stop services include prototyping and high-volume production.
PCBONLINE has been specialized in advanced printed circuit board manufacturing and assembly since 1999. They achieve industry 4.0 manufacturing for aluminum PCBs so that the cost is much lower than other manufacturers. Any levels of manufacturing happen on the same production lines. The strong manufacturing capability meets any demands of PCB and PCBA orders. All users that register from their website get $100 coupons for online purchases. For bulk orders, they offer discounts, free complete PCBA samples, and free PCBA functional testings. For all PCB and PCBA customers, free design for excellence and one-to-one technical support is offered.
About Helium Network
Launched in July 2019, Helium is a distributed network of long-range wireless hotspots. The goal is to create a blockchain-powered network for the Internet of Things (IoT) devices creating what they call “The People’s Network”. Helium is a global, distributed network of Hotspots that creates public, long-range wireless coverage for LoRaWAN-enabled IoT devices. Hotspots produce and are compensated in HNT, the native cryptocurrency of the Helium blockchain. The Helium Blockchain is a new, open-source, public blockchain created entirely to incentivize the creation of physical, decentralized wireless networks. Today, the Helium blockchain, and its tens of thousands of Hotspots, provide access to the largest LoRaWAN network in the world.
The Helium Network is a physical wireless network that succeeds based on the amount of reliable coverage it can create for users deploying connected devices on it. As such, it required a working algorithm that was built for this use case. Proof-of-Coverage takes advantage of the unique, undeniable properties of radio frequency (RF) to produce proofs that are meaningful to the Helium Network and its participants. Specifically, PoC relies on the following characteristics:
RF has limited physical propagation and, therefore, distance
The strength of a received RF signal is inversely proportional to the square of the distance from the transmitter
RF travels at the speed of light with (effectively) no latency
The blockchain is constantly interrogating Hotspots using a mechanism known as a “PoC Challenge” using these properties. The ultimate power of Proof-of-Coverage lies in the fact that the data generated by the ongoing proofs and stored in the Helium blockchain is definitive verification of the wireless coverage provided by Hotspots on the Network.
What Is a Light Hotspot?
Light Hotspots are the evolution of how LoRaWAN gateways will interact with the Helium blockchain. Since the genesis block, the Helium blockchain has run entirely on the physical Hotspot itself. As the blockchain network grows, each Hotspot running a full node undergoes increasing load and is starting to fall out of sync due to the higher compute requirements.
To mitigate this, the Hotspot's consensus work will be moved off of physical Hotspots and onto Validators. This will simplify the architecture immensely, and enable us to grow the Network exponentially while keeping block times and epochs stable.
As all approved Hotspots transition to a Light Hotspot architecture, we also introduce a new type of Hotspot known as Data Only Hotspots to satisfy the increasing demand and continue to expand network coverage. When Light Hotspots are fully developed and in production (which will happen with the completion of Milestone 4 detailed below) they will satisfy the following properties:
A Hotspot on the Helium network that, via Validators, can participate in PoC beacons and witnesses, and forwards data packets
Does not store a copy of the Blockchain, eliminating synchronization
Does not create challenges (relies on Validators to create challenges on their behalf)
Does not participate in Consensus Groups (relies on Validators for block production)
Will be eligible to earn $HNT
You can read about this in detail from here.
About Dragino LPS8 Gateway
The LPS8 is an open-source Indoor LoRaWAN Gateway. Unlike the LG01-P single channel gateway. The LPS8 is an 8 channel gateway which means that we can connect more nodes to it and can easily handle comparatively larger LoRa traffic. The LPS8 Gateway is powered by one SX1308 LoRa concentrator and two 1257 LoRa Transceivers. It has a USB host port and a USB type C power input. Apart from that it also has an ethernet port which can be used for connection purposes. But we are not going to use that today as we are going to connect it using Wi-Fi. We have 4 status LEDs for the Power supply, Wifi Access Point, Ethernet port, and Internet connectivity on the front part of the Gateway.
This Gateway lets us bridge LoRa wireless network to an IP network via Wi-Fi or Ethernet. The LPS8 uses a Semtech Packet forwarder and is fully compatible with the LoRaWAN protocol. The LoRa concentrator in this Gateway provides 10 programmable parallel demodulation paths. It comes with pre-configured standard LoRaWAN frequency bands to be used in different countries. Some features of the LPS8 LoRaWAN Gateway are:
It is an Open Source OpenWrt system.
Emulates 49x LoRa demodulators.
Has 10 programmable parallel demodulation paths.
To get a detailed read about the LPS8 gateway you can check here. You can refer to its datasheet from here and user manual from here. I have also done a project about the LPS8 Gateway and connecting it to TheThingsNetwork. You can check that out from here and also check the video of the project from above.
Pre-requisites Before Configuration
In this step, We are going to fulfill some pre-requisites before we start configuring our Dragino Gateway as a Light Hotspot. The thing that we need to do before we start with the configuration part is that we need to install a couple of software on our Laptop. The Softwares are PuTTY, WinSCP, and gateway-rs.
Though I have also added a file on my Github for the Gateway-rs software still I suggest you to install it directly from the helium repository as from there you will get the latest release for the software. You can access the helium repository from here and download the gateway-rs software and in this way, we are done with the prerequisites and we are ready to move to the configuration part.
Configuring Gateway As Light Hotspot
Now we are done with the pre-requisites so we can move on to the configuration part of the project. Firstly, we need to connect our Gateway to our Laptop using an Ethernet Cable and a USB type C cable to power the Gateway. Also, we need to keep the LoRa Antenna connected at all times. We can now move on to our laptop and follow the steps given below as the remaining part is to be done on that only:-
As soon as you connect your Gateway through the ethernet cable, you can log on to your router page and find the local IP address. Once you get the IP address you need to type the IP address and after that place, a colon and 8000 For e.g- If your IP address is 192.168.1.1 then you need to type 192.168.1.1;8000, and after that press enter. This will take you to the Dragino System Overview Page.
Now to connect the Gateway to the Helium Network we need to make sure that our Gateway's firmware is the latest one. To do that you need to go to System and then click on Firmware Upgrade.
Though it is the latest file at this time, this may change in the future so what you need to do is head over to my Github repository from here. There you will see a link named "LPS8_LoRaWAN_Gateway_User_Manu...". Open that link it will take you to the User Manual page. There you need to click on LPS8 as we are using that Gateway. Then you need to go Firmware, then release and download the latest firmware according to the date code mentioned in the file name.
After downloading the file, head over to the Dragino configuration page and upload the file there. After clicking the Upload button you need to wait a little bit for a pop-up to appear with some relevant details. Once it appears, you need to hit the Proceed button. This will start the Firmware Upgrade process, This process takes about 3 minutes so you need to wait for that time being.
Once the firmware is upgraded. You can refresh the System Overview Page. You will observe that the latest firmware version will appear at the bottom. Now we can move on to the next step.
Now we need to go to the LoRaWAN button and under that, we need to click on LoRaWAN again. This will open up the LoRaWAN Settings. In these settings, head over to the Service Provider and select "Custom/Private LoRaWAN". Enter the server address as 127.0.0.1 and the Uplink and Downlink Port as 1680 and click on Save and Apply.
Now head over to LoRa Tab and from there open LoRa Settings. Here you need to select the correct Frequency Plan. Also, you need to note down the prefix of the frequency plan as you will need that in the future. In my case, The frequency plan is Europe 868 and the prefix is EU868.
Once we are done with this, we need to open the PuTTY Software. There we need to enter the IP address of our Gateway in the Hostname and specify the port as 2222 and click the open button. This will show a warning first. You need to accept that warning and after that, the console will open up.
The login ID that you need to enter there is "root" and the password is "dragino" by default. This will take you to the inside of the terminal.
Now inside the terminal, we need to enter some commands which are as given below. You need to enter these commands one by one as in the order mentioned i.e and press enter after each command i.e. copy the command number 1 completely and paste that in the console and hit enter and so on. You can copy these commands either from here or from the readme of my Github repository from here:-
1) cd /tmp
2) wget -O helium-gateway-v1.0.0-alpha.9-dragino.ipk https://github.com/helium/gateway-rs/releases/download/v1.0.0-alpha.9/helium-gateway-v1.0.0-alpha.9-dragino.ipk
3)opkg install /tmp/helium-gateway-v1.0.0-alpha.9-dragino.ipk
Command no. 1 mentioned above will take you inside the tmp folder. Command no. 2 will basically download version 1, alpha 9 dragino ipk file. If you want to download a later version, make sure to update this command accordingly. Command 3 will install the file which is downloaded by the previous command. you need to update command no. 3 as well if you are using a different version.
Once the installation is done, you will see "Configuring Helium Gateway" written on the console this shows that the installation is done. You can check that by running the command "helium_gateway key info" this will show you the address of your Gateway and a unique name that is given to your gateway. In my case, it is "merry-yellow-leopard".
Now we need to open the WinSCP Software and click on "New Session". It will open the Login page where we need to enter the Hostname which is our IP Address and set the port number as 2222. Enter the username as "root", password as "dragino", File Protocol as "SCP" and hit the Login button. It will show a warning again, skip that and you will enter the root repository.
In the root repository, we need to open the etc folder and there we need to enter the helium gateway folder there you will see a file named "key.bin" copy that file to your local system as it is important for the rewards related stuff. Now you need to open the "default.toml" file there in the third line you will see the region command which is set at "US915" change that to the prefix of your frequency plan which was EU868 in my case. Copy that region command, save the file, and go back to the folder now open the "settings.toml" file and paste the copied command in that file this will tell the gateway that to which frequency it needs to connect.
Now when this is done we can close the WinSCP and restart the Helium Gateway service by giving the "/etc/init.d/helium_gateway restart" command. After restarting we can check if the gateway is working fine by using the command "logread | grep helium_gateway". This command will open the logs and if the Gateway is working fine then you will see no warnings in the logs.
And with this comes the end of the configuration step of the Light Hotspot. Now our hotspot is ready for testing.
Testing Our Light Hotspot
As our Gateway is now configured to work as a Light Hotspot. We need to test if it is working fine or not, For that, we need to open the staging console from here. Once you have set up a device with a staging console, you need to copy things like Device EUI, App EUI, App Key, etc and configure the LoRaWAN node. The LoRaWAN node configuration process will be covered in another project but right now we have a pre-configured beacon. We will connect the beacon and it will start sending LoRaWAN messages. If everything is working fine then the Gateway will capture the LoRaWAN messages and forward them to the helium console. If you check the console by scrolling down a bit you will see a creative visualization of live data packets transfer on the console.
If you open the debug console you will see there commands such as Join request which is sent by the LoRaWAN node and as soon as the Join request is accepted, the data transfer starts. This sequence will go on and the LoRWAN node will keep sending data packets that will be received by the Console through Gateway. If you hover over any of the data packets that are shown in the visualization you will see a small message such as "33 kB packet received by merry-yellow-leopard". If you remember, "merry-yellow-leopard" was the name assigned to my Gateway by the Helium Network. This also shows that everything is working fine and now as you have tested your setup, you can move onto the original Helium Console and deploy it there.
So this was the configuration of the Gateway as a Light Hotspot. You can also get these Gateways and try this by yourself. That's it for this project. See you later with another fun project.