For first steps with The Things Network, you can build a LoRa Gateway. This gateway will have some restrictions:
- Listens only on one single channel (one single frequency) for nodes
- Listens only with one predefined spreading factor (SF)
- Only listens, does not send back any kind of acknowledge messages
Okay. These are pretty hard restrictions, maybe we better should name it “Forwarder” instead of “Gateway”.
- Raspberry Pi 3
- Dragino LoRa/GPS HAT
- Raspbian “Jessie” with SPI enabled as OS
- Single Channel Gateway software maintained by Thomas Telkamp at github
You need to define the IP address of the TTN server in the gateway software
- In main.cpp, update the IP address of TTN server.
You can find the current IP addresses to use here: For different countries there are different server addresses. Pick the appropriate one.
- For europe (EU), I choose
router.eu.thethings.network # EU 433 and EU 863-870
Note that you can’t enter this server name directly, you need to lookup the IP address before:
$ nslookup router.eu.thethings.network Server: 192.168.178.1 Address: 192.168.178.1#53 Non-authoritative answer: router.eu.thethings.network canonical name = bridge.eu.thethings.network. Name: bridge.eu.thethings.network Address: 18.104.22.168
The IP address to use in main.cpp is 22.214.171.124
- In the code of main.cpp, it should look like this:
// define servers // TODO: use host names and dns #define SERVER1 "126.96.36.199" //#define SERVER1 "188.8.131.52" // The Things Network: croft.thethings.girovito.nl
- Now compile the software and start it
- On start, it will output its Gateway ID, which is important for the next steps:
pi@raspberrypi:~/single_chan_pkt_fwd $ sudo ./single_chan_pkt_fwd SX1276 detected, starting. Gateway ID: aa:bb:cc:ee:ff:11:22:33 Listening at SF7 on 868.100000 Mhz.
This Gatway ID is unique for your gateway.
To create a gateway in TTN, you need to register at TTN and create an account. You then can register a gateway in the console.
- Choose “bridge” as “Activation Method”
- Cut and paste your Gateway ID as “Gateway EUI”
- Choose the appropriate frequency plan
- When you have filled out all fields, press button “Register Gateway” at the bottom of the page.
You now should have created you own experimental gateway in TTN and you should see that it has status “connected”.