Hi,
I use a RAK3172 with an ESP32. The ESP is initializing the RAK3172 and check the connection with the module by setting all keys for LoRaWAN OTAA to zero.
D (7031) RAK3172: Transmit command: AT
D (7051) RAK3172: Status: OK
D (7051) RAK3172: Error: 0
D (7051) RAK3172: Response from 'AT': OK
D (7051) RAK3172: Transmit command: AT+JOIN=0:0:10:8
D (7091) RAK3172: Status: OK
D (7091) RAK3172: Error: 0
D (7091) RAK3172: Transmit command: AT+NWM=1
D (7131) RAK3172: Status: OK
D (7131) RAK3172: Error: 0
D (7131) RAK3172: Transmit command: AT+CLASS=A
D (7171) RAK3172: Status: OK
D (7171) RAK3172: Error: 0
D (7171) RAK3172: Transmit command: AT+BAND=4
D (7221) RAK3172: Status: OK
D (7221) RAK3172: Error: 0
D (7221) RAK3172: Transmit command: AT+BAND=?
D (7251) RAK3172: Value: 4
D (7251) RAK3172: Status: OK
D (7251) RAK3172: Error: 0
D (7251) RAK3172: Set Tx power index: 0
D (7251) RAK3172: Transmit command: AT+TXP=0
D (7281) RAK3172: Status: OK
D (7281) RAK3172: Error: 0
D (7281) RAK3172: Transmit command: AT+ADR=1
D (7321) RAK3172: Status: OK
D (7321) RAK3172: Error: 0
D (7321) RAK3172: Use OTAA mode
D (7321) RAK3172: Transmit command: AT+NJM=1
D (7361) RAK3172: Status: OK
D (7361) RAK3172: Error: 0
If the check is successful the ESP32 will get all neccessary keys from TTI and initialize the RAK3172 with these keys:
D (7361) RAK3172: DEVEUI: 50...49 - Size: 16
D (7361) RAK3172: APPEUI: 00...00 - Size: 16
D (7361) RAK3172: APPKEY: 53...77 - Size: 32
D (7371) RAK3172: Transmit command: AT+DEVEUI=50...49
D (7411) RAK3172: Status: OK
D (7411) RAK3172: Error: 0
D (7411) RAK3172: Transmit command: AT+APPEUI=00...00
D (7471) RAK3172: Status: OK
D (7471) RAK3172: Error: 0
D (7471) RAK3172: Transmit command: AT+APPKEY=53...77
D (7541) RAK3172: Status: OK
D (7541) RAK3172: Error: 0
The RAK3172 tries to join the network, but TTI is throwing a mic mismatch
error. When I unplug the device and switch it on again the join process will succeed (with the same keys).
From the TTN documentation I know that the error comes from a possible error in the app key, but I don´t have any idea why the key only works after a power on reset of the ESP32 and the module.