Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set DataRate when ADR is not set #6

Open
AmedeeBulle opened this issue Sep 4, 2018 · 9 comments
Open

Cannot set DataRate when ADR is not set #6

AmedeeBulle opened this issue Sep 4, 2018 · 9 comments
Labels

Comments

@AmedeeBulle
Copy link
Contributor

It seems that the DataRate gets overwritten and forced to DR0 (SF12BW125) when ADR is not set.

I have a small sketch which sends console input to the modem to illustrate the problem:

Module version is: ARD-078 1.1.6
Successfully joined TTN
Enter command mode...

AT+ADR?
+OK=0
AT+DR?
0
AT+DR=5
+OK
AT+DR?
5
AT+SEND=1:*
+OK
AT+DR?
0

One can see that after the send the DataRate is reset to 0, and I can confirm from the TTN console where the packet is sent to that packet was sent with DR0 (SF12BW125).

When ADR is enabled, DataRate selection is working well -- e.g.:

AT+ADR=1
+OK
AT+ADR?
+OK=1
AT+DR=5
+OK
AT+DR?
5
AT+SEND=1:*
+OK
AT+DR?
5

DataRate stays at 5 and the TTN console reports DR5 (SF7BM125)

@facchinm facchinm added the bug label Sep 4, 2018
@sslupsky
Copy link

Hi @AmedeeBulle Would you be willing to share your sketch for command mode? That looks very useful.

@AmedeeBulle
Copy link
Contributor Author

It is very simple, but if it can help I just uploaded it: AmedeeBulle/TtnModemTest

@sslupsky
Copy link

@AmedeeBulle Indeed you are correct, quite simple!!! Thanks for posting! This will help me debug the MKR WAN a bit better. Have you had any success with low power consumption? I am unable to get the MKR WAN 1300 below 1.16mA during sleep and would appreciate to know if you have been able to reduce the power further than that?

@flhofer
Copy link

flhofer commented Jun 21, 2021

@AmedeeBulle fixed with f849548 (#35)

The data rate used in non-ADR was always overwritten with an Init value at firmware startup. The changes patch this by updating the init parameter and set also the channel default DR. The latter must happen, as internally the send function checks for max length against the default if ADR is turned off.
The next release (1.3.x) should not have any of these issues. 😃

@jpmeijers
Copy link

@flhofer should this fix already be available? I'm testing the MKR WAN 1300 for The Things Summer Academy, and this bug is causing issues for my workshop.

@jpmeijers
Copy link

I actually found a workaround that seems to work. Enable ADR, but force the DR to the preferred one before every transmit.

  modem.dataRate(5);
  int err;
  modem.beginPacket();
  err = modem.endPacket(true);

@flhofer
Copy link

flhofer commented Oct 29, 2021

@jpmeijers sorry for the late reply
you can use my branch version. there it's fixed. I'm working right now on the last details, trying to get the pull requests through. I hope I can finish the process within the next month

@rqg0717
Copy link

rqg0717 commented Jan 28, 2022

any update on this please? facing the same issue... thank you

@flhofer
Copy link

flhofer commented Jan 31, 2022

Hi, @rqg0717

It is fixed in not yet released v1.2.4 of my pull request. It includes the necessary modem firmware update in the MKRWAN standalone sketch. (click on the link to the repo next to the title)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants