Code works on arduino ide but not on Platformio

Hi guys,

Im working with ESP8266 and SIM800c modules. I have a simple code as I mentioned below. The ESP8266 communicates with the SIM800c with “SoftwareSerial” which i used pins 10 and 12 of ESP8266 to do that.

The code get the “Modem Info:” when i upload it with Arduino IDE but when i switch to Platformio (on vscode) it doesn’t work.

Here is the code:
main.cpp

#define TINY_GSM_MODEM_SIM800
#define SerialMon Serial

#include <SoftwareSerial.h>

SoftwareSerial SerialAT(10, 12); // RX, TX

#include <TinyGsmClient.h>

TinyGsm modem(SerialAT);

void setup() {
   SerialMon.begin(19200);
  delay(10);
   SerialMon.println("Wait...");
   SerialAT.begin(19200);
  delay(6000);
   SerialMon.println("Initializing modem...");
   modem.init();

  String modemInfo = modem.getModemInfo();
   SerialMon.print("Modem Info: ");
   SerialMon.println(modemInfo);
}

void loop() {
}

And this is my paltformio configurations:
platformio.ini

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino
upload_protocol = esptool
upload_speed = 921600
monitor_speed = 19200

The output on Arduino IDE is:

Wait...
Initializing modem...
Modem Info: SIM800 R14.18

While on Platformio I got this:

Wait...
Initializing modem...
Modem Info:

Can you better describe it? Does it fail to compile? Does it fail to upload? Does it…?

1 Like

Sorry, I edited the question.

The output on Arduino IDE is:

Wait...
Initializing modem...
Modem Info: SIM800 R14.18

While on Platformio I got this:

Wait...
Initializing modem...
Modem Info:

The reason was the GPIO10 which is a tricky one. I change it and it worked.

1 Like