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.
Suggested Topics
-
Radio does not go to sleep
Troubleshooting • 7 Jan 2015, 20:47 • A Former User 8 Jan 2015, 08:14 -
Node with Interrupt, sleep and batteries
Troubleshooting • 22 Nov 2015, 19:56 • sundberg84 23 Nov 2015, 18:42 -
Using Sleep RISING mode with momentary switch?
Development • 19 Sept 2016, 19:44 • Sergio Rius 19 Sept 2016, 19:48 -
send() after receive()
Development • 13 Jan 2020, 21:08 • Honza Liška 16 Jan 2020, 22:52 -
DS18B20 Sketch from Examples doesn't brings Node to sleep.
Troubleshooting • 20 Oct 2016, 22:08 • Floca 22 Oct 2016, 17:23 -
Testing a sensor with sleep
Development • 16 Jun 2016, 13:14 • CrankyCoder 17 Jun 2016, 17:17 -
Maximum for .sleep
General Discussion • 12 May 2016, 19:00 • dzairo 13 May 2016, 19:31