I’ve been using PlatformIO for quite a while and everything worked fine. Yesterday, I tried some dummy code and uploaded it using ArduinoIDE, opened the serial monitor and it showed the output as expected. When I tried converting the project to PlatformIO instead, the serial monitor showed gibberish letters, also, when tried viewing the serial monitor again in Arduino IDE, it again, showed gibberish letters.
Tried uploading the same code again from ArduinoIDE and the issue was resolved, but when uploaded again using PlatformIO, again, the same issue remained.
#include <Arduino.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
while(true) {
Serial.println("...");
delay(1000);
}
}
Tried looking at other answers on this forum and tried also the clean command.
Seeing gibberish on boot is perfectly normal since the ESP8266’s bootloader outputs stuff at a fixed 74880 baud. After that, it executes your firmware and prints out stuff at 9600 baud. So, initial output will be garbage.
You can see that yourself when you adjust your firmware’s baud and platformio.ini to 74880.
The Arduino IDE hides this initial bootloader output from you. PlatformIO does not.
One thing that still remains a big question mark for me is that these exact settings that I’ve used are being used in another project I have, and they work fine with the same ESP.