Hi there,
I'm running MicroPython v1.9.4-409-g434975def and have successfully used a Pin irq to wake from deep sleep and can confirm the wake reason:
[code]
import machine
from machine import Pin, TouchPad, deepsleep
import time
wake = Pin(14, mode = Pin.IN, pull = Pin.PULL_DOWN)
wake.irq(trigger=Pin.WAKE_HIGH, wake = machine.DEEPSLEEP)
time.sleep(5)
deepsleep(5*1000)
[/code]
after bringing Pin 14 line up to 3V3
[code]
Reset cause: DEEPSLEEP_RESET
Wake reason: PIN_WAKE/EXT0_WAKE
[/code]
Now I'm trying to do the same but with a TouchPad input:
[code]
from machine import Pin, TouchPad, deepsleep
import time
import esp32
wake = Pin(14, mode = Pin.IN)
touch = TouchPad(wake)
touch.config(500)
esp32.wake_on_touch(True)
time.sleep(5)
deepsleep(5*1000)
[/code]
(after 5 seconds and touching/untouching wire to Pin 14)
[code]
Reset cause: DEEPSLEEP_RESET
Wake reason: TIMER_WAKE
[/code]
The range of my touch.read() values are around 700 when untouched, and down to around 100 when touched. I've tried adjusting the touch.config to various settings but I cannot get my ESP32 to wake from touch.. only from timer in this mode.
Lastly,
I've tried using wake_on_ext1
[code]
import machine
from machine import Pin, TouchPad
import time
import esp32
wake = Pin(14, mode = Pin.IN, pull = Pin.PULL_DOWN)
esp32.wake_on_ext1(pins = [wake], level = Pin.WAKE_HIGH)
time.sleep(5)
deepsleep(5*1000)
[/code]
But this resets immediately regardless of whether I bring Pin 14 high or not (not in touch mode, mind you).
[code]
Reset cause: DEEPSLEEP_RESET
Wake reason: EXT1_WAKE
[/code]
I've browsed through the esp32 module code, but I'm not sure if any of the wake modes work?
Any ideas?
ESP32 module, wake_on_touch, wake_on_ext1
-
- Posts: 18
- Joined: Thu Sep 27, 2018 10:19 am
Re: ESP32 module, wake_on_touch, wake_on_ext1
Hi;
I am interested in wake up ESP32 from touch pin. Have you found a solution?
Thanks.
I am interested in wake up ESP32 from touch pin. Have you found a solution?
Thanks.
-
- Posts: 18
- Joined: Thu Sep 27, 2018 10:19 am
Re: ESP32 module, wake_on_touch, wake_on_ext1
I have the same problem that ESP32 resets immediately, however it worked sometimes (I have a video). But now it does not work, and the board resets after deep sleep. Any help is highly appreciated.andermutu99 wrote: ↑Fri Nov 02, 2018 10:56 amHi;
I am interested in wake up ESP32 from touch pin. Have you found a solution?
Thanks.
import machine
from machine import Pin, TouchPad
import time
import esp32
wake = Pin(4, mode = Pin.IN, pull = Pin.PULL_DOWN)
esp32.wake_on_ext1(pins = [wake], level = Pin.WAKE_HIGH)
time.sleep(5)
machine.deepsleep(10000)
Thanks.
Re: ESP32 module, wake_on_touch, wake_on_ext1
I was looking for information for a few hours about raising from deep sleep using a touch pin. I solved it with your code and by taking out the 10000 in the last line of your code. It now reads: machine.deepsleep()andermutu99 wrote: ↑Fri Nov 02, 2018 5:46 pmI have the same problem that ESP32 resets immediately, however it worked sometimes (I have a video). But now it does not work, and the board resets after deep sleep. Any help is highly appreciated.andermutu99 wrote: ↑Fri Nov 02, 2018 10:56 amHi;
I am interested in wake up ESP32 from touch pin. Have you found a solution?
Thanks.
import machine
from machine import Pin, TouchPad
import time
import esp32
wake = Pin(4, mode = Pin.IN, pull = Pin.PULL_DOWN)
esp32.wake_on_ext1(pins = [wake], level = Pin.WAKE_HIGH)
time.sleep(5)
machine.deepsleep(10000)
Thanks.
Here's what I uploaded to the ESP32:
import machine
from machine import Pin, TouchPad
import time
import esp32
wake = Pin(4, mode = Pin.IN, pull = Pin.PULL_DOWN)
esp32.wake_on_ext1(pins = [wake], level = Pin.WAKE_HIGH)
print('Entering Deep Sleep in 10 seconds.')
time.sleep(10)
print('Time is up. Going to sleep')
machine.deepsleep()
I did put ten seconds into the sleep command so I had time to stop the code from running. That way I can upload something else. I don't have any wire attached to the module. I have to touch the actual pin.
Thank you!
fid
Re: ESP32 module, wake_on_touch, wake_on_ext1
old post, I know..
.. but i was looking for deep sleep mechanisms on esp32 and tried that code (watch one post up)
(in particular, pin 4 pulldown activated, wake_on_ext1 with all high)
directly after machine.deepsleep(), my esp reboots.
does anyone have an idea, why?
.. but i was looking for deep sleep mechanisms on esp32 and tried that code (watch one post up)
(in particular, pin 4 pulldown activated, wake_on_ext1 with all high)
directly after machine.deepsleep(), my esp reboots.
does anyone have an idea, why?
Re: ESP32 module, wake_on_touch, wake_on_ext1
deep sleep turns the cpu off, so it must be (re-)started. light sleep does not turn the cpu off. use light sleep if you don't want a restart.
Re: ESP32 module, wake_on_touch, wake_on_ext1
The problem with old threads (and the code you find there) is, well, they are old .
I assume the ESP goes to deep sleep and wakes up immediate - this looks like a reboot.
Maybe you should try to activate wake_on_touch() with the handy function described in https://docs.micropython.org/en/latest/ ... esp32.html ?
A quick google search got me to https://microcontrollerslab.com/micropy ... p-sources/ - there you will also find a touch wakeup example.
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
My repositories: https://github.com/karfas