-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32/modmachine: wake_ext1_pins() returns which EXT1 pins caused wakeup. #7990
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
base: master
Are you sure you want to change the base?
Conversation
76a7bf3
to
846f08c
Compare
Fails to build GENERIC_C3 with ESP-IDF 4.4.
|
f4ed298
to
5e2fc75
Compare
I'd love to have this functionality in my project. Is there a way I could compile and test this myself? or merge this PR? |
Of course, if you are comfortable with GIT and have the environment (e.g. ESP-IDF) to compile micropython. |
@karfas much appreciated. I am confident enough with git and I don't have esp-idf but I am sure I can figure how to install it. Is there a guide somewhere I can follow to compile it for the esp32? (maybe I missed it on the docs? I tried to find one) |
@academo: I don't think there is a complete description in the upy docs. In Linux, the process is (relative) straight:
BTW, the forum https://forum.micropython.org/ is most likely a better place to ask about compilation issues. |
@academo: I just uploaded the binary including #7990, based upon the current micropython master branch to https://github.com/karfas/upy-bin/blob/master/micropython-GENERIC-ext1_reason.bin |
Rebased to current master. |
@karfas I'll give it a try this coming week. I am finishing my current project with c++ and arduino (mainly because of this feature and the pwm problem). |
@karfas I tried today to run your .bin in a generic esp32 dev board and it got stuck in an infinite reboot loop. I fully erased the flash before installing your binary
... and so on... I confirmed by reinstalling EDIT:
|
To followup: I build my own firmware.bin and I also get this reboot loop. I guess there's something in master that is broken. |
@academo: I also get the boot loop when flashing using your esptool.py command.
Most likely, I had created the bin in some wrong way. |
This is now tested and working on my ESP32-D0WDQ6 (revision 1) chip on an ESP32 DevKit V1 board (or clone). import machine
from machine import Pin, TouchPad
import time
import esp32
import esp
if machine.reset_cause() == machine.DEEPSLEEP_RESET:
print("Reset: Wakeup from deep sleep")
else:
print("Reset: Other reason")
print("wakeup_reason(): {}".format(machine.wake_ext1_pins()))
pin4 = Pin(4, mode = Pin.IN, pull = Pin.PULL_DOWN)
wake = Pin(2, mode = Pin.IN, pull = Pin.PULL_DOWN)
esp32.wake_on_ext1(pins = [wake,pin4], level = Pin.WAKE_HIGH)
time.sleep(2)
print('Going to sleep')
machine.deepsleep() returns e.g.
or
For the second test, I connected both inputs to the same button. |
@robert-hh: Can you test/review this ? It's mostly your code, anyway. |
737d49a
to
8a5d885
Compare
@karfas can you share me the new bin? I can help you testing in some of my ESP32 dev boards. I |
@academo: New binary was uploaded to https://github.com/karfas/upy-bin. Flashing worked on two of my test devices. |
I'm sorry for bumping an old post (I've been watching it for some time), but having this functionality would be really excellent. The log automated check did not retain a record of why the build failed in "docs / build". I'm not an expert, but could this mean there was some formatting mistake in the documentation? |
Code size report:
|
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #7990 +/- ##
=======================================
Coverage 98.50% 98.50%
=======================================
Files 155 155
Lines 20549 20549
=======================================
Hits 20241 20241
Misses 308 308
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Thomas Wenrich <twenrich@gmail.com>
I've done some digging as I'd like this feature for a project. The build fails because despite what the docs say, |
I'm hitting this same bug, it's terrible. |
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
This had been discussed in the forum => https://forum.micropython.org/viewtopic.php?f=18&t=11272
Is it OK that this is in modmachine.c and not in modesp32 ?
I still need to test this.