-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32 - Cannot Read Pin Value After Wake on Pin #3835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, this part:
I assume you've removed the intervening logging -- can I get a full log printout of 2 or 3 cycles? |
|
Does this happen on other pins? |
Just tried on pin 26 exactly the same behaviour. |
Still looking at this. Hang tight. |
Filed upstream bug: espressif/esp-idf#2043 There are actually two bugs here (I think).
|
Workaround from Espressif, but I cannot implement or test until after the 25th, as I will be out-of-town. |
can this be implemented using the python pin settings ? |
It looks like Espressif have now fixed this bug in the latest ESP IDF. In d61d119 I updated the esp32 to use the new IDF version, so this bug should be fixed now. |
@diginfo Can you confirm? |
Greedily grab as much RMT memory as we can. It blocks other RMT transmit channels but we only use it temporarily anyway. The more we can grab, the fewer interrupts are needed to keep the transmit going. On ESP32, move CircuitPython to the second core. This helps NeoPixel by moving the RMT interrupt to the second core as well. When testing ESP32 I noticed that settings.toml writes won't apply until after hard reset. This removes that constraint but still requires the password to enable the web workflow. Fixes micropython#3835
Greedily grab as much RMT memory as we can. It blocks other RMT transmit channels but we only use it temporarily anyway. The more we can grab, the fewer interrupts are needed to keep the transmit going. Flickers may still happen due to file system writes but most of the time the animation just pauses. On ESP32, move CircuitPython to the second core. This helps NeoPixel by moving the RMT interrupt to the second core as well. When testing ESP32 I noticed that settings.toml writes won't apply until after hard reset. This removes that constraint but still requires the password to enable the web workflow. Fixes micropython#3835
This is also reported here: https://forum.micropython.org/viewtopic.php?f=18&t=4856
And Here: #3531 (comment)
This is what I thought would be a simple toggling of the wake pin trigger edge, but it turns out not !
This code should get the current value of door pin, and set the wake from deepsleep edge based on the pin value high or low and then put the device into deepsleep awaiting the trigger edge.
There is a 10K pull-down on pin 34 and the switch pulls it high.
The purpose is to wake up and sleep again each time the interrupt is triggered on a different edge.
The time.sleeps() are just to give time to view the output and should not have any other effect other than de-bouncing, but given that the esp32 startup time is 2 seconds, debouncing should not be needed.
It appears to work the first time deepsleep is fired, but thereafter door.value() always reads 0 even though the switch is closed and pulled high !
boot.py
Initially the switch was low:
door:0, edge:5, edgeMc: WAKE_HIGH
Then switch was then enabled (high):
door:1, edge:4, edgeMc: WAKE_LOW
Then, without changing the switch position, it just continuously loops, apparently unable to read the value of door any more:
The text was updated successfully, but these errors were encountered: