Hello @Adrian_Rockall,
Thank you very much for helping out and updating the source code!
EDIT - I managed to solve the issue after my post; see below. But for context/knowledge sharing I kept the prior information. I do have some remaining question, added below, after the EDIT tag.
I managed to get a little bit further, but don’t have it fully working yet. My apologies in advance for the longer post, but I wanted to provide you the necessary details for context.
I first tried Method 2 again, flashing my ESP32 board with the flash tool and your (updated) binary file. That still didn’t work. I got the same behavior as before: power led on and the TX led rapidly flashing. I also checked the output of the Serial Monitor in the Arduino IDE. Apparently my board keeps resetting itself with the following repeating output:
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x61223d65
Note that I flash the board with the following settings in the start-up screen of the flash tool:
- ChipType: ESP32 (as a have an ESP32 board)
- WorkMode: Develop
- LoadMode: UART (cannot change that)
So I tried building/compiling the Sketch in the Arduino IDE (Method 1). Initially that did also not work. Though the verification resulted in no errors, after uploading to the board and rebooting the board I got the following error:
Core dump data check failed:
Calculated checksum='9f943a62'
Image checksum='ffffffff'
After that I removed all downloaded libraries and board references. And started added those back again. Now I seemed to get a step further: the board seemed to do something and tried to set up the access point:
*WM: Configuring access point...
*WM: SwitchBot_ESP32
*WM: AP IP address:
*WM: 192.168.4.1
After which it crashed with the following error
assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)
I found this issue description (Crash with error message: “Required to lock TCPIP core functionality” · Issue #10526 · espressif/arduino-esp32 · GitHub) and related discussion on GitHub. This affects the AsyncTCP and ESPAsyncWebServer libraries your program uses.
As per your instructions I initially installed those libraries via the GitHub links (to the repo from me-no-dev) you provided. There are however newer versions in the GitHub repo from mathieucarbou, which are also available in the Arduino IDE. I removed the older versions from the me-no-dev repo and installed the latest versions directly from the Arduino IDE Libary Manager - which are the same versions as from mathieucarbou - that included a fix for the above issue.
This helped: after rebooting the board the SwitchBot_ESP32 Access Point was available. I was able to connect to the access point and connect the board to my WiFi. The output on the serial monitor was promising:
Connected to IP address: 10.0.0.17
HTTP server started
Application started
Then the board crashed again with the following error:
assert failed: igmp_joingroup /IDF/components/lwip/lwip/src/core/ipv4/igmp.c:460 (Required to lock TCPIP core functionality!)
It looks similar as the previous error (also related to ‘locking of TCPIP core functionality’), however triggerd by a different item: igmp_joingroup. I tried to find a reference to this ‘igmp_joingroup’ item in your source code or in the libraries used, but could not find it.
I don’t know how to proceed.
Note that I using the following versions of the IDE/libraries:
- IDE: Arduino IDE v2.3.3
- ArduinoJson (by Benoit) v7.2.1
- Async TCP (by Me-No-Dev) v3.2.14
- ESP Async WebServer (by Me-No-Dev) v3.3.23
- ESPAsyncHTTPUpdateServer (by Mohammad Mahdi Nazari…) v2.0.0
- NimNLE-Arduino (by h2zero) v2.0.0
- ESP Async WiFi Manager (by alanswx) version unknown/downloaded via your indicated link
What I don’t understand is that you are able to compile and use the program without any problems, while I am running into these issues.
I hope you can help me again.
*** EDIT ***
I managed to solve the issue by downgrading the ‘esp32’ boards set in Boards Manager from v3.1.0-RC3 (which was installed when I installed Arduino IDE) to the last pe-RC version: v3.07. No sure why the older version works, but the newer does not.
Controlling the SwitchBot Curtains 3 now goes much quicker now. The only think I noted is that:
- The position information (both capabilities ‘position’ and ‘position reading’) is updated very slowly. E.g. when I close the curtains (set position to 0%) only after approx 10 sec. after the curtain is closed, the position information in Homey is updated.
- Also Homey sometimes gives time-out errors. That used to be the cases constantly before I installed the ESP32 hub; now they occasionally pop up when controlling the curtains.
I there something I can do to resolve those issues?