I am so sorry but. need to reopen the issue 9278.
I have seen that others seem to have the very same problem (RAK 4630 Join Timeout, https://forum.rakwireless.com/t/lorawan-connection-problem-in-arduino/7227,.…) and none has found the root cause of it.
After using a different power supply it worked well ( no TX_TIMEOUT anymore) but not for very long.
Learning so far.
- its not the GW
- its not the hardware (may be the power supply)
- its not in the code as such but may be in the boot loader etc)
Now I connected the 3172 dev board to an OTII battery analyzer to see the power draw and I can see that the chip never tries to send out something, so the error message makes sense. The problem is that something holds back the code to start sending.
Now I did the following test.
(1)
I flashed the complete firmware RAK3172-E_latest.hex ( fw 4.0.1. + bootloader) and test the TX using AT commands ( works - no error message, see the packets in the gateway, see power draw going up)
(2)
I reflashed your RAK3172-E_latest.bin using your DFU tool and did the same test - works!
(3) I flash a very simple sketch using 4.0.1 without even touching the LORA part in the code. I creates the .bin file and used DFU tool to flash not the Arduino IDE!
void setup() { Serial.begin(115200); }
void loop() {api.system.sleep.all(100000);}
I run the sketch but don’t use any AT commands.
(4) No I redo step two and flash your RAK3172-E_latest.bin. Test with AT commands fails ( no packet in Gateway, no power consumption increase indicating TX but the known error message: +EVT:JOIN_FAILED_TX_TIMEOUT
This means the very same firmware on the very same hardware does not work anymore once a compiled firmware that is not doing anything was flashed and started between. I repeated this pattern two times to make sure its really repeatable.
From this, I would conclude that the compiled sketch does something in some part of the flash that sometimes causes the problem.
To come closer to the root cause I need your help.
- I there any portion of the flash that is written by the bootloader of a compiled sketch that I can compare?