jpmeijers / RN2483-Arduino-Library

Arduino C++ code to communicate with a Microchip RN2483 module
Apache License 2.0
84 stars 60 forks source link

Implement configuration of ABP and OTAA in examples by pasting Example code #41

Open SloMusti opened 7 years ago

SloMusti commented 7 years ago

The TTN website in Device mode displays keys for device in ABP mode in the section Example Code that looks like:

const char *devAddr = "xxx"; const char *nwkSKey = "xxxxx"; const char *appSKey = "xxxxx";

it would be best to refine the examples such that one can simply paste this and uncomment the suitable ABP or OTAA mode, as otherwise pasting keys and swapping their order and similar may occur (as it did to me).

jpmeijers commented 7 years ago

I've implemented this in the ArduinoUnoNano-basic example. Maybe this can be done a little cleaner by defining the keys at the top of the file, and not directly before the init(). But then users that want to switch to OTAA needs to change code in two places.