Skip to content
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

ESP32 does not wake from deep sleep #4044

Closed
theDontKnowGuy opened this issue May 31, 2020 · 3 comments · Fixed by #6194
Closed

ESP32 does not wake from deep sleep #4044

theDontKnowGuy opened this issue May 31, 2020 · 3 comments · Fixed by #6194
Assignees

Comments

@theDontKnowGuy
Copy link

Bought 20 WEMOS LOLIN32 with Bat adaptor and connected them to new fully charged lipo 3.7V batteries.
Code is similar to all: do something short, then sleep for 30 minutes, then wake up and so on.
Also, I attached T3 as a touch button to the wake-up triggers on top of the timer.

the issue is: in ±5 of 8 cases, wake up is not triggered, sporadically, and across all 20 devices.
Both triggers (don't) work the same: Timer doesn't always wake up the board as planned, same for the touch button. Sometimes works, some other time doesn't.

Problem existed before I added the touch button option.

Obviously this is very painful cause my project is running already and a lot of money was paid.

The codebase is here: https://github.com/theDontKnowGuy/GreenPlanet

What am I missing ?

Thanks a bunch.

@chegewara
Copy link
Contributor

@stale
Copy link

stale bot commented Jul 30, 2020

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jul 30, 2020
@stale
Copy link

stale bot commented Aug 14, 2020

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Aug 14, 2020
@SuGlider SuGlider self-assigned this Jan 19, 2022
@SuGlider SuGlider reopened this Jan 19, 2022
@SuGlider SuGlider added Status: Solved and removed Status: Stale Issue is stale stage (outdated/stuck) labels Jan 30, 2022
me-no-dev pushed a commit that referenced this issue Feb 3, 2022
Summary

Touch Sensor refactoring to be based on IDF 4.4.
Adds support to ESP32S2 and future ESP32S3.

Adds some new APIs:

For all chips:

void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void*), void *arg, uint32_t threshold);
This function allows the user to add and pass a void* parameter to the ISR user callback.

void touchDetachInterrupt(uint8_t pin);
This function detaches ISR call back for the touch pad pin.

Only ESP32 chip

void touchInterruptSetThresholdDirection(bool mustbeLower);
This function allows the user to set if the ISR callback will be activated when the touch sensor readings are lower or higher than the threshold defined. See example TouchButton.ino.

Only ESP32-S2 and ESP32-S3 chips

bool touchInterruptGetLastStatus(uint8_t pin);
This function reports if the touch pad pin is touched or untouched. It can be used with ISR to identify when it is touched and untouched (released). See example TouchButtonV2.ino.

Impact

None. ll original APIs and examples now run on ESP32 and ESP32-S2.

Related links

Fix #6095
Fix #6034
Fix #5799
Fix #5745
Fix #5527
Fix #5493
Fix #4321
Fix #4044
Fix #2722
Fix #2625
Jason2866 added a commit to Jason2866/arduino-esp32 that referenced this issue Feb 4, 2022
* Fix wdt OTA update

* Fix ESP32-Solo WDT on HTTP OTA update

Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>

* Fix ESP32-Solo WDT on HTTP OTA update

* Fix ESP32-Solo WDT on HTTP OTA update

Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>

* IDF master c69f0ec32

* Fix WDT only for solo core

* IDF master 58022f859

* IDF master 606557b48

* IDF master 8131d6f46

* IDF master 59aa60d52

* IDF master 83956ebba

* IDF master 83956ebbae

* IDF master b1c3ee71c5

* IDF master 2c49af9e75

* IDF master eb1a66e7c9

* IDF master a20df743f1

* Fix build compilation due to changes in the HW_TIMER's structs

* Fix compilation warnings and errors with USB

* Update USBCDC.cpp

* Update CMakeLists.txt

* IDF master b63ec47238

* Update libarduino_tinyusb.a

* Update HWCDC.cpp

* IDF master 5f38b766a8

* IDF master b1f851b8f8

* IDF master 61299f879e

* Delete tools/sdk/esp32/include/coap directory

* Delete tools/sdk/esp32c3/include/coap directory

* Delete tools/sdk/esp32s2/include/coap directory

* solve conflicts

* force Dynamic Buffer instead of Static ones

* Remove debug if

* Resolve conflicts

* Revert espressif#5861

* add GPIO defines for C3

* Edit sd_diskio to check card status

* Update CMakeLists.txt

* Delete libraries/RainMaker directory

* Update README.md

* Update README.md

* Revert "RMT refactor"

* Fixes Lib Builder compiling errors

* Fixes Lib Builder compiling errors

* Revert "Revert "RMT refactor""

* Update esp32-hal-rmt.c

* Update esp32-hal-rmt.c

* Update esp32-hal-rmt.c

