Xinyuan-LilyGO / TTGO-T-Display

MIT License
1.05k stars 337 forks source link

Sleep function doesn't with this github sketch #22

Closed MobCat closed 4 years ago

MobCat commented 4 years ago

So when I first received and tested this TTGO if you long pressed btn1 you would get a "Press again to wake up" message and then the device would go to sleep. However after flashing the device with the sketch found here and you long press btn1 you will still get the sleep message but the device only stays off for 5 seconds before rebooting its self. any ideas on how to fix this? image

MobCat commented 4 years ago

It would appear that i'm having issues with esp_sleep_enable_ext1_wakeup(GPIO_SEL_35, ESP_EXT1_WAKEUP_ALL_LOW); esp_deep_sleep_start(); Changing the GPIO_SEL_0 for the other button still boot loops. using either code without the other still boot loops too.

MobCat commented 4 years ago

Problem Solved: espDelay(); sleep timer is conflicting with the deep sleep function code calls esp_deep_sleep_start(); esp sleeps and loops back esp_sleep_enable_timer_wakeup(ms * 1000); from the espDelay(); wakes it back up again. Need to use a generic timer for delays that doesn't use esp sleep functions if you want your device to deep sleep