AutoConnect icon indicating copy to clipboard operation
AutoConnect copied to clipboard

Add support for ESP32 Core v3.x and ArduinoJson 7 compilation fix

Open Cri4Key opened this issue 10 months ago • 1 comments

The ESP32 Arduino Core 3.x based on ESP-IDF 5.x breaks compatibility with the AutoConnect library. These fixes make it possible for the library to compile with Core 3.x versions and it seems to be working properly (tested on ESP32-S3).

  • WiFi.getAutoConnect() and WiFi.setAutoConnect() have been deprecated by long time in ESP32 Core 2.x (ever since ESP-IDF 3.1 these functions do nothing, they just return false) and removed completely in Core 3.x. Use WiFi.getAutoReconnect() and WiFi.setAutoReconnect() if on ESP-IDF 3.1 or later on ESP32 platform.
  • spi_flash_get_chip_size() has been deprecated and removed from ESP-IDF 5.x and later, which ESP32 Core 3.x is based on. Use esp_flash_get_size() instead if on ESP-IDF 5.x or later.

Moreover, following change to fix compilation error when using ArduinoJson 7 on ESP32. This makes compilation possible and adds initial support but, ideally, it still needs refactoring to fix various warnings due to the use of deprecated functions:

  • Add function *reallocate() in SpiRamAllocatorST

Last change is just on a definition used only in AutoConnectCoreImpl.hpp. It doesn't do anything, but I changed it because it used to conflict with another library I used with AutoConnect:

  • Renamed SOFT_RESET() to SOFT_RESET_ESP()

Cri4Key avatar Apr 10 '25 08:04 Cri4Key

I patched both AutoConnect and Pagebuilder using the merge above and fix all the errors with ESP32 Core v3.x

Andrewiski avatar Apr 15 '25 17:04 Andrewiski