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
All needed elements are listed below
Step 1: Hardware
You can find all hardware elements here, or listed below
Once you have all the pieces, it is like playing with LEGO ... enjoy it :)
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:
Change Sketchbook location under file --> preferences
If needed add additional boards under file --> preferences... I've been using:
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://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