PlatformIO 3.0 Broke All My ESP8266 Projects

Hi,

I have a number of ESP8266 projects. These have all been building and deploying wonderfully under the previous version of PIO.

Got prompted to update on Friday. The moment the update completed the agony began - none of my projects would compile anymore. Have been tearing out my hair all weekend :frowning:

Specifics - using ESPAsyncUDP, ESPAsyncTCP, ESPAsync web server etc on a Windows 10 PIO environment, customised to use github arduino/ESP8266 core. NOTE: it took some time to set up the environment, but all projects were building perfectly.

Tried complete removal of PIO and Atom and fresh install, re-did all my steps to download latest version of libraries, github version of ESP8266 Arduino core, tried all the platformio.ini tweaks. Nothing.

So, tried the most basic test:

  • Install from fresh (full delete and clean of all Atom/PIO data and directories, set up new project in fresh directory etc
  • Install github version of the ESP8266 core (master branch)
  • Install latest version of the ESPAsyncUDP library
  • Create platform.ini file with:

[env:d1_mini]
platform = espressif8266
framework = arduino
board = d1_mini
build_flags = -ULWIP_OPEN_SRC -I$PLATFORMFW_DIR/tools/sdk/libc/xtensa-lx106-elf/include -IL$PLATFORMFW_DIR/tools/sdk/libc/xtensa-lx106-elf/lib -lc

  • Try to build the example asyncudpclient

If I use the -ULWIP_OPEN_SRC flag, I get lots of errors like:

In file included from C:\users\MrFusion.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include/lwip/inet.h:37:0,
from .piolibdeps\ESPAsyncUDP_ID359\src\AsyncUDP.cpp:7:
C:\users\MrFusion.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include/lwip/ip_addr.h:96:0: warning: “IPADDR_NONE” redefined [enabled by default]
#define IPADDR_NONE ((u32_t)0xffffffffUL)

and

In file included from C:\users\MrFusion.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include/lwip/inet.h:37:0,
from .piolibdeps\ESPAsyncUDP_ID359\src\AsyncUDP.cpp:7:
C:\users\MrFusion.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include/lwip/ip_addr.h:44:8: error: redefinition of 'struct ip_addr’
struct ip_addr {
^

If I use the -DLWIP_OPEN_SRC option I get lots of these sorts of errors:

pioenvs\d1_mini\libFrameworkArduino.a(heap.o): In function _malloc_r': heap.c:(.text._malloc_r+0x4): multiple definition of_malloc_r’
mallocr.c:(.text+0x44): undefined reference to _sbrk_r' mallocr.c:(.text+0x56): undefined reference to_sbrk_r’

Sadly, if I follow the instructions to use the Arduino IDE with github core it all works perfectly!! And note (I might have mentioned this before :slight_smile:) - it all worked perfectly in PIO before the upgrade…

Can anyone please please please shed some light on this - it’s driving me mad!!

Any hints on how to get this working would be marvellous.

Ideally, you could show me how you got ESPAsyncUDP example built! :smile:

This variable has been removed. You can define it using extra scripting or replace with $PIOHOME_DIR/packages/framework-arduinoespressif8266.

Now, PlatformIO 3.0 can build multiple frameworks per one build environment.

Thanks for the quick reply! Unfortunately your suggestion made zero difference.

Are you able to build the ESPAsyncUDP example?

This is no a problem of PlatformIO 2 or 3. ESPAsyncUDP requires development version of Arduino Framework. PlatformIO supports only stable software. See solution Conflicts in includes · Issue #5 · me-no-dev/ESPAsyncUDP · GitHub

We don’t support alpha/beta software. If you need support for it, please contact with https://pioplus.com

I’m confused. Maybe I didn’t explain correctly?

  • PlatformIO 2 – worked great
  • Upgraded to PlatformIO 3 – made no changes - just tried to compile, no longer compiles, can’t fix following instruction you refer to
  • Removed PIO 3 fully and reinstalled & re-setup PIO 2 – works great again

Could share here your platformio.ini which you use to build ESPAsyncUDP?

I’ve just created new stage branch of Espressif 8266 development version. It uses the latest Arduino Framework. See updated docs:
http://docs.platformio.org/en/latest/platforms/espressif8266.html#using-arduino-framework-with-staging-version

P.S: Please remove all “extra flags”, scripts and hooks. It should work with clean platformio.ini.

this is great. thanks

How hard would it be to have it as a kind of separate thing / env…

so that you can switch between stable and stage very easily…

with

platform = espressif8266-stage

Thanks a lot for the idea! Could you test it? See updated docs
http://docs.platformio.org/en/latest/platforms/espressif8266.html#using-arduino-framework-with-staging-version

P.S: The name of platform is espressif8266_stage.

hi,

OK so got it to work.

my only thing is that it seems to overwrite the package folder, with the latest git one.

would be good if that was separate as well, as then running platform = espressif8266_stage does not re-download the stable version. if that makes sense…

the staging framework should use a staging package, whereas the stable platform should use a stable espressif8266 package.

correct me if i’ve got it wrong

Thanks for the great response!

Just writing to let you know, under water at work with my ESP project, so too scared to touch environment for the next few days :cold_sweat:. Will upgrade and report back next week!

OK, I can confirm that there are two package folders. so this is working great. and it is awesome! one flag for latest and for stable…

many thanks :slight_smile:

i have just installed the latest platformIO, and i think both espressiv8266_stage and espressiv8266… somehow when i try building with esspresiv8266 it works, and with esspresiv8266_stage i face this problem… is there something else that needs to be done?
i just followed the description on the doc page you posted

Thanks in advance, Vladimir

@vlast3k do you still have problem?

Aahhh sorry, i had to post back the details here, but was running behind schedule and missed it :frowning:
It is all working fine now :slight_smile: Somehow, with the 2.x version it was successfully finding and using my libraries from the Arduino Folder using the lib_dirs var in the .ini file. With the new version this somehow didn’t work.
So eventually i ended up copying all necessary libraries to the /lib folder of the project.
Also before this my project was Arduino-style (with the sketch named XXX, staying in a folder XXX), this i also changed and now my sketch is in /src folder but renamed it to .ino.

Somehow i couldn\t find a combination of the library dependency filter that works for the project in it’s old style.

Anyway i had planned this refactoring quite some time ago as there were too many dependecies, and now everything is fine and i am happy with it. The build output of the PIO 3 is much cleaner and apparently also faster :slight_smile:

Please use lib_extra_dir in PlatformIO 3.

Hi again,

Just to close this off. I ran with v2 for a few months so that I could complete my project within deadline. I then did a full uninstall of the old version (deleting old platformio directories etc), installed V3, and followed the instructions at: Espressif 8266 — PlatformIO latest documentation (basically, ran: platformio platform install GitHub - platformio/platform-espressif8266: Espressif 8266: development platform for PlatformIO).

This worked perfectly and I am now a happy camper on the new baseline.

Thanks!

1 Like