-
After the ESP-S3 enters a second deepsleep, it becomes unresponsive. I am stumped and would greatly appreciate your advice on how to further troubleshoot/fix this problem. I could not find a solution on-line. I am using Unexpected maker FeatherS3 version P7 flashed with UM_FEATHERS3-20230426-v1.20.0.bin. The interpreter works otherwise. Here's what I've tried so far. I loaded the troubleshooting script below as 'main.py' onto the device. I then reset it, allowed it to cycle through the script, flashing code of '0' as expected and then connected to its REPL interface. I started the first deepsleep cycle by executing 'import machine; machine.deepsleep(1000)'. As expected, the device closes the USB connection, goes to sleep for 1 second, wakes up - flashing 'a', recognizes that it woke from deepsleep by telegraphing Morse code for '5', and then goes to sleep. But it won't wake up! Accordingly, the device does not show up on my USB bus and ignores desperate attempts to reconnect to its USB/REPL using the last port designation. Restarting the device fires the main.py script--ending with the power on reset code being flashed--and permits a connection to REPL. Thank you for your help! J `import machine morse_numbers_dict = { Instantiate FeatherS3 blue LEDblue_led = Pin(13, Pin.OUT); blue_led.value(0) def dot(): def dash(): def morse_code(code): show lifefor _ in range(2): time.sleep(3) signal wakeup causeif machine.reset_cause() == machine.DEEPSLEEP_RESET: # = 5 if machine.reset_cause() == machine.HARD_RESET: # = 6 if machine.reset_cause() == machine.PWRON_RESET: # = 0 if machine.reset_cause() == machine.WDT_RESET: # = 1 if machine.reset_cause() == machine.SOFT_RESET: # = 4 print('end of program')` |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
-> Are you sure it didn't throw an error? |
Beta Was this translation helpful? Give feedback.
-
Another +1. Is there also a possible USB issue? A deepsleep will cause USB to fail. On wakeup the S3 will re-initialise its USB port however I'm not sure if the PC is guaranteed to respond. This may depend on hardware and OS. |
Beta Was this translation helpful? Give feedback.
-
I've dealt with a similar issue on stm that could be related: #8304 If you can get the board powered by a separate supply it would be interesting to know if unplugging & replugging the USB gets it going again |
Beta Was this translation helpful? Give feedback.
-
Thank you, everyone! Dave picked up my mistake. Here's some S3 working deepsleep code in case it is helpful to anyone: import machine
from machine import Pin, deepsleep
import time
morse_numbers_dict = {
'a': '.-', 0: '-----', 1: '.----', 2: '..---', 3: '...--', 4: '....-',
5: '.....', 6: '-....', 7: '--...', 8: '---..', 9: '----.'
}
# Instantiate FeatherS3 blue LED
blue_led = Pin(13, Pin.OUT); blue_led.value(0)
def dot():
blue_led.value(1)
time.sleep(0.2)
blue_led.value(0)
time.sleep(0.2)
def dash():
blue_led.value(1)
time.sleep(0.6)
blue_led.value(0)
time.sleep(0.2)
def morse_code(code):
for symbol in morse_numbers_dict[code]:
if symbol == '.': dot()
if symbol == '-': dash()
# show life
for _ in range(2):
morse_code('a')
time.sleep(1)
time.sleep(3)
# signal wakeup cause
if machine.reset_cause() == machine.DEEPSLEEP_RESET: # = 5
morse_code(5)
deepsleep(1000)
if machine.reset_cause() == machine.HARD_RESET: # = 6
morse_code(6)
if machine.reset_cause() == machine.PWRON_RESET: # = 0
morse_code(0)
if machine.reset_cause() == machine.WDT_RESET: # = 1
morse_code(1)
if machine.reset_cause() == machine.SOFT_RESET: # = 4
morse_code(4)
print('end of program') |
Beta Was this translation helpful? Give feedback.
->
deepsleep(1000)
Are you sure it didn't throw an error?