Hi ursm,
For me OTAA with LMIC works if I do the following:
static const u1_t APPEUI[]={reversed 8 bytes of AppEUI registered with ttnctl}
void os_getArtEui (u1_t* buf) { memcpy(buf, APPEUI, 8);}
static const u1_t DEVEUI[]={reversed 8 bytes of DevEUI reistered with ttnctl}
void os_getDevEui (u1_t* buf) { memcpy(buf, DEVEUI, 8);}
static const unsigned char APPKEY[16] = {<non-reversed 16 bytes of the APPKEY used when registering a device with ttnctl register DevEUI AppKey>}
void os_getDevKey (u1_t* buf) { memcpy(buf, APPKEY, 16);}
You do not need to fill in NWKSKEY and APPSKEY in the LMIC code. The DEVADDR is filled in automatically by the OTAA activation. You can remove the call(s) to LMIC_setSession(), which is the personalized activation call (“old style”)
With the RFM95W you have to come up with a (unique) devEUI; I used the Ethernet MAC code of my Raspberry for that and added 2 bytes (assuming MAC addresses are unique).
The APPKEY is a 16 byte code you make up for your application; this could be shared among multiple nodes,
Once your device is registered and activated you can get all it’s info from ttnctl devices info YourDevEUI
This command will show: APPEUI, DevEUI and AppKey. If the device has been activated correctly it will also show a DevAddr, NwkSKey and an AppSKey.
So after activation the node should have DevAddr, NwkSkey andd AppSkey set.
In the beginning it can beconfusing, with all these keys
Good luck.