LoRa / TheThingNetwork – Install you own backend

In a try to connect my LoRa gateway to a standard backend, I started to install TheThingsNetwork software stack. Even if I did not finish it because it was not compatible to my gateway protocol, here are my starting notes … May be completed later.

 

TheThingNetwork initiative provides a lot of tools. You can directly connect the kerlink BS this open crowd network but you have to flash a specific firmware (I assume I’ll try it, but later). They also provides tools I’ll try to connect to the standard firmware (eventually I could be lucky 😉 ). The tools are listed here at the end of the page.

Pre-requisite

You need to have GoLang installed and Docker to run the different tool provided by thethingnetwork. On a Centos7 you can follow this tuto to install Golang; I only changed the golang version to use 1.6.

To install Docker, you can follow this tuto.

Install RabbitMQ

# yum install epel-release
# yum -y install rabbitmq-server
# /sbin/service rabbitmq-server start
# setsebool -P nis_enabled 1
# systemctl enable rabbitmq-server

Install croft

Croft is a tool creating a UDP socket and pushing content to a RabbitMQ Queue for later processing. To start you have to clone the git repo and build the docker image

# git clone https://github.com/TheThingsNetwork/croft
# cd croft

We need to configure the rabbitMQ URI (really bad way to do it … comment welcome)

edit rabbit.go file and modify

       for i := 0; i < RABBIT_ATTEMPTS; i++ {
                uri := os.Getenv("AMQP_URI")
                uri = "amqp://my.server.name:5672"
                conn, err := amqp.Dial(uri)

Then we can build & run the docker image

# ./build.sh
...
# ./run.sh 
2016/03/11 14:09:00 Croft is ALIVE
2016/03/11 14:09:00 Connected to amqp://my.server.name:5672

5 thoughts on “LoRa / TheThingNetwork – Install you own backend

  1. i use simple MQTT client under windows w/o docker, golang etc.
    Simplest (10 lines of code) console application to receive runtime node packets and save to database. Biggest problem that TTN not provide authorization for node packets. LORIOT.IO look much better

    • I agree : check my solution in the post about installing the gateway, a 10 line shell script is doing the job. This post is only because I tried this more complex way expecting more industrial result. So my search in this way may help someone, that is why it is published.

      • I agree, ready-to-use software easy to use.
        But for initial step may be better custom simple soft.
        Today complete C# simple udp server (under windows) to process gateway messages (over udp). I use experimental branch for gateway from Lora-net (V2 protocol) – so compatibility problem with TTN. If interesting you can see here http://akb77.com/g/iot/lorawan-first/

  2. Hi,
    nice post, as usual.
    Is the Lora backend service works like Sigfox ?
    There is 1 common backend where you can use to redirect to your application ? or there is a different backend service for each operator / country ?
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.