Consumption & idle Loop
-
@romeo01 that's how MySensors works. A node is either asleep (radio powered down) or active (radio listening for incoming messages or transmitting).
A low power node thus sleeps, wakes up and possibly sends some data and goes to sleep again. -
@yveaux Tnx fer fast reply.
Is there there any way to put the radio in standby (no TX, no RX) when node is active ?
-
If you really need "long" processing with radio off you can try to use the methods from transport layer that are called from inside the sleep method of the library, but you would probably be better off with your own sleep method.
void transportDisable(void) ... processing ... void transportReInitialise(void) -
@yveaux Tnx fer fast reply.
Is there there any way to put the radio in standby (no TX, no RX) when node is active ?
-
-
@romeo01 said in Consumption & idle Loop:
Many low power node (running on batteries) don't need to be in RX mode.
Like temp, door contact sensor, .....
These simplest node only send datas.I understand your point, but on the other hand a low power node will normally sleep >>99% of its time, then wake up (e.g. once per hour or by interrupt) quickly measure something and send the measurement data to the gateway.
The time a low power node is awake is normally extremely short compared to the sleeping time, and therefore the consumption of the node during wake time is largely irrelevant (if you don't push it ;-) ) w.r.t. its consumption wile sleeping.E.g. sleeping consumption 4.5uA, wake consumption 15mA, wake time 10ms, wakes 1x per hour.
Consumption per hour: (3600-0.010) * 0.0045 + 0.010 * 15 = 16,199955 + 0,15 = 16,349955 mA/hourE.g. sleeping consumption 4.5uA, wake consumption 1mA, wake time 10ms, wakes 1x per hour.
Consumption per hour: (3600-0.010) * 0.0045 + 0.010 * 1 = 16,199955 + 0,01 = 16,209955 mA/hourAs you can see the sleeping consumption (16,199955 mA) is the dominant factor in this equation, so switching the radio off while awake will hardly reduce the overall power consumption of your low power node.
-
In my case, node is awake every 5 minutes for a couple of measure (no data sent).
An average from previous measure is only sent once by hour.
Sometimes, awake by interrups or for monitoring some sensors.
Most of time, no need to sent data.In summary, in some case, a node can be awake and doesn't send anything.
NRF24 is still there in RX for pumping some power. -
@Yveaux just proved You that it does not matter if the node is consuming 15mA or 1mA during wake time. Power consumption during wake time may be an issue only if Your node wake time to sleeping time ratio is significant enough and it is not the case You described.
-
In my case, node is awake every 5 minutes for a couple of measure (no data sent).
An average from previous measure is only sent once by hour.
Sometimes, awake by interrups or for monitoring some sensors.
Most of time, no need to sent data.In summary, in some case, a node can be awake and doesn't send anything.
NRF24 is still there in RX for pumping some power.@romeo01 I consulted with @tekka and for nRF24 the radio will be in idle/standby after wakeup, until loop() restarts. This behavior is not consistent over radios, but at least this it how it works for nRF24.
It means that as long as you don't exit the loop() function, the radio will stay in standby.
I suggest you create a for-loop in which you call the sleep() function, until you have to report the values, e.g.
void loop() { for (int i = 0; i < 12; ++i) { // Measure value and average, then go to sleep // ... sleep(5*60*1000); // Woke from sleep, nRF24 is in standby } // Send averaged value every 1 hour // ... // exit loop(), nRF24 Rx will be activated } -
Hi Yveaux, many thanks for your effort to my case.
I didn't knew that after a wakeup, nrf24 is in stby before the next restart loop.
Indeed, I tried a new sketch and confirm this particularity.So, a workaround should be to put a "sleep()" at start of the "loop"
void loop() { // => At this point NRF is in RX mode sleep(xxx ms); // Put NRF24 in stby // ****** // // All job here without NRF consumption !! // // ***** } // End of loopI will do something like that !!
Maybe, a new definition should be interresting, like MY_NRF24_RXMODE_DISABLED
I'm sure many nodes never need the RX mode.
PS: Hum.. !! I didn't tried if after the send command, NRF24 come back in RX mode or not.