Update: RisingHF Gateway RHF0M301 with Loriot Community Network

It’s been about a year since I posted an unofficial manual for getting the Seeed Studio 915 MHz RisingHF Raspberry Pi gateway up and running with Loriot. In that time, I had hoped that there would be more resources available for enthusiasts to find information about setting up gateways, nodes and sensors. However, it looks like complete and reliable information is still hard to come by.

For the enterprise markets there are companies such as SigFox and MachineQ that may provide an end-to-end solution. On the lower end of the market The Things Network appears to be the closest we have to a complete solution, however a good bit of technical knowledge and tinkering still seems to be necessary. Maybe this is just the nature of such a complex system.

Getting the RHF0M301 up and running on Loriot using a fresh install of Raspbian is not difficult but depends on various bits of information from RisingHF, Seeedstudio and Loriot, all companies I admire but none of whom have complete, up to date, working documentation. Below are the steps that worked for me after a bit of trial and error:

1. I’m assuming you are starting with a working Raspberry Pi (I used a pi 3 model B) with the RHF4T002 Adapter and RHF0M301 gateway both attached and powered. The Pi should have an SD card with a fresh install of Raspbian Stretch Lite. (I used 4.14)

2. Do an apt-get update and apt-get upgrade, and also enable SSH and SPI in the raspi-config utility. (sudo raspi-config to start)

3. Install CA certificates by running apt-get install ca-certificates (probably already installed but can’t hurt)

4. Install libftdi by running sudo apt-get install libftdi1

5. Sign up for the Loriot community account if you haven’t already and add a gateway. (If you need more details about this step, see my previous post)

6. Run the commands provided by Loriot in the “downloads” section of the Gateway page when you click on “quick install.” This step installs the Loriot software and causes it to always run in the background. Most instructions end with this step, and in my case the commands appeared to work but the gateway still showed as unconnected. Running sudo systemctl status loriot-gw told me that the gateway was stopped.
To get more details, run the binary directly by entering the commands listed when clicking the “Quick run” link next to “LORIOT Gateway binary only.” Running that displays the following error:
libssl.so.1.0.0: cannot open shared object file: No such file or directory
It seems like the latest Loriot binary is hard-coded to this outdated (and possibly insecure) package for SSL and TLS. Since we can’t change the binary, we have to install this software as follows:

wget http://ftp.nl.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1%2Bdeb8u7_armhf.deb
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u7_armhf.deb

7. Great, we now have some old protocols installed, so try running the Loriot binary again.

sudo ./loriot-gw -f

The next error we need to deal with is something like:
ERROR: Failed to load fw 1
ERROR: Version of calibration firmware not expected, actual:0 expected:2
The only other step I have not completed compared to a working installation with the original Seeed SD card is executing the gateway reset command, “gwrst” But where can this be found? Certainly not easily on the Seeed or RisingHF sites. (Seeed has a link to download the original SD image which contains the files, but it was corrupted when I tried it) I managed to grab gwrst off the original SD card and posted it here. It is merely a shell file that resets GPIO pin 7. Make a new folder and download these two files.


sudo install.sh

now you can run the gateway reset command

sudo gwrst

Now run the Loriot binary and you should not get the firmware error:

sudo ./loriot-gw -f

The gateway should now be connected.

If you ran the quick install, the Loriot software should start automatically after a reboot. However, you will probably need to manually run gwrst before it will work correctly. I suggest adding gwrst to a startup script so no manual intervention is necessary.