PlatformIO Community

Sonoff Basic Upload problem Hard Resetting via RTS pin

Hello,

I’ve a simple sketch for the ITEAD Sonoff basic. When I upload with arduino IDE the sketch works ok.

int gpio13Led = 13;

void setup(void)
{
  pinMode(gpio13Led, OUTPUT);
  digitalWrite(gpio13Led, HIGH);
 
  Serial.begin(115200); 
  delay(5000);
}
 
void loop(void){
  digitalWrite(gpio13Led,HIGH);
  delay(1000);
  digitalWrite(gpio13Led,LOW);
  delay(1000);
} 

I notice that the Arduino IDE upload process ends with soft resetting.
When I however try to upload this sketch with Platform IDE (VSCode 1.14.1 / Platform IO Home 3.0.1 Core 4.1.0) the upload process is exited with Hard Resetting via RTS pin and the sketch does not work.
Selection_217

How can I make the sketch to work. Probably how can I exit the upload with a soft reset ?

Any help appreciated.
Tkx !
Leo

Could you go to your home folder (C:\Users\<user> or /home/<user>), and therenon to .platformio/platforms/espressif8266/builder/main.py

locate the code

Then add modify the UPLOADFLAGS so that it reads

        UPLOADERFLAGS=[
            "--chip", "esp8266",
            "--port", '"$UPLOAD_PORT"',
            "--baud", "$UPLOAD_SPEED",
            "--after", "soft_reset",
            "write_flash"
        ],

Then a verbose upload log please (pio run -t upload -v) or Verbose Upload), starting at the invocation of esptooly.py.

Hi Max,

It works !

Here is the output, indeed soft resetting.Selection_220

Many tkx for the professional help !!
Best wishes
Leo

1 Like

You can find the answer here.