@beegee, still no luck here. It looks like AT+Z is not a valid command. ATZ (without the +) will reset the MCU, but doesn’t change any settings. According to the AT command set docs ATR is the command to restore factory defaults. There are a few commands listed in the firmware AT? output that aren’t in the docs, but that’s a separate issue.
Here are the steps I went through (Using RUI 3.5.3 BSP).
- Loaded an “empty” sketch via the Arduino that simply has a 5 second delay in the “loop” function.
- Using the AT commands, I restored the module to factory defaults (ATR).
- I ran AT+JOIN=? to get the join settings. AT+JOIN returned 0:0:8:0. This should mean not joining, no auto join on power up, 8 second delay between attempts, and zero retry attempts, correct?
Once that was done, I loaded the sketch that should join the LoRaWAN network, a very slightly modified version of the code @carlrowan provided above.
When that code starts up, we saw the same result (join failure, with EVT:JOIN_FAILED_TX_TIMEOUT). If I run the AT+JOIN=? command again, while the LoRaWAN sketch is running, we get a result of AT+JOIN=1:0:8:0, which should mean that the device is trying to join, is not set up for automatic join on power on, 8 seconds between join retries, and zero retries.
Next, I loaded the “empty” sketch again so that I could reconfigure the device’s join behavior using only AT commands:
- ATR to restore factory settings
- AT+JOIN=1:1:8:8, join, join on power up, 8 seconds between retries, 8 join attempts.
I removed all of the api.lorawan.join() calls from our LoRaWAN sketch, but left in the calls to do things like set the channel mask, etc. When we do this, the first call to set up the LoRaWAN settings (a call to set the app EUI) fails. I’m assuming that this is because the device is already joining due to the join on power up behavior, and things like EUIs cannot be changed while the device is attempting to join.
Next, I decided to test and see if the join with only AT commands still works. I used nrfconnect to flash the factory RUI 3.5.3 firmware package (RUI_3.5.3_RAK4631_dfu_package.zip). I ran ATR to reset to defaults, and then used the exact same EUIs and keys we used the first time, and the same commands and sequence defined in the opening message of this thread. Now the module will not join at all, even using just the AT command set. Here’s the console output.
09:03:37.126 → +EVT:JOIN_FAILED_TX_TIMEOUT
09:03:57.308 → +EVT:JOIN_FAILED_TX_TIMEOUT
09:04:09.316 → +EVT:JOIN_FAILED_TX_TIMEOUT
09:04:21.303 → +EVT:JOIN_FAILED_TX_TIMEOUT
09:04:33.320 → +EVT:JOIN_FAILED_TX_TIMEOUT
I did a little hunting around on Github, and found a DFU package for 3.5.4 (RUI_3.5.4_RAK4631_dfu_package.zip) and decided to give it a try. I flashed it to the device using nrfconnect, then ran ATR to restore factory defaults. Then I used the same AT commands to set up the LoRaWAN connection. I was able to get it to join twice, but when I tried to reproduce the results it was back to the timeout error
To summarize we have gotten the device to join the network via code once or twice, and via the AT commands once or twice, but very inconsistently.
What other options do we have here?