Send GPS and Sensor Data as valid LoRaWAN packet to TTN.
- Author
- drtrigon
- Date
- 2018-07-25
- Version
- 1.0
- first version derived from
- See Also
- https://github.com/goodcheney/Arduino-Profile-Examples/blob/patch-4/libraries/Dragino/examples/LoRa/LoRaWAN/LoRa_GPS_Shield_TTN
-
https://github.com/dragino/Arduino-Profile-Examples/blob/master/libraries/Dragino/examples/LoRa/LoRaWAN/Arduino_LMIC/Arduino_LMIC.ino
-
https://github.com/dragino/Arduino-Profile-Examples/blob/master/libraries/Dragino/examples/GPS/tinygps_example/tinygps_example.ino
-
http://wiki.dragino.com/index.php?title=Connect_to_TTN#Create_LoRa_end_devices
This example sends a valid LoRaWAN packet with binary payload, using frequency and encryption settings matching those of the (early prototype version of) The Things Network.
Note: LoRaWAN per sub-band duty-cycle limitation is enforced (1% in g1, 0.1% in g2).
- See Also
- https://www.thethingsnetwork.org/docs/lorawan/duty-cycle.html
Change NWKSKEY, APPSKEY and DEVADDR to the keys given for your account and device. Currently it is defined for
- See Also
- https://console.thethingsnetwork.org/applications/vitudurum-drtrigon/devices/test_01
In order to retreive the data from TTN use the python script given Uno_Dragino_LoRa_GPS_Shield_TTN/request-data-ttn-restful.py
Data from TTN can be further processed in Node-RED. If a local install is not available consider using it online e.g. https://fred.sensetecnic.com/ and enable/install TTN library from menu. Currently I am not aware of any online grafana (or similar) tool.
Do not forget to define the radio type correctly in config.h. Currently set for Dragino LoRa GPS Shield.
Required Libraries:
Required Hardware:
Hardware Connection:
- Arduino UNO + LoRa GPS Shield (if use another shield, remove GPS parts)
- Wire GPS_RXD to Arduino A1 (SoftwareSerial TX is analog pin A1 - connect to RX of other device; GPS_RXD = RXD1)
- Wire GPS_TXD to Arduino A2 (SoftwareSerial RX is analog pin A2 - connect to TX of other device; GPS_TXD = TXD1)
- Remove jumper in GPS_RXD/GPX_TXD 1x3 pin header a photo for hardware configuration is here: http://wiki.dragino.com/index.php?title=File:GPSshiwu.png
Thanks to: Thomas Telkamp - 2015 Matthijs Kooijman - 2015 Edwin Chen - modified 21 Mar 2017 suppo.nosp@m.rt@d.nosp@m.ragin.nosp@m.o.co.nosp@m.m Dragino Technology Co., Limited