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
-
@doctor64
Just note if anybody try to test: after the bug it is unable to upload new sketches until reset - disconnect your Leonardo from USB, close Arduino GUI, reconnect Leonardo and start Arduino GUI
-
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
-
@hek Accordingly to LowPower library documentation, library support Atmega32U4 processor, so should work on Leonardo.
Look's like i need to investigate deeper.