Skip to content

thesolarnomad/resin-ttn-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resin.io The Things Network Gateway based on Raspberry Pi

This uses a fork of the Single Channel LoRaWAN Gateway on a Raspberry Pi as described by Dragino on resin.io.

Overview

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.

Hardware

It uses a Raspberry Pi Model B+ V1.2 and

OR

Default pin mapping:

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

Examples

Rpi from top

RPi top

Rpi from side

both

RPi pin table

RPi pins

inAir9 layout

inAir9 pins

Arduino pin layout

Arduino pins

Dragino 1.3

Dragino 1.3 annotated

Environment variables for resin.io

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

Example

resin.io interface

Client

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>/).