[resolved] Platformio breaks Arduino IDE build?

After adding platformio to an existing project, the Arduino IDE fails to build it:

Arduino: 1.6.9 (Mac OS X), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 230400, 4M (1M SPIFFS), ck, Serial, All"

libraries/ESP8266WiFi/ESP8266WiFi.cpp.o: In function `ESP8266WiFiClass::printDiag(Print&)':
/Users/andig/Documents/Arduino/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp:51: multiple definition of `ESP8266WiFiClass::printDiag(Print&)'
sketch/.pioenvs/base/ESP8266WiFi/ESP8266WiFi.cpp.o:sketch/.pioenvs/base/ESP8266WiFi/ESP8266WiFi.cpp:51: first defined here
libraries/ESP8266WiFi/ESP8266WiFi.cpp.o:(.bss.WiFi+0x0): multiple definition of `WiFi'
sketch/.pioenvs/base/ESP8266WiFi/ESP8266WiFi.cpp.o:(.bss.WiFi+0x0): first defined here
libraries/ESP8266WiFi/ESP8266WiFiAP.cpp.o: In function `ESP8266WiFiAPClass::softAPConfig(IPAddress, IPAddress, IPAddress)':
/Users/andig/Documents/Arduino/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp:179: multiple definition of `ESP8266WiFiAPClass::softAPConfig(IPAddress, IPAddress, IPAddress)'
sketch/.pioenvs/base/ESP8266WiFi/ESP8266WiFiAP.cpp.o:sketch/.pioenvs/base/ESP8266WiFi/ESP8266WiFiAP.cpp:179: first defined here

…and so on and so forth. I’ve manually deleted the .pioenv folder to no avail. Unfortunately I don’t have all files under git control so I’m struggling a little where to start with diagnosis.

Any ideas?

Thanks,
Andreas

  1. We don’t use or depend on Arduino IDE
  2. We don’t touch Arduino IDE
  3. We don’t modify Arduino IDE

:smile:

P.S: It seems, that you have overridden lib_dir in platformio.ini to Arduino IDE Libraries path and installed duplicated libraries. Please check /Users/andig/Documents/Arduino/libraries.

Thanks Ivan,

I never claimed you were intentionally doing anything “bad” to or with Arduino. It’s just that I’m stuck and don’t know why. For time being I like Arduino being around since I have setup my build environment with git versions of everything interesting- domething I can’t do with platformio straight away yet.

All help is greatly appreaciated, I relalize how much effort you’re putting into platformio!

These are the things I’ve tested:

git reset to before adding platformio.ini
rm .pioenvs

start Arduino and compile: ok
compile again: ok
restart Arduino and compile: ok

start platformio and just look at the files

compile again in Arduino: ok

git pull next commit adding platformio.ini

compile again in Arduino: ok
restart Arduino and compile: ok

go back to platformio and compile: BROKE (“build package not installed” - wtf?)
restart platformio and compile: ok (after getting past the Hash.h error)

compile again in Arduino: BROKE (messages posted above)
restart Arduino and compile: BROKE (messages posted above)

rm .pioenvs
restart Arduino and compile: ok again

go back to platformio and compile: ok
compile again in Arduino: BROKE

So- after compiling with platformio once something has changed that breaks the Arduino build. To fix that removing .pioenvs doesn’t seem to be enough, it also requires an Arduino restart.

No idea why but thats sufficient as workaround :slight_smile:

This is my ini file- lib_dir is not part of it:

#
# platformio Configuration File
#

[env:base]
platform=espressif
framework=arduino
board=esp12e
lib_install = 1,19,31,54,64,306,346
build_flags = -Tesp8266.flash.4m1m.ld
upload_port = vzero-edd834.local
#targets = upload

[platformio]
src_dir=.

See example:

Place your sketch to own folder (Arduino IDE requires it) and keep PlatformIO things outside this folder.

This is really a bug with our “Import Arduino Project” in PlatformIO IDE. We will fix it as soon as possible.