Whats even more interesting that it seems to sleep/wake just fine upon Join Error:
[INFO] Configure radio for TX
[WARNING] Radio Busy, cannot open Rx Window
[ERROR] Failed to join network
[ERROR] Failed to join network -4:Join Error
[INFO] entering sleep (stop) mode 00000037
▒(here it wakes successfully!)
[INFO] Send join request RxDelay: 0 Rx1Offset: 0 Rx2Freq: 869525000 Rx2Dr: 0
[INFO] Configure radio for TX
Although I can’t find “[INFO] entering sleep (stop) mode 00000037″ anywhere, to see how it’s going into sleep – is this part of the mbed-os library?
dot_util contains something close, but it’s obviously not what’s being printed (confused why I don’t see anything along the lines of “…until next free channel”)
ret = dot->joinNetwork();
if (ret != mDot::MDOT_OK) {
logError("failed to join network %d:%s", ret, mDot::getReturnCodeString(ret).c_str());
// in some frequency bands we need to wait until another channel is available before transmitting again
uint32_t delay_s = (dot->getNextTxMs() / 1000) + 1;
if (delay_s < 2) {
logInfo("waiting %lu s until next free channel", delay_s);
wait(delay_s);
} else {
logInfo("sleeping %lu s until next free channel", delay_s);
dot->sleep(delay_s, mDot::RTC_ALARM, false);
}
}