Closed alexbn71 closed 6 years ago
I'm sorry I was working on an old version of the library but the new one has a similar problem...
this it works:
void TheThingsNetwork::reset(bool adr)
{
// It's pretty useless this test, the baud rate could be performed every time.
//if (!baudDetermined)
//{
autoBaud();
//}
// Issue a REBOOT using the right baud rate. The response will be garbage if the
// communication is not done at default baud rate and should be discarded
size_t length = readResponse(SYS_TABLE, SYS_RESET, buffer, sizeof(buffer));
// After REBOOT set again the module to the right baud rate.
autoBaud();
// And now get all infos about the module
length = readResponse(SYS_TABLE, SYS_TABLE, SYS_GET_VER, buffer, sizeof(buffer));
// buffer contains "RN2xx3[xx] x.x.x ...", splitting model from version
char *model = strtok(buffer, " ");
debugPrintIndex(SHOW_MODEL, model);
char *version = strtok(NULL, " ");
debugPrintIndex(SHOW_VERSION, version);
@alexbn71 thanks for reporting. Can you file a PR?
The fix is inside TheThingsNetwork::reset no other changes are necessary to get it working.
PS Ignore the two minor improvments that you could find in the code outside "TheThingsNetwork::reset" function, that are not related to this topic.
Alex
Thanks. Can you file a pull request here on GitHub? Otherwise I'll do it, let me know
Sure, sorry...
I hope I did it right, it's my first time
Alex
Closed by #223
Hello,
I issue an "autobaud" to comunicate with RN2483 (at 9600) but when I call the join() function it calls at the beginning the reset() function that restore RN2483 to default baud rate, thus canceling the effect of my autobaud.
If I comment the code inside reset() that issue the reboot, all works fine.
My proposal is to leave the reset() function PUBLIC and leave the programmer the ability to force a reboot. While in the join() function leave only the setting of devEui.
Regards Alessandro