RFM69 sleep mode
-
Hi how do I put the RFM69 in sleep mode? I currently getting 4mA current draw for BinarySwitchSleepSensor. On the NRF24 for the same sketch, I get 3uA.
-
If you use the MySensors sleep function it calls
https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/utility/RFM69.cpp#L152I hope the RF69 library sleep function works...
What is the expected consumption?
-
@hek as per this Web site I should get about 16uA http://forum.anarduino.com/posts/list/39.page
-
Cant help you much right now as I don't have my RF69 setup up and running.
Maybe Felix over at lowpowerlab can give you some hints (we use his code for the driver).
-
@hek to get down to 3uA I have to use the following line.
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
How do I do this in the current library. If I use the LowPower library I get an error when compile
-
Tried
gw.sleep(8000);
?
-
@hek with sleep(8000) I still get 3.75mA.
-
Strange that you get different values depending on radio. That points to problem with radio sleep and not the Arduino itself.
So if create a RF69 sketch that just sleeps in loop. What happens if you disconnect radio (after init)? Do you you get ~3.75uA?
-
@hek sorry how will I disconnect the radio?
-
Ahh.. good question if (you're running Moteino with them soldered on).
-
@hek yes the radio is solder on
-
I can't find myself doing anything different from the LowPower library in in MyAtMega328.cpp - sleep(). Need someone else's eyes on it.
-
@hek I see that you have powerDown in the MyHwATMega328.cpp how do I use that function?
void powerDown(period_t period) { ADCSRA &= ~(1 << ADEN); if (period != SLEEP_FOREVER) { wdt_enable(period); WDTCSR |= (1 << WDIE); } #if defined __AVR_ATmega328P__ do { set_sleep_mode(SLEEP_MODE_PWR_DOWN); cli(); sleep_enable(); sleep_bod_disable(); sei(); sleep_cpu(); sleep_disable(); sei(); } while (0); #else do { set_sleep_mode(SLEEP_MODE_PWR_DOWN); cli(); sleep_enable(); sei(); sleep_cpu(); sleep_disable(); sei(); } while (0); #endif ADCSRA |= (1 << ADEN); }
-
You use it by calling gw.sleep() which initiates powerDown.
https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/MySensor.cpp#L820
-
@hek Hi I got a new shipment of Arduino mini pro and after I did the low power hack on this Arduino I now are getting 30uA current usage. Thank again for all you support and for this great MySensor community that you started :). Now I can go full steam ahead in building more sensor for my house.
-
@Francois said:
@hek Hi I got a new shipment of Arduino mini pro and after I did the low power hack on this Arduino I now are getting 30uA current usage. Thank again for all you support and for this great MySensor community that you started :). Now I can go full steam ahead in building more sensor for my house.
So, just to be clear, is this an accurate summary: the full package (Arduino mni pro plus radio) sleeps at 30uA if using the RFW69 but sleeps at 3uA if using the NRF24L01+?
Also, does it make any difference whether it's RFM69W, RFM69CW, or RFM69HW? Do they all draw the same amount of current while sleeping?
-
@NeverDie
Hi, I know this is an old thread, but it is stil a valid subject to me.
I have had success with arduino pro mini v2 and RFM69W in sleep, but not the high power version RFM69HW.
Arduino+RFM69W sleeps at 5.2micro Amp.
Arduino+RFM69HW sleeps at 420micro Amp.
I have written about it in arduino forum.
I would be glad if someone has a solution for this.
-
Hi @peres,
My RFM69HW current during sleep is less than 1 uA aprox, which is consistent with what is shown in the datasheet. Interestingly, this is the result when powering the device with a battery; when powering the device from the PC USB serial, it's around 6 uA - still close enough as it's measured with a "normal" multimeter.
I'Which version of mysensors are you using? I've moved to 2.2.0-beta (due to me needing other functionalities not availabel in 2.1.1, namely ATC which btw works fabulously) and found that support for nrf69 is - although not yet 100% completed - significantly improved. Maybe worth a try to see if that fixes your sleep consumption?
Remember adding
#define MY_RFM69_NEW_DRIVER
to enable the new driver.
Let us know how it goes
-
Hi,
I have the same question, but a little bit different
I use a RFM69 with the Mysensors 2.2.0 beta.
I don't sleep my node with the provided function, since I don't want to sleep for some time, but until a Pin Change Interrupt is triggered (via pin A0 or A1). So, I can't use the sleep() function.
I do put my node to sleep with avr core functions (setting registers, calling power_all_disable() and sleep_cpu()...) but I suppose the radio is never put on sleep !Is there a function I can call to sleep the radio, and if yes, is there another function I should call before sending, to awake the radio ?
Thanks !
-
@napo7
Here the list of the core functions (radio independant):
https://ci.mysensors.org/job/Verifiers/job/MySensors/branch/development/Doxygen_HTML/group__MyTransportgrp.html#gab39d3b81f005e00117269d79c7b2ee4cshould be transportDisable/transportReInitialise
Else the radio specific functions (a layer above driver) are in the MyTransportRFM69.cpp
-
Thanks !
-
@napo7 : you can use sleep with interrupts :
https://www.mysensors.org/download/sensor_api_20#sleeping
-
@Fabien MySensors sleep only supports hardware interrupts. napo7 is using pin change on analog pins which needs to be done in software.
-
That's not a software interrupt. In facts, the atmega supports interrupt on all pins, and also waking-up the device from any pin change, but the sleep function only support "external interrupts" which can only be triggered on pin 2 and 3.
-
@napo7 thanks for the clarification