Comments (7)
Hello
Previous versions also set the band timer to 60s. It's a legacy thing. I kept it because the low power MCUs I use wake up regularly when hardware timers overflow and so it made no difference.
The interval could be increased. I would choose a maximum of INT32_MAX ticks as a way to ensure the time tracking in processBands() never overflows. I notice processBands() ignores differences larger than INT32_MAX but that can be changed.
LDL_TIMER_BAND exists because it seemed easier to use a single purpose timer rather than overload one of the others and then have to work out which part of the code was responsible for clearing it.
I think it is useful to have an event for when a ldl_mac.band counts down to zero. Perhaps LDL_MAC_ticksUntilNextEvent() should be refactored to check ldl_mac.band as well as inputs and timers.
from lora_device_lib.
I've increased LDL_TIMER_BAND interval in master to a large number that won't break time tracking
from lora_device_lib.
I've increased LDL_TIMER_BAND interval in master to a large number that won't break time tracking
Thanks!
from lora_device_lib.
Meanwhile I found a working solution for my use case, so I reopen the issue to document it. The comitted changes for LDL_TIMER_BAND interval were not sufficient.
Summary of my requirements:
I'm able to call LDL_MAC_process() regulary, with a maximum interval of several minutes, but want to deep sleep when no transmission or receive event is pending. So I want to distinguish between "important" events (retry of transmission, when channel is not available; wait for reiceive window; ..) and "unimportant" events (band events). In the latter case the LDL_MAC_ticksUntilNextEvent() wait time should not inhibit the sleep.
My solution:
I call LDL_MAC_process() in a loop only, when the mac.state is not LDL_STATE_IDLE. To compensate the missed band events after a deep sleep I ensure that LDL_MAC_process() is called before any other LDL function call.
As a result the process runs in the LDL_MAC_process() loop only after a transmit request - until the transmit was successful and the receive windows elapsed. Afterwards the device goes to deep sleep for several minutes.
from lora_device_lib.
Thanks for sharing your workaround.
I don't think there is a quick fix to avoid spurious wakeups with the current implementation, the whole thing needs to be reworked.
from lora_device_lib.
I've solved this problem in my current working branch (sx1262). I expect to merge this month.
from lora_device_lib.
I'm still running my mentioned solution with the new LDL version (450ae80). It works well. I have also implemented a check for a maximum sleep time, so even between longer retransmission attempts (channel not available, OTAA pending) I can go into deep sleep. I see only the requirements, that after deep sleep the timer is roughly adjusted and LDL_MAC_process() is called again.
I see that LDL_MAC_priority() may also help in many situations, but did not touch my existing solution.
I close the issue, because solutions exists for the described requirement.
from lora_device_lib.
Related Issues (20)
- Incorrect MIC generated LoRaWAN 1.1 retransmissions and command responses HOT 1
- Join timeout HOT 2
- OTAA not recieving JoinAccept HOT 2
- Radio interrupt not raised when message received in SF11 and SF12 HOT 3
- Proposal to remove diagnostic events from ldl_mac_response_type HOT 2
- Proposal to refactor LDL_DEBUG, LDL_ERROR, and LDL_INFO HOT 3
- Simplify function timerDelta()
- Discussion: Better control of confirmed uplink messages from application HOT 4
- possible deprecated #define LDL_LITTLE_ENDIAN HOT 1
- preferred way to use DeviceTimeSync HOT 4
- Add a check for maximum message size on send HOT 2
- Increment devNonce on every join request HOT 6
- Not receiving Join Accept HOT 2
- LPTIM 16 bit ticker HOT 1
- ticksUntilNextEvent keeps returning UINT32_MAX HOT 2
- Lora modules driver
- I am having trouble importing this library to arduino?
- OTAA join-accept not being received HOT 2
- UplinkDwellTime not correctly applied on AU915 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lora_device_lib.