LoRaWAN Single Channel Gateway

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”.

fullsizerender

Hardware

Software

Configuration

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: 52.169.76.203

    The IP address to use in main.cpp is 52.169.76.203

  • In the code of main.cpp, it should look like this:
    // define servers
    // TODO: use host names and dns
    #define SERVER1 "52.169.76.203"
    //#define SERVER1 "54.72.145.119"    // The Things Network: croft.thethings.girovito.nl
  • Now compile the software and start it
    sudo ./single_chan_pkt_fwd
  • 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.

create_gateway

That’s it.

You now should have created you own experimental gateway in TTN and you should see that it has status “connected”.