i would like to upload a prog to arduino (connected via serial to esp01 running arduino core).
my idea is to do something like that
avrdude -v -p atmega2560 -C avrdude.conf -c stk500v2 -P net:192.168.1.128:23 -D -U flash:w:firmware.hex:i
i have modified avrdude.conf to have a big timeout (30sec)
on esp i upload something like that
if (telnetServer.hasClient()) {
emptySerial();
WiFiClient cli = telnetServer.available();
emptySerial();
unsigned long to = millis();
while (millis() - to < 1000 * 60) {
while (Serial.available())
cli.write(Serial.read());
while (cli.available()) {
Serial.write(cli.read());
to = millis();
}
cli.flush();
Serial.flush();
}
cli.stop();
}
that's just a proof to try to make it work

when i execute the avrdude i got some mixed data from the board, like
avrdude: stk500v2_getsync(): got response from unknown programmer , assuming STK500
SCK period : 565.9 us
Varef : 0.0 V
Oscillator : 21.186 kHz
that means that some data pass, other not, making comunication unstable and of course impossible to upload anything on the arduino (but, that's show that pins are well connected, session on port 23 it's opened, client accepted, and so on)
someone can point me into the right direction?
my code is based on wifitelnettoserial example on esp8266 arduino page here
https://github.com/esp8266/Arduino/blob ... Serial.ino
i just remove the delay, removed the buffer and try to send 1 char per time, do some tests that doesn't give any good results

tnx