* Update esp32-hal-rmt.c

* Update esp32-hal-gpio.c

* Bugfix of ff_sd_status

* Fix I2C Slave Compile

I2C Slave currently doesn't compile for projects where Arduino is an IDF component.  This adds missing conditionals.

* add missing c3 define

when disable HAL lock is set

* add ESP32C3 `esp32_adc2gpio`

* Fixes UART MODBUS and Loopback issue

* Update esp32-hal-uart.c

* Revert "Fixing interrupts in LEDC (espressif#6160)"

This reverts commit a593206.

* Update esp32-hal.h

* use Tasmota github

* Use Tasmota platform for CI

* tasmota eaptool v3.2

* add missing c3 define

* enable SPI hal for S3

* revert enable spi for S3

* Update Esp.cpp

* Update Esp.cpp

* fix S3 uart gpios

* fix S3 flash image base (espressif#6208)

* Added my new Unexpected Maker ESP32-S3 boards (espressif#6211)

* Fixes UART1 and UART2 default pins for ESP32-S3 (espressif#6202)

Summary

This PR fixes an issue with UART1 default pins.
When using pins RX_1 = 18 and TX_1 = 17, UART1 will display a Break Error on those pins when they are floting (not connected).

It also defines RX_2 = 19 and TX_2 = 20 as default pins for UART2.

Impact

The deaulf pins may look different from the original pinout diagram.

* Fix - SD mount issue (espressif#6162)

* sdSelectCard longer timeout for sdWait

* GO_IDLE_STATE command ignores sdWait fail

* fix: restoring handshake timeout (espressif#6165) (espressif#6166)

* Use 8.4.0+2021r2-patch2 toolchains for CI (espressif#6184)

with platformio

* Fixes onReceive deadlock (espressif#6201)

* added explanatory comments to WebServer.h (espressif#6204)

* Add conditional include to WiFiProv.h (espressif#6192)

Resolves issue espressif#6171

* Resolve WString TODO (espressif#6190)

Resolve TODO (XXX) by logging warning message.

* Allow HTTPCLIENT_1_1_COMPATIBLE to be disabled (espressif#6200)

Allow a user to disable the HTTPCLIENT_1_1_COMPATIBLE flag from the command line, or whichever means available.

* Update RequestHandlersImpl.h (espressif#6179)

With LittleFS the `fs.exists(path)` returns true also on folders. A `isDirectory()` call is required to set _isFile to false on directories.
This enables serving all files from a folder like : `server->serveStatic("/", LittleFS, "/", cacheHeader.c_str());
        File f = fs.open(path);
        _isFile = (f && (! f.isDirectory()));

* Refactor the CI scripts (espressif#6191)

The reason behind this refactoring is that all of the sketch related functions can (and will) be used for other purposes.

Build in the sketch directory: This will make it easy to handle artifacts after the build.
Separate sketch related functions from IDE installation script. This is the main commit.
Create a separate job for the Cmake check. This check was part of one of the Linux build. I believe that it's not the best place for such a check.
Checking for the skip landmarks and validity of the the sketch directory were already done by count_sketches.

* Fixes UART_1 TX Pin setup

When passing the PR to this branch, it seems that the change to this line was forgotten.

* Fix random CaptivePortal.ino crashes (espressif#6206)

CaptivePortal.ino example did randomly crash for me ... so I start investigate ;-)

Decoding stack results
0x4016faea: WiFiUDP::write(unsigned char const*, unsigned int) at C:\Users\knoeb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\libraries\WiFi\src\WiFiUdp.cpp line 201
0x400d4a4a: DNSServer::replyWithIP() at C:\Users\knoeb\AppData\Local\Temp\arduino_build_486825\sketch\src\DNSServer\DNSServer.cpp line 187
0x400d4d01: DNSServer::processNextRequest() at C:\Users\knoeb\AppData\Local\Temp\arduino_build_486825\sketch\src\DNSServer\DNSServer.cpp line 117
0x400d3e81: loop() at D:\Drive\Dokumente\HTL_Lehrer\2021_22\Projekte\Stromzaehler_Patrick\arduino/arduino.ino line 1078
0x400dd545: loopTask(void*) at C:\Users\knoeb\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.5\cores\esp32\main.cpp line 37
0x4008a0de: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

I found with wireshark a possibility to trigger the crash on demand is:
nslookup 3.1o1osr0092ons87rp375p1pq8q066o8p56or1sqsps6rs17r4384q9748qr1r52.699p1r741q737393648s29917o45p16q50rn517rnsp73pp68p1q259s92693qp.s607408539s0p06p7559os0899866344r7qq7rpns960o9576q65.r5n94r5so9784pq1.i.03.s.sophosxl.net

The problem was that QNameLength is a signed byte and therefore its not possible to count up to 255. Additionally we need 256 bytes for the QName string to accommodate for the zero termination.

* Update HardwareSerial.cpp

* Update Esp.cpp

* Update Esp.cpp

* Bootloader is at 0x0000 for S3

* Initial SPI support and S3-Box variant

* Docs cleanup and version updated to 2.0.2 (espressif#6213)

* Docs cleanup and version updated to 2.0.2

* Removed issue template information

* Removed issue template file

* Added referecnces for the issue and feature request form

* Bootloader is at 0x0000 for S3 (espressif#6215)

* Update esp32-hal-cpu.c

* Update esp32-hal-spi.c

* Unnecessary operation removed from map() in WMath.cpp (espressif#6218)

* Unneccesary Operation Removed

(A) extra operation not needed and incorrect:
      wrong by 0.5 but happens to be thrown out

     ( delta * dividend + (divisor / 2) ) / divisor

        delta * dividend     divisor
    = ---------------- + -----------
        divisor                    2 * divisor

    = delta * dividend / divisor + 1/2

(B) check first before doing other computations

(C) changed to rise/run, easier for future maintainer
      since it's closer to equation of a line

(D) before: mult, shift, add, div, add
      now: mult, div, add

(E) error message easier to trace where thrown

* Update WMath.cpp

forgot to change variable name

* framebuffer location for no-psram boards (espressif#6219)

If board has no PSRAM, we need to set the framebuffer location to DRAM:
config.fb_location = CAMERA_FB_IN_DRAM;

* Update install-platformio-esp32.sh

* small adjustments for NVS and PSRAM init

* WIP: Initial support for PSRAM (QSPI and OPI)

* Fix replace() failing

* Touch Sensor IDF Refactoring (espressif#6194)

Summary

Touch Sensor refactoring to be based on IDF 4.4.
Adds support to ESP32S2 and future ESP32S3.

Adds some new APIs:

For all chips:

void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void*), void *arg, uint32_t threshold);
This function allows the user to add and pass a void* parameter to the ISR user callback.

void touchDetachInterrupt(uint8_t pin);
This function detaches ISR call back for the touch pad pin.

Only ESP32 chip

void touchInterruptSetThresholdDirection(bool mustbeLower);
This function allows the user to set if the ISR callback will be activated when the touch sensor readings are lower or higher than the threshold defined. See example TouchButton.ino.

Only ESP32-S2 and ESP32-S3 chips

bool touchInterruptGetLastStatus(uint8_t pin);
This function reports if the touch pad pin is touched or untouched. It can be used with ISR to identify when it is touched and untouched (released). See example TouchButtonV2.ino.

Impact

None. ll original APIs and examples now run on ESP32 and ESP32-S2.

Related links

Fix espressif#6095
Fix espressif#6034
Fix espressif#5799
Fix espressif#5745
Fix espressif#5527
Fix espressif#5493
Fix espressif#4321
Fix espressif#4044
Fix espressif#2722
Fix espressif#2625

* [FEATURE] Basic implementation of Arduino's I2S library (espressif#5304)

Basic version of Arduino's I2S library. We currently support only 16bps + 16000 Hz sampling frequency. Other bitrates and sample rates will print warning and continue to operate, however the resulting audio quality may be poor.
There will be further effort to fix these issues.

* Update CMakeLists.txt

* remove Rainmaker

* [I2S] Fix lib-builder error

* Update CMakeLists.txt

* try to find lib builder fail

* Update CMakeLists.txt

* Update idf_component.yml

Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
Co-authored-by: me-no-dev <me-no-dev@users.noreply.github.com>
Co-authored-by: me-no-dev <hristo@espressif.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
Co-authored-by: Jason2866 <jason2866@github.com>
Co-authored-by: Rodrigo Garcia <Rodrigo.Garcia@espressif.com>
Co-authored-by: mrengineer7777 <44048235+mrengineer7777@users.noreply.github.com>
Co-authored-by: Unexpected Maker <seon@unexpectedmaker.com>
Co-authored-by: Vlasta Hajek <vlastimil.hajek@bonitoo.io>
Co-authored-by: Enes Şimşek <62627966+h-enes-simsek@users.noreply.github.com>
Co-authored-by: Clemens Kirchgatterer <clemens@1541.org>
Co-authored-by: Matthias Hertel <mathertel@hotmail.com>
Co-authored-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
Co-authored-by: Patrick Behal <5472845+im-pro-at@users.noreply.github.com>
Co-authored-by: Pedro Minatel <pminatel@gmail.com>
Co-authored-by: IanSC <8453489+IanSC@users.noreply.github.com>
Co-authored-by: René Bohne <rene.bohne@gmail.com>
Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants