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





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
    Non-authoritative answer:
    router.eu.thethings.network canonical name = bridge.eu.thethings.network.
    Name: bridge.eu.thethings.network

    The IP address to use in main.cpp is

  • In the code of main.cpp, it should look like this:
    // define servers
    // TODO: use host names and dns
    #define SERVER1 ""
    //#define SERVER1 ""    // 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.


That’s it.

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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s