LoRa Gateway ESP8266 Arduino DIY

Introduction: LoRa Gateway ESP8266 Arduino DIY

This instructable will help you create a LoRa Gateway compatible with The Things Network, for all world regions, using an ESP8266 along with an RFM95/96 radio module. The source code to make it work is also provided and it comes with an integrated web interface for configuration, it is very easy to use, you'll see ... let's go

Source code https://github.com/pulsartronic/LoRaWANGatewaySC

Supplies

All needed elements are listed below

Step 1: Hardware

Step 2: Note About the Provided PCB / Schematics

Greyed out parts are not used in this project, they are there because this same circuit can be used in a project i am currently writing.

Step 3: Software

Now you have to setup the Arduino IDE, note that you can use any other framework you like. It is not difficult but you have to do one or two things in order to compile the project. Code is hosted in github.com, it is open source, feel free to be constructive, reporting bugs or making suggestions would be a great contribution :) Download it and open:

LoRaWanGateway/LoRaWanGateway.ino

Change Sketchbook location under file --> preferences

If needed add additional boards under file --> preferences... I've been using:

http ://arduino.esp8266.com/stable/package_esp8266com_index.json

Pay attention here, older versions wont work properly, you have to install at least version 2.6.3

Select your board under tools --> Board (maybe not the same as the picture, chose yours)

It should now compile, upload it to your board and configure it using the web interface.

Step 4: Web Interface Configuration

Once you have put all the pieces together you can open and configure your new gateway through its integrated web interface. It is a little page inside the ESP8266 that let you easily tweak its values ... take a first glance and play with the configuration demo here. With this interface you are able to configure:

  • WiFi connection, either as a Client device or as an Access Point
  • TTN Gateway parameter
  • RFM module parameters
  • Basic ESP8266 System parameters
  • Configuration Interface security/password (yes, it is password protected)

By default it will create a WiFi network to let you access its internal configuration.

  • wifi: Access Point ESP
  • pass: 12345678

If extreme security is concerned, you should change the default values, before upload the firmware to your gateway. Either way you can change them from your browser after the first connection. Once running, gateway configuration can be accessed through a web browser either by its already assigned ip

http://X.X.X.X/

or if connected through the Access Point

http://192.168.4.1/ (by default)

Now you can use your credentials to log in, defaults are:

  • user: admin
  • pass: admin

Step 5: Add a TTN Gateway

Last but not least, you have to create a Gateway in The Things Network and configure its parameters accordingly, in order to get your device registered and linked.
Login into The Things Network console and select GATEWAYS.

Register a new one using its corresponding ID found in the gateway configuration page. Fill up all remaining fields as needed. Both id's must match.

Now, it should be ready to show data.

That's it, I hope it is clear enough... if you have any problems, feel free to ask any question

Be the First to Share

    Recommendations

    • First Time Author Contest

      First Time Author Contest
    • Metal Contest

      Metal Contest
    • Fruit and Veggies Speed Challenge

      Fruit and Veggies Speed Challenge

    7 Comments

    0
    thamart63
    thamart63

    2 months ago

    Thank you for this fantastic project! Works like a charm, also with a WEMOS D1 Mini V2. I was also able to connect to The Things Stack (TTS) V3. Great job!

    0
    serkankucuk96
    serkankucuk96

    Question 3 months ago on Step 4

    Hi, i build the gateway but have a problem. Gateway ise a connect TTN but didn't receive messages. Gateway shows sending message.where do you think the problem could be

    0
    carlwoa
    carlwoa

    Question 6 months ago on Introduction

    Hi! i need some help..
    ide return this error : No such file or directory #include <sys/_tz_structs.h>
    Thank you

    0
    johntlandgrave
    johntlandgrave

    Question 1 year ago on Step 5

    Fantastic article! Thanks for your contribution. Can you add a link to the code on Github? I've searched and can't find it.

    0
    Penolopy Bulnick
    Penolopy Bulnick

    1 year ago

    Nice job on your first Instructable :)

    0
    pulsartronic
    pulsartronic

    Reply 1 year ago

    thanks