Platformio vs Arduino code compilation


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

Its really annoying…

git clone
cd EmonESP
pio run
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?

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

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

It’s the nodemcu v1.0

No, the ESP8266 framework version in the board manager. See Installing ESP8266 in Arduino IDE (Windows, Mac OS X, Linux) | Random Nerd Tutorials

it is the latest vresion

Which version does it show?

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

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


2.5.0. is installed!

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)

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…