I'm attempting to upload sketches onto my Uno with an ESP8266 shield wirelessly. Currently, I'm able to flash sketches on the ESP8266 shield OTA (using ArduinoOTA.h) and have it communicate with the Arduino Uno through serial (SoftwareSerial). This way, I could maximise the use of both MCUs as there are many features I would like them to have (at once, such as LCD, buttons, sensory algorithms).
However, I could not find a way to upload sketches onto my Uno through the ESP8266 shield. If possible, I'm looking into protocols like SPI or even serial (SoftwareSerial) for this purpose. May I know if there's a way to do so?
Recap: PC ->(WiFi OTA programming) ESP8266 shield ->(SPI/Serial programming??) Uno
PS: I could just use an ESP32, but due to various constraints, I wish to achieve the task with just an Uno and ESP8266 shield.
Thanks for your reply. I have tried the example .ino given in the ESP8266AVRISP library.
Porting the code over to platformio, I then added a few lines of codes to enable ArduinoOTA. However, when I attempted to do "Upload using Programmer", it gave me this error:
[env:uno]
platform = atmelavr
framework = arduino
board = uno
upload_protocol = arduinoisp
; each flag in a new line
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED
; edit these lines
upload_port = 192.168.1.32
upload_speed = 19200
Sorry if it may seem a bit confusing, pardon my inexperience in dealing with ISP programming. But I could really use some help on this...
Thanks, I have found the solution to the issue. The correction I made in platformio.ini file goes like this:
[env:uno]
platform = atmelavr
framework = arduino
board = uno
upload_protocol = stk500v1
; upload_protocol = arduinoisp
; each flag in a new line
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED
; edit these lines
upload_port = net:192.168.1.32:328
upload_speed = 19200
Notice the port I used is in the format of "net:IP_ADDR:PORT_NUM", with the protocol as "stk500v1".