@alexsh1 current draw details in sketch header. 10-20 uA
I had some problems with recovery after gateway power cycling. See discussion here. This issue has been fixed with a workaround.
gbsmith
@gbsmith
Best posts made by gbsmith
Latest posts made by gbsmith
-
RE: How to sleep the Moteino M0?
-
RE: Recovery of Battery Powered Sensor after Gateway Outage
Here is a link to my sketches and log file.
If I don't sleep the SAMD21G18 but instead wait, I can cycle the power on the gateway and the sensor recovers even with my SPI write to a register to implement the radio sleep.
The log file is called "node_debug_wait.txt"However, If the wait is replaced with a sleep, LowPower.deepSleep(10000); the sensor does not recover until it too is power cycled. I also tried the RTCZero.h library to implement the sleep.
See MySensors_BME280_RTC sketch. Both sleep methods work as long as the gateway never goes down.I tried
#define MY_TRANSPORT_WAIT_READY_MS 2000
and the sensor does not connect with gateway at all.
When the sensor is down after the gateway power cycle there is no receive data at the gateway so I did not collect the gateway log.
On the sensor side, once the CPU powers down the serial USB connection lost. I tried both Arduino Serial Monitor and PuTTY to get the sensor log file.
To overcome the serial problem I created a blink function and then inserted that into the code to determine if my interrupt service function was working see MySensors_BME280_Debug.Now the solution:
I added an awake up interrupt service routine which calls transportCheckUplink(). That's it. It seems to be enough to get the transport layer running again after a CPU sleep.My Motenio M0 board only draws 10 - 20 uA total when CPU, RFM69 and BME280 are shutdown with no modifications of the factory board. It is be a very capable yet low power MySensor.
I look forward to official support of sleep for a SAMD21G18 based board. Meanwhile, this is a workaround. -
Recovery of Battery Powered Sensor after Gateway Outage
Re: [SOLVED] GatewayESP8266MQTTClient - Recovery failure after gateway outage
My battery powered sensor works fine while the Gateway is powered. (Stating the obvious).
If I power down the Gateway for more than the sleep period of the sensor will not reconnect to the Gateway and continue sending period messages until I disconnect and reconnect the battery to the sensor.
I am using a SAMD21 based board with the Arduino ArduinoLowPower library for sleeping.
The above solution will drain the battery while waiting for the gateway to come back because sleep is prevented.
Is it possible to do something upon waking from sleep and then go back to sleep immediately if no gateway is found?
While I like the low power sensor solution MySensors with RFM69 provides it must be as robust as my ESP8266 WIFI solution in terms of recovering from any combination of sensor/controller shutdowns. You don't want to be in Hawaii and have your thermostat temperature sensor lock up. -
RE: How to sleep the Moteino M0?
@gbsmith
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);
Aside:
I had to enter the bootloader by double clicking the reset button or reconnecting the USB plug. The COM port number bounced between two port numbers. The port would disconnect just before serial upload. I did not have this problem with the simple Blink example. Does the MySensors library interfere with USB serial port and cause this instability?I found the answer in the LowPowerLabs forum.
There has to be a SerialUSB.begin(); statement in the previously loaded sketch. This will stabilize to USB port connection. -
How to sleep the Moteino M0?
Is anyone using the Moteino M0 as a MySensor?
I have got a BME280 sensor working with the RFM69HW attached but I am not getting low current sleep mode numbers.
I tried the ArduinoLowPower library LowPower.deepSleep(300000); command.
The current drops from 30 mA down to 16 mA.
I need to get to less than 100 uA.
Does the MySensors library support the Moteino M0 (SAMD21G18A) ?
How is the radio turned OFF?
I tried the sleep(300000); command without a response.
Edit August 6:
I tried the BatteryPoweredSensor example from the MySensors library with the
following changes for the RFM69HW radio:// Configure RFM69 Radio #define MY_RADIO_RFM69 #define MY_RFM69_NEW_DRIVER #define MY_IS_RFM69HW #define MY_RFM69_FREQUENCY RFM69_915MHZ #define MY_ENCRYPTION_SIMPLE_PASSWD "redacted" #define MY_RF69_IRQ_PIN 9 #define MY_RF69_IRQ_NUM 9 #define MY_RFM69_CS_PIN A2
I get this in the log file:
Payload Description 66074 MCO:SLP:MS=5000,SMS=0,I1=255,M1=255,I2=255,M2=255 Sleep node, duration 5000 ms, SmartSleep=0, Int1=255, Mode1=255, Int2=255, Mode2=255 66084 TSF:TDI:TSL Set transport to sleep 66094 MCO:SLP:WUP=-2 Node woke-up, reason/IRQ=-2 (-2=not possible, -1=timer, >=0 IRQ) 66104 TSF:TRI:TSB Set transport to standby
Looks like it tries to sleep but wakes up 10 mS later with a -2 return (not possible)
The radio goes back to standby 10 mS later.Can someone tell me what changes to the MySensors.h library are necessary to get this working? Meanwhile, I will try a SPI register write the radio to get it to sleep.
-
RE: 💬 Log Parser
Clearly the debug log format has changed to something that this tool does not support.
My log entries look like:
228642 TSF:MSG:SEND,1-1-0-0,s=2,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0
The old log entries looked like this:
0;255;3;0;9;TSF:MSG:READ,12-4-0,s=18,c=1,t=16,pt=1,l=1,sg=0:1 -
RE: 💬 Log Parser
Just started MySensors 2.3 project. I have the same problem as Nca78 had 5 months again.
Only the two right columns are filled. Better than nothing but not perfect as intended.
And yes I tried running this code directly: https://gist.github.com/henrikekblad/c1d652cce16eaf2ef6340eacaefc97b0
Is anyone maintaining this code?