New ESP8266/Arduino framework, to update or not to update?

The recently released ESP8266 framework has caused some issues. The first issue is compile errors of ESPAsyncTCP. To solve this error, you can simply force to use old version of the framework, by editing platformio.ini

platform = espressif8266@~1.5

I do migrate to latest ESPAsyncTCP/ESPAsyncWebServer with latest framework(1.6), but that is the real issue. The new framework is about 26.5k bigger than previous release 1.5, and the image built with 1.6 framework will make OTA impossible.

The current flash layout of ESP8266 use 1M for program, or sketch. To support OTA, the sketch size must be smaller than half of the total program space. The image of default BPL is about 500k, so using latest 1.6 framework breaks the limit.

The latest ESPAsyncTCP/ESPAsyncWebServer libraries work pretty with latest 1.6 framework but seem to have some issues with 1.5 framework. The README.MD of ESPAsyncWebServer states that latest framework might be necessary, and I encountered some no-response issue when using latest libraries with old 1.5 framework.

(BTW, one extra advantage of latest libraries with latest framework is that WebSocket is pretty solid, compared to the result I had a few months ago. My other Project, BrewManiacEx does benefit from WebSocket because of the short latency of uplink data transmission. BrewPiLess, on the other hand, does not gain much from that.)

Staying with old 1.5 framework is a simple solution but I am not sure if it is a good idea.

To upgrade to latest 1.6 framework, something will have to be removed. It’s unlikely that I can squeeze 25k or even 10k program space for it. A few solutions I come up:

  • Remove OTA update support
    It’s unlikely that I would do this. Opening project boxes to flash it is PITA.
  • Remove embedded files.
    Manually uploading the HTML file will be necessary.
  • Expanding the sketch space to 1.5M or 2M.
    IMO, this might be the best solution. 2M file space is good for 5~6 months. The drawbacks will be

    • Editing of flash configuration file needed. 2M file system is not built-in standard configuration while 1M file system is. However, 3M for sketch is a waste.
    • Upgrading to latest version might require formatting of SPIFFS.


Comments (3)

  1. Hello. I have a new model of wemos d1 mini pro 16MB.

    The problem is that with espressif8266@~1.5.0 does not work (I need put 1.5.0 or not run), I have compiled it as “d1_mini” (can’t compile as “d1_mini_pro”), but the wifi is heated after configuring it, and the card is constantly restarted.

    I have tried with espressif8266@~1.6.0 and changing the libraries espasynctcp and espasyncwebserver.
    I manage to compile as “d1_mini_pro”, and I can configure the wifi well, which manages to connect to the router, since it appears as connected. But does not respond to ping nor does the web page open.

    I have done many tests, but I am blocked.
    Please, see if you can think of something or you can solve it.

    Regarding your query, I think the best solution is to expand the sketch space just enough.
    As a second solution, temporarily renounce OTA.

  2. Platformio.ini config:

    platform = espressif8266@~1.6.0
    board = d1_mini_pro
    framework = arduino
    lib_extra_dirs = ./lib_async

    build_flags = -Wl,-Tesp8266.flash.16m.ld
    ; -DLegacyEspAsyncLibraries=true

  3. Buy another d1 mini pro.

    I have a d1 mini pro. It works fine under default settings, although only 4MB is used.

Leave a Reply

Your email address will not be published. Required fields are marked *