libmDot joinNetwork error
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
I have a working Loriot application.
If I update libmDot to the last version (14:121e4c454964), I need to do that to get new sleep functionality, my application starts to fail joining the network (error -4).
If I revert to old libmDot (10:0b4eb17d07ae) join works ok.
while ((ret = dot->joinNetwork()) != mDot::MDOT_OK) {
serial.printf("ERROR: failed to join network %d:%s\n\r", ret, mDot::getReturnCodeString(ret).c_str());
osDelay(10000);
}
Prints
ERROR: failed to join network -4:Join Error
Where can I find documentation about libmDot changes?
https://developer.mbed.org/teams/MultiTech/code/libmDot/wiki/libmDot-Change-Log
The new library has join backoff after a failed attempt. It is a time on air duty cycle backoff so it will depend on the datarate that was used for the join attempt.
A loop like this might work better.
while (!dot->getNetworkJoinStatus()) {
osDelay(dot->getNextTxMs());
if ((ret = dot->joinNetwork()) != mDot::MDOT_OK) {
serial.printf("ERROR: failed to join network %d:%s\n\r", ret, mDot::getReturnCodeString(ret).c_str());
}
}
Thank you Jason, it worked OK.
Unfortunately I am not sure I understand why. Can you suggest me a source of information about good practices on using the library?
The AT Firmware is the most complete example of using libmDot
The implementation of each Command in the default AT Firmware shipped on mDot is shown.
Also in CommandTerminal is the serialLoop function that reads from the serial port and send over the radio and vice versa.
https://developer.mbed.org/teams/MultiTech/code/mDot_AT_firmware/?platform=MTS-mDot-F411