diff --git a/main/main.ino b/main/main.ino index 18d973b..837640f 100644 --- a/main/main.ino +++ b/main/main.ino @@ -101,9 +101,45 @@ void sleep() { #endif } +void printHex2(unsigned v) { + v &= 0xff; + if (v < 16) + Serial.print('0'); + Serial.print(v, HEX); +} + + void callback(uint8_t message) { if (EV_JOINING == message) screen_print("Joining TTN...\n"); - if (EV_JOINED == message) screen_print("TTN joined!\n"); + if (EV_JOINED == message) { + screen_print("TTN joined!\n"); + + Serial.println(F("EV_JOINED")); + + u4_t netid = 0; + devaddr_t devaddr = 0; + u1_t nwkKey[16]; + u1_t artKey[16]; + LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey); + Serial.print("netid: "); + Serial.println(netid, DEC); + Serial.print("devaddr: "); + Serial.println(devaddr, HEX); + Serial.print("AppSKey: "); + for (size_t i=0; i