In the past raspberry based gateway installation and maintenance was often done by local step by step installation procedures. This had two disadvantages: for heavy users with multiple gateways this was challenging regarding maintenance efforts, and inexperienced users just wanting to have a gateway considered installation procedures to be rather complex. In fact there were just quite a lot of things that could go wrong and usually some of them did.
Both issues can be addressed with remote management tools like resin.io. This labs story provides a high level overview to explain the concepts. The setup of the tool is still a bit tricky and beyond scope of this story, but installation for additional gateways is very easy. This means I can offer preinstalled SD cards to new users that are not very interested in doing these steps themselves. This allows them to focus on areas that do have their interest.
Differences compared to a normal installation
The common approach to install a plain vanilla raspberry operating system on an SD card. This would then be plugged in into the raspberry after which additional software needed to be installed and scripts needed to be run. Finally, if everything would go right the first time, the gateway would be up and running. Typically there was a large group op users who didn’t have any experience with either raspberries or even linux and then it becomes very easy to get stuck. Besides this updating software on existing gateways wasn’t that easy in particular for users with multiple gateways on different locations.
The process looked like this
Resin.io works different. It skips some steps and it starts by setting up a cloud based management environment. The idea is that the required software installation is copied to this environment from a github account and then from the dashboard installation SD cards can be generated. So this is great; the SD card is automatically generated and once this is done nothing has to be changed on the gateway device anymore. The reason for this is that resin.io automatically does this for you. And this is where it gets cool; the same update process takes care of updating the software on each gateway automatically once an update becomes available.
The process now looks like this
More into detail
The tool starts with a so-called ‘application’. This exists because it would be possible to manage an entirely different group devices from the same console, like a group of smart cars connect through 3G. Note that it is not suitable for managing LoRa end nodes.
Selecting the application shows the devices it contains. In this example most devices are off line because they are currently waiting to be re-deployed after the initial resin installation.
The device can remotely be managed with ssh and options like reboot are available
Unique values for individual devices can be maintained in the Variables section
Adding new gateways
As said, this is where things get cool for less experienced users. It simply requires clicking the ‘download resinos’ button and entering WiFi details.
The result of this is that an .img file is downloaded which can then be written to the SD card. Insert this card in the raspberry and once the device boots it will be shown in the device overview screen. It then immediately starts updating and after 15 minutes or so the new gateway is up and running. The details like gateway id that should be stored in the environment variables should be taken from the TTN management console.
New members that don’t want to spend too much effort on installing their gateways are welcome to contact me to obtain a preinstalled SD card. This will be connected to my resin environment which means updates will be pushed automatically to your devices.
And if I got you interested and you’d like to give the installation a try then go to https://github.com/jpmeijers/ttn-resin-gateway-rpi where jpmeijers made a great explanation about how to setup resin yourself. Note: still beta, but it seems to be running fine.