Not sure if LMIC is responding to MAC request from gateway #742
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I manage to solve the issue by running "os_runloop_once()" until the next TXRX event if "LMIC.pendMacLen>0", now the device is responding to MAC command correctly. Is there any method for me to get the exact time of the next TXRX event so that I can enter standby during the waiting period? |
Beta Was this translation helpful? Give feedback.
-
You need to call os_runloop_once() continuously in a loop. I've submitted a PR to add a method os_timeToNextTimeCriticalJob() that allows you to find out how long you can sleep for here: #641 |
Beta Was this translation helpful? Give feedback.
-
For a variety of reasons, I've been reluctant to add an explicit API: you have to check two return values (is there a job scheduled, and if so how long it will be). This is even more trouble-prone, in my experience, than the current situation. There's a very workable API, |
Beta Was this translation helpful? Give feedback.
-
In any case, this problem is not a bug as described. Converting to a discussion. |
Beta Was this translation helpful? Give feedback.
For a variety of reasons, I've been reluctant to add an explicit API: you have to check two return values (is there a job scheduled, and if so how long it will be). This is even more trouble-prone, in my experience, than the current situation.
There's a very workable API,
os_queryTimeCriticalJobs()
, which tells you whether you can sleep for a given period of time. It's not ideal, but it's correct, and it's very hard to get the use of the API wrong. It can be used while I think about whether I want to provide yet another API that ties us to the current implementation, or replace the current implementation with something more suitable.