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

Master 1.3.1 - Data Rate Fix #25

Open
wants to merge 5 commits into
base: master-1.3.1
Choose a base branch
from

Conversation

tohlh
Copy link

@tohlh tohlh commented Jun 26, 2020

Greetings, I have been testing this firmware since last month. I have noticed some bugs related to data rate (DR) and decided to investigate.

This is my comment on PR #78 of arduino-libraries/MKRWAN:

Every time, when I try to send the payload on the first attempt, I am always limited to 11 bytes, regardless of what data rate I am on.

On the second attempt, the limit will always be maximum payload size - 11 bytes.

On the third attempt, the limit will always be maximum payload size - 8 bytes (which is normal).

It turns out that there are a few factors causing the above to happen:

  1. When we change the DR with AT+DR, the DR will only change at the second AT+SEND command. It does not take effect on the first AT+SEND immediately after setting AT+DR.
  2. When we issue AT+JOIN command, the DR is automatically restored to the default data rate. In my case, it is DR2. This is why I was always stuck at a maximum payload size of 11 bytes immediately after I join the network.
  3. For the second attempt, my device was responding with a 3 bytes MAC command issued by my server, hence this is not a problem to fix.

The codes I added will change 2 things:

  1. Make sure the data rate is changed immediately for the next AT+SEND whenever AT+DR is issued.
  2. After successfully joining the network, restore the DR to the one previously configured by the user, not to the default DR.

What I am trying to achieve with my modifications is to ensure a responsive and consistent DR in control of the user. Hope my modifications above helps. Thank you.

Co-authored with: @kygoh

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
All committers have signed the CLA.

tohlh and others added 2 commits April 10, 2021 11:29
This modification allows AT+DR to change the data rate of the next AT+SEND. Previously, we could only change the data rate of the second AT+SEND.
This modification allows the data rate of the device that was set before AT+JOIN to remain even after joining the network. Previously, the data rate of the device will be restored to the default data rate for the first AT+SEND attempt after joining.

Co-Authored-By: kygoh <gohkengyew@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants