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

First message lost after (2) reset #58

Closed
pablomargareto opened this issue Nov 19, 2016 · 3 comments
Closed

First message lost after (2) reset #58

pablomargareto opened this issue Nov 19, 2016 · 3 comments

Comments

@pablomargareto
Copy link

pablomargareto commented Nov 19, 2016

Hello,

I am using this library with my NodeMCU (ESP8266) and the RFM95W.

Everything works fine if I send messages periodically. The problems comes when I reset twice.

Example:

  • I send periodically and I reset => No problem, the first message is sent
  • I reset again => The first message is lost (I can see the counter in TTN)

Once I receive a new message again, the cycle repeats.

I am using the sub band 1 in the US (through select sub band). Can anyone give me some hint about what I am doing wrong?

Thanks!

@pablomargareto pablomargareto changed the title First message lost after reset First message lost after (2) reset Nov 19, 2016
@Oliv4945
Copy link
Contributor

Hi,

This is not a bug : there is a counter (lmic.fCnt) inside the stack in order to help the server to detect uplink resend. So with the reset you send a packet twice with 0, the second is dropped.
If you are using TTN try to declare your device with the option --relax-fcnt or use OTAA.

@matthijskooijman
Copy link
Owner

Yup, it is as Oliv4945 explains. You should either use OTAA, or save the frame count. As a workaround you can use the frame count relaxation, but I suspect that you are already doing this and this is exactly what triggers this behaviour (since TTN sees frame counter 0 twice and assumes that the second one is a duplicate). In any case, not a LMIC problem I believe, so I'm closing this issue.

@Oliv4945
Copy link
Contributor

Oliv4945 commented Nov 20, 2016

or save the frame count

I would not do that way, or saving all lmic structure : when reseting the stack will use default parameters, and the network will not send its current set as it will not know that the node has restarted

ngraziano pushed a commit to ngraziano/arduino-lmic that referenced this issue Nov 26, 2018
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

No branches or pull requests

3 participants