Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By papashino123
#58531 Hi,

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
Code: Select allavrdude -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
Code: Select all  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 :D

when i execute the avrdude i got some mixed data from the board, like

Code: Select allavrdude: 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
User avatar
By papashino123
#58551 i know that lib, but it's not actively maintained anymore from what i see.

elclient doesn't compile with new arduino ide, just to give you an idea.

also, i can't do proper offload form esp8266 (in my case i use the esp8266 to do some measure of salinity and stream the data to arduino)

it doesn't support async tcp

i can't write code on esp8266 in arduino style.... there are ticket opened for stk500v2 protocol (meaning that the transparent bridge of serial doesn't work really well i think)

anyway, it doesn't suit :) i am talking about esp8266 arduino base, and i would like to know if there is some solution starting from this point