Comments (7)
Yes that will work. LDL_MAC_ticksUntilNextEvent
exists for this very purpose, to let you know how long you can sleep for.
It goes without saying that your time source needs to keep working in sleep. On my STM32L port I use LPTIM.
from lora_device_lib.
A limitation of LDL at the moment is that it expects to always be running. If you stop and re-start the time source, you have to update the result of LDL_System_time() (i.e. move it forward) but you can only do that so much before the internal timers wrap around.
A future feature might be some kind of suspend and resume feature to safely take care of all of this.
from lora_device_lib.
There is no fixed rate, instead LDL_MAC_process
must be called when LDL_MAC_ticksUntilNextEvent
returns 0.
In practice if you have a mainloop and you aren't sleeping, it is sufficient to poll LDL_MAC_process
once per loop iteration without ever checking LDL_MAC_ticksUntilNextEvent
.
from lora_device_lib.
Thanks for the reply, in case of my MCU being in low power mode (sleeping), I guess I can do something like below?
while (1) {
sleep_ticks = LDL_MAC_ticksUntilNextEvent();
sleep_mcu(sleep_ticks) // sleeps the MCU for x ticks
LDL_MAC_process();
}
from lora_device_lib.
You're right, I totally forgot about the low power peripherals on the STM32L chips, I am using a STM32L476 and was thinking on use a not very low power sleep mode to keep the systick running.
from lora_device_lib.
Does loramac-node implement something along this lines? I haven't seen anything like this on their examples, maybe I should check the issues and see if somebody have asked about low power modes.
from lora_device_lib.
I don't think so, suspending/resuming as described is a bit niche. They have a start and stop interface but it doesn't seem so useful.
from lora_device_lib.
Related Issues (20)
- 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
- Maximum sleep time due to LDL_MAC_ticksUntilNextEvent() values HOT 7
- 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
- Incorrect MIC generated LoRaWAN 1.1 retransmissions and command responses HOT 1
- Join timeout HOT 2
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.