This uses a fork of the Single Channel LoRaWAN Gateway on a Raspberry Pi as described by Dragino on resin.io.
With resin.io you can easily manage multiple gateways on multiple devices remotely and use environment variables (see table at the end of the page) to control each of the device parameters.
It uses a Raspberry Pi Model B+ V1.2 and
- a Modtronix inAir9 SX1276 LoRa Module
OR
Dragino LoRa v 1.3 | inAir9 | Raspberry Pi | WiringPi |
---|---|---|---|
3.3V | 3.3V | pin #1 | |
ICSP GND | GND | pin #6 | |
ICSP MISO | MISO | pin #21 | |
ICSP MOSI | MOSI | pin #19 | |
ICSP SCK | SCK | pin #23 | |
Pin 10 | NSS | pin #22 | 6 |
DIO0 | DIO0 | pin #7 | 7 |
RESET | RST | pin #11 | 0 |
Variable name | Value | More info |
---|---|---|
DIO_PIN | 7 | Optional. Defaults to 7 (WiringPi pin). |
RST_PIN | 0 | Optional. Defaults to 0 (WiringPi pin). |
SS_PIN | 6 | Optional. Defaults to 6 (WiringPi pin). |
EMAIL_ADDRESS | you@domain.com | Optional, empty by default. |
FREQUENCY | Depends on your location and chip | Optional. In Hz. Defaults to 868100000 |
HOSTS | Depends on your location | Optional |
LATITUDE | Your latitude | Optional. Float. Defaults to 0.0 |
LONGITUDE | Your longitude | Optional. Float. Defaults to 0.0 |
ALTITUDE | Your altitude | Optional. Integer. Defaults to 0 |
You should be able to get most of the code from the instructables page (see link in the intro), however I needed to add
#define CFG_eu868 0
#define CFG_us915 1
and
LMIC_setupChannel(0, 916800000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);
to my sketch to connect to it. You can then read the results from the TTN website (https://thethingsnetwork.org/api/v0/nodes/<DEVICEID>/
).