Code working when compiled with Arduino IDE doesn't when compiled with Platformio

I’m using a Grove Air530 GPS module. When I upload this code using the Arduino IDE it works correctly.

#include <SoftwareSerial.h>

SoftwareSerial ss;

void setup()


  ss.begin(9600, SWSERIAL_8N1, 23, 22, false, 256);



void loop()


if (ss.available()) {

while (ss.available()) {





And I get the correct output:

$GPTXT,01,01,01,ANTENNA OK*35

If I upload the same code using Platformio (Adding the Arduino.h library) the serial output becomes like this:

$GP⸮⸮⸮⸮b⸮⸮b⸮⸮bANTENNA O{35

I’ve tried everything I could think and google gave me nothing so now I’m here.

  1. What’s the Arduino-ESP32 version shown in the Arduino IDE → Boards → Board manager → esp32?
  2. Screenshot of the Arduino IDE → Tools menu for configuration?
  3. Your platformio.ini?
  1. Arduino-ESP32 version = 1.0.6
  2. (I’m sorry the language is set to Italian but I think all the important stuff is still in English)
  3. (It won’t let me put two images so I’ll paste it here)

platform = espressif32
board = featheresp32
framework = arduino
lib_deps =

Then you must use

platform = espressif32@3.5.0

per releases if you want PlatformIO to also use 1.0.6 instead of

otherwise it will use the the latest 2.0.4 core.

You can also double check that your sketch breaks as soon as you update the ESP32 core in the Arduino IDE to 2.0.4 through the board manager.

1 Like

brilliant, thank you! It works flawlessly now

A broken software serial when using the latest Arduino core is not good regardless. If you can reproduce the fault in the Arduino-IDE on the latest 2.0.4 core, please open an issue at Issues · espressif/arduino-esp32 · GitHub. Only if the developers know about this, this can be fixed for the future, instead of downgrading.

ok I will as soon as possible