Basics Station Protokoll in Docker-Compose for balena.cloud Gateways V2 / V3

Prologue: When the first unicorn appeared in the console after programming the TTN gateway, the real miracle was actually somehow something exciting, new and wonderful. And after almost three years of experience and development, the aforementioned unicorn is still the praise and confirmation of the success…. Do you wonder why this is being reported now?

News: Many hours of evening and night development work have now passed and we are proud to present you the current update for our Raspberry Pi Gateway. In the current departure from thethingsnetwork to the new v3.Stack, we are not only involved in development, but are actively shaping the future in cooperation with the “makers” of the scene. Data security and encryption are currently just as much a part of the requirements of an open, shared and free network as the simple and understandable installation of hardware and software. Since then, it has been clear to us to make the entry and expansion of the network as easy as possible for all interested parties - everything that is already known and above all tried and tested is welcome to be used again.

Today we are allowed to announce that we have built a Docker Compose from the previous Docker version and are using the Basicstation protocol for the gateway. To monitor the gateway variables, in addition to the actual GW software, there is also a collectd Docker that reads the status information from the RaspberryPi. An influx database would also be conceivable in order to be able to save measured values directly in another Docker.

The whole thing can be installed on RaspberryPi 3, 4 and also on a balena.Fin, our repo also supports different heads such as SX1301 (IMST ic880a or RAK2245) or SX1302 (RAK2287) - the installation can be done via the standard way ( a clone via Git is created and copied to the gateway, alternatively the gateway can be set up via Balena Cli. Here, too, we have included detailed instructions in the repository, which are based on the already known solutions and generally understand the way to your own LoRaWAN gateway With the Basicstation protocol, it is also very easy to switch between the old and new stacks at thethingsnetwork, in both directions.

The real advantage of the repository offered is the data encryption by the Basicstation protocol, which enables end-to-end encryption from the gateway to the network server via TLS. The status of your own living room window, the level of the cistern or the data from the environmental sensor are therefore “safe” during transmission through the cloud. Another advantage over the countless other solutions on the Internet is the management of a complete fleet of gateways. Updates or queries about the status of the individual gateways can be made online at any time via the balena.cloud.

… and how does it continue ? Take a look at our Github repository, where you can install your own gateway from scratch, in addition to the description of the hardware, you will also find the preparation and installation of the software step by step. Some of you have probably installed one or more gateways that are managed via the balena.cloud - we can now offer a simple option for migrating your gateways into the v3 stack AND the extension to the Basicstation protocol.

Repository GitHub - dasdigidings/basicstation: LoRa Basics™ Station - The LoRaWAN Gateway Software

5 Likes

Special thanks to @jmarcelino and @gy4nt from RAK and balena.io for providing the initial basicstation docker version! Without your work this would not be possible. And thank you @Amedee for the collectd docker work for the multi-protocol-paket-forwarder way back when it was “cool” to build your own gateways :wink:

Nice to have the new basicstation protocol combined with the docker-compose power to monitor our gateway with collectd.

3 Likes

Awesome, that would be a great starting point for me. I have the mp forwarder from Jack Kersting as docker container on a Pi Zero running with a iC880a and searching for a good solution for migrating to V3.

I don’t know who you are referring to… If you want to keep MP forwarder you can update to a balena build for V3 next week.

Oh sorry, i totally wrote your name wrong and my cellphone trys to correct it to german words…
I will take a look at the MP Forwarder build for V3.

No problem, I’ve been called worse.

Files should be on GitHub after the weekend. I’m still polishing them.

2 Likes

Great to hear that there will be a MP Forwarder build for V3. Users can then choose wether to keep the MP Forwarder or try basicstation in V3 with their DIY gateways - thats the power of opensource and good communities!

1 Like

I used your MP Forwarder early Feb on my RAK833 - once I’d navigated the script it just worked!

To run MP forwarders with TTS(CE) (Aka TTN V3):

3 Likes

Hi again, I have now followed Jac´s detailed and clear instructions and everything has gone well, EXCEPT that in the Balena log I get the message “Unable to fetch configuration from TTN. Is the TTN API reachable from gateway? Are your GW_ID and GW_KEY correct? Retry in 30s” I have double-checked the ID & Key, but I don´t fully understand the first question “Is the TTN API reachable from gateway?”. Your advice is appreciated, regards, Ulf

You have set the variables GW_ID, GW_KEY and GW_TTSCE_CLUSTER? Using the Gateway ID from the V3 console? Not the name? (So first column, not the second in the gateway list view)

Correct; first row - GW ID (not name or EUI)
GW_Key: the secret API key generated in TTN Console.
GW_TTSCE_CLUSTER: “eu1”

I noticed however when I created the gateway in Balena that the GW EUI wasn´t added as a tag automatically, so I added it manually. Furthermore, during the setup, I changed the RPi connection from ethernet to wifi, which changed the MAC address and hence the GW EUI. I have changed that in both TTN and Balena, but the problem remain. Could any of these cause this issue, should I start all over?

The EUI is not required and should not be a problem.

What rights have you granted the API key?

Good morning! I have granted the rights “Link as Gateway to a Gateway Server for traffic exchange, i.e. write uplink and read downlink” as described. Regards, Ulf

Yesterday build a Docker Image based on your Git repo. Simply changing Dockerfile.template in Dockerfile and rename the “%%BALENA_MACHINE_NAME%%” with rpi for my Pi Zero W. It runs for a few hours to build the image and today i have started the image as replacement for my V2 Docker Image. It works like a charm, perfect and easy migration. I can recommend that way for Raspberry Pi with IMST iC880a concentrator boards when you don’t want to use the balena cloud. Thanks for your work, it makes it very simple to migrate.

2 Likes

Yes! that should work! thank you for the clarification!