PlatformIO Community

Platformio vs Arduino code compilation


#1

Hi,

Does anyone here have idea, why this code compiled on arduino works flawlessly,
and compiled in platformio fails misserably?

Its really annoying…


#2
git clone https://github.com/openenergymonitor/EmonESP
cd EmonESP
pio run
[...]
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [====      ]  43.9% (used 35976 bytes from 81920 bytes)
PROGRAM: [=====     ]  48.3% (used 504240 bytes from 1044464 bytes)
============================ [SUCCESS] Took 21.95 seconds ============================

Works for me on PIO 4.0.0a7, what’s your error?


#3

when spiffs is uploaded, NodeMcu gets unstable, shows itself up up on wifi list as access point, and then dissapers. Compilation works, but once the program is loaded in doesnt work. Once uploaded through arduino it works flawlessly


#4

So what ESP8266 version do you have installed in your Arduino IDE’s board manager?


#5

It’s the nodemcu v1.0


#6

No, the ESP8266 framework version in the board manager. See https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/


#7

it is the latest vresion


#8

Which version does it show?


#9

It should be the latest, how can i see it and where?


#10

Like in the link above, the board manager shows the version. Here e.g. 2.4.1:


#11

2.5.0. is installed!


#12

Hmm PlatformIO has Arduino-ESP8266 core since platform = espressif8266@2.0.0… Can you update your PIO platforms (via VSCode GUI or pio platforms update command) and clean and retry? Maybe try all some versions around in the platformio.ini with platform = espressif8266@2.0.0, 2.0.1, … 2.0.4. (Assuming the problem lies in using different cores)


#13

You meant "PlatformIO has Arduino-ESP8266 core 2.5.0 since platform = espressif8266@2.0.0" didn’t you? :laughing:

Hm… this is interesting… it is shipped as using Arduino-ESP8266 core 2.4.0-rc2!! If 2.5.0 works with Arduino, maybe it can be updated? This sounds a bit like some of the WiFi sleep that where plaguing 2.4.0 and 2.4.1…