LowPowerLab Forum

Hardware support => Moteino M0 => Topic started by: gbsmith on August 05, 2018, 09:54:31 PM

Title: Ways to Sleep Moteino M0
Post by: gbsmith on August 05, 2018, 09:54:31 PM
I need to know how to sleep for about 5 minutes in a loop.
I tried the  "ArduinoLowPower.h" library and the command
LowPower.deepSleep(300000);
I works in a fashion but I get 30 mA running and 16 mA sleeping!
I have the BME280 and RFM69HW from LowPowerLab attached and also
using the MySensors.h library.  I don't know if MySensors 2.3 supports the Moteino M0?
I suspect the RFM69HW radio does not go into sleep mode.
Where is the documentation from LowPowerLab to get the low current draws claimed?

Title: Re: Ways to Sleep Moteino M0
Post by: Felix on August 06, 2018, 01:53:31 PM
Hi gbsmith,
Unfortunately I am not familiar with MySensors 2.3.

There is a deep sleep sketch sample posted here, to get you to sub 10uA sleep with Radio and FLASH-MEM.
https://lowpowerlab.com/guide/moteino/moteinom0/

Any additional components you add to your circuit will have to be slept as well.
For the BME280 you will need to call bme280.setMode(MODE_SLEEP); as seen in the sample sketch here (https://lowpowerlab.com/guide/weathershield/simple-weather-node/) or RFM69 WeatherShield example here (https://github.com/LowPowerLab/RFM69/blob/master/Examples/WeatherNode/WeatherNode.ino).

Title: Re: Ways to Sleep Moteino M0
Post by: gbsmith on August 06, 2018, 07:12:00 PM
Solved by doing a SPI write to the RFM69 Operation Mode register to sleep the radio.   Here is a working example:

https://github.com/gb53smith/Public/blob/master/MySensors_BME280/MySensors_BME280.ino

This is a workaround since the MySensors.h method did nothing.
sleep(sleepTime);

I got the Moteino M0 to sleep with ArduinoLowPower.h using a single statement:
LowPower.deepSleep(sleepTime);
In my opinion a lot simpler than the RTCZero.h example.  :)
I could not accurately measure a current below 100 uA so I cannot compare with the RTC method.




Title: Re: Ways to Sleep Moteino M0
Post by: alexsh1 on November 13, 2018, 04:06:43 AM
MySensors do support SAMD21 so should be no problem.
I can see you have properly defined HW version:


#define MY_IS_RFM69HW


Did you try it without a new driver? I was not able to make it work properly with #define MY_RFM69_NEW_DRIVER