Arduino Leonardo serial port and MySensors sleep
-
Hello!
I try to use Leonardo for my sensor development and encounter strange problem:
Sensor successfully initialized, perform first loop, and after entering sleep() never come back, TX LED on Leonardo constantly lights.
Anybody have an idea? Replacing sleep() with delay() solves the problem, but i fear what sensor can lost packets from gateway during sleep.Arduino 1.6.0, MySensors library 1.4.1
demo code
https://codebender.cc/sketch:87221Sketch log:
Starting
sensor started, id 105
send: 105-105-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1
send: 105-105-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
into sleep -
Hello!
I try to use Leonardo for my sensor development and encounter strange problem:
Sensor successfully initialized, perform first loop, and after entering sleep() never come back, TX LED on Leonardo constantly lights.
Anybody have an idea? Replacing sleep() with delay() solves the problem, but i fear what sensor can lost packets from gateway during sleep.Arduino 1.6.0, MySensors library 1.4.1
demo code
https://codebender.cc/sketch:87221Sketch log:
Starting
sensor started, id 105
send: 105-105-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1
send: 105-105-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
into sleep -
I have never tested the Leonardo board. A good starting point would be to check if the LowPower library used supports it.
https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/utility/LowPower.cpp