Replies: 2 comments 6 replies
-
In the one place where I put a remote into lightsleep using ESPNow I see I had a wdt.feed() between the two lines. And not because I thought that I may have had a problem. |
Beta Was this translation helpful? Give feedback.
-
Warning: incorrect statements (see reply below). eNet_STA.active(False)
while eNet_STA.active():
time.sleep_ms(50)
lightsleep(5000) Of course, just inserting a long enough sleep (as you did above) will also work.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an application that uses ESPNow to send to a receiver, then go into lightsleep(5000) for 5 seconds of low current draw. Initially every thing was working well. Then I made a slight code alteration; and even though lightsleep(5000) did delay for 5 seconds it was still drawing full current.
In both cases, just before lightsleep() I turned off the network station eNet_STA.active(False). In the case where it worked, and drew low current there was an "if" statement, between eNet_STA.active(False) and the lightsleep(). In the case where it failed (drew full current) I had removed the "if" statement so the lightsleep() immediately followed eNet_STA.active(False).
The only way to get it to function correctly again was to place a sleep_ms(1) after the eNet_STA.active(False).
My hypothesis is even though the eNet_STA.active(False) was executed the transmitter was still in the process of shutting down, and when immediately followed by lightsleep() the transmitter shutdown was suspended, and did not complete until after returning from lightsleep().
In the original code that worked the "if" statement provided sufficient delay for the transmitter to shutdown prior to the lightsleep().
Anyone have similar experiences or comments?
Beta Was this translation helpful? Give feedback.
All reactions