I don't have an FTDI card adapter to program an esp8266 (sonoff device) BUT I have an ESP32 dev board ....
I would like to know if it's possible to use tihis ESP32 dev board (wemos lolin32 lite which include a uart adapter CH340 uart) like an FTDI card, So, I would like to:
- create a sketch for my ESP32 (see below) to :
- remap serial 1 to gpio 16/17=rx1/tx1
- pass all the serial information from serial 0 (from the uart), to serial 1
- connect my device to program (a sonoff card esp8266 or alike) to serial 1
- and use esptool as usual to program my sonoff ? esptool.py .... write_flash ...
Any link/ressources will be appreciate.
FYI I plan to use a sketch to my ESP32 inspired by
https://github.com/espressif/arduino-esp32/issues/1314
Code: Select all
void setup() {
Serial.begin(115200); //From USB
Serial1.begin(115200, SERIAL_8N1, 16, 17); //To Port 1
}
void loop() {
if (Serial.available()) // If user typed something through the USB...
{
Serial1.write(Serial.read()); // Push it through Port 1
}
if (Serial1.available()) // If data is received through Port 1
{
Serial.write(Serial1.read()); // Push it through USB
}
}
Nico