Now, I would like to detect this in software and issue a restart from the code. This is what I'm using now to restart:
void soft_reset() {
pinMode(0,OUTPUT);
digitalWrite(0,1);
pinMode(2,OUTPUT);
digitalWrite(2,1);
ESP.restart();
}
But it doesn't work, at least not completely. The ESP8266 stops, sends some weird characters to the serial monitor but that's it: no restart.
Setting GPIO0 and 2 high, read that at https://github.com/esp8266/Arduino/issues/793, not sure if it's correct.
Anyway, does anyone know a way to restart the ESP8266 from code that actually works? Or am I just missing something?