So I tried using PIO for the first time, tried uploading my first code to my NodeMCU 0.9 ESP8266, but it just won’t run it. Arduino IDE works fine.
But the thing is, the uploading went fine!
Once I see this, I knew the uploading is successful.
Writing at 0x0002c000... (100 %)
Wrote 264560 bytes (195063 compressed) at 0x00000000 in 17.1 seconds (effective 123.7 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Easy: LED_BUILTIN has the wrong value. I think the Arduino IDE / ESP8266 core even has a menu to select what pin is “LED_BUILTIN”. There is no universally agreed on “LED_BUILTIN” pin for all ESP8266 board. You should try uploading
It prints the number 2, so I used that, still won’t work.
Also, I unknowingly uploaded the code (you provided) earlier with the PIO, but I got no serial response. Could there be signs of problems with the IDE and not the board?
The serial monitor on PIO works fine when the code is uploaded using Arduino IDE.