Web-server on ESP-01 which can reprogram Arduino Nano

I have idea to deploy Web-server on ESP-01 which will send commands to Arduino via UART. Ex. user can configure software on Arduino using web-interface. This part seems easy.
I also have idea to enable that web-server to update firmware on Arduino via UART. I will use this adapter (1PCS ESP8266 ESP 01 Serial WiFi Wireless Adapter Module 3.3V 5V Esp01 Breakout PCB Adapters|Replacement Parts & Accessories| - AliExpress)
It has RX and TX lines. I plan to take GPIO0 line from it to use it for resetting Arduino.
From software point of view I plan to somehow upload biary file with Arduino firmware to ESP-01, ex. by running FTP-sever there or using GitHub - gmag11/FSBrowser: Full autocontained (on SPIFFS) web server on ESP8266. And later I need somehow to transfer received file to Arduino.
Question: which library to use to flash binary file from ESP-01 to Arduino Nano via UART? Any existing projects which do the same?
I found this thread https://forum.arduino.cc/index.php?topic=584793.0 looks quite complicated. Are there any other solutions? If not, can someone explain step by step how to do that flashing?
Note1. I would like avoid using wire from ESP-01 to reset line of Arduino. There will be PWM and mosfet keys which can cause interference on reset wire. I want to avoid random resets of Arduino. May be it is possible to connect GPIO0 from ESP-01 to any digital input pins of arduino and trigger reset using watchdog? It is just idea, I don’t know if it is possible.
Note2. Because I will have to use hardware UART on Arduino to communicate with ESP-01, I will not be able to use console via USB. So, I will need to know how to establish transparent UART communication through ESP-01. Any ideas how to make it?
Note3. Yes, I know that I could use existing ESP board and it would be much easier. But I’m using terminal adapeter board for Arduino like this Keywish Nano Terminal Expansion Adapter Board for Arduino Nano V3.0 AVR ATMEGA328P with NRF2401+ Expansion Interface DC Power|Integrated Circuits| - AliExpress I could not find board with this type of terminals for ESP32 or ESP8266. Moreover if this idea would be possible, many users could use simple ESP-01 to make their Arduinos possible to update over the air.
Note4. I’m aware of Esp-Link project, but it contains way more than I need. Extracting only necessary part from it doesn’t look that easy. If someone already did something similar, could you please provide any guidance?

If I’m telling something really weird, then I’m sorry, I’m quite new in Arduino and especially in ESP :slight_smile:

Found this library: https://github.com/rene-win/esp_avr_programmer
I will try to use it and write results here later.

That library let perform reprogramming of Arduino successfully after some fixes (ex. it doesn’t work well if HEX file contains not complete lines).
So, if someone is interested in this topic - you can use that library. Unfortunately, author deleted it from github, but there are some forks. If you are unable to find them, you can use it from my repo: GitHub - alambin/sad_lamp_esp (files src/IntelHexParser.* and src/Stk500Protocol.*). That files contain all required fixes.

The ESP-01 is a substantially more powerful processor than the Arduino.

If you have the ESP-01, why would you want to use an Arduino at all? :roll_eyes:

ESP-01 has only 2 io pins. It is deffinitely not enough.
Moreover there are quite many systems already based on Arduino and ability to add WebUI to them and implement OTA update using ESP would be useful.

Nonsense! :grin:

For a start, the ESP-01 actually has four I/O pins and using I2C expanders you can add 16 I/O at a time.

2 after you use serial connection. Is your statement that 4 pins is enough for any project and using Arduino doesn’t make sense? :slight_smile: This is nonsens. There are plenty of projects where amount of pins of ESP-01 is not enough. If you are not interested in this topic- no one forces you to participate. For sure there will be people, who will need it. So, my messages above are for them.

I agree with both sides.
An ESP8266-01 with port expanders is a neat thing. Cobbled together bits a bit of a pain though.

The UNO/NANO/MINI have limited memory and things like WiFi.

But in the hobby world we don’t Worry about spending $100 and 200 hours to make something that one can buy for $50

Well, in my case I have existing system on Arduino with very convenient terminal board. It is placed in tiny box mounted in area, which is difficult to access. It works totally fine but sometimes I have new ideas and I want to update firmware. And this is really pain every time to unmount device and flash Arduino. I could use ESP instead of Arduino, but right now there is no way to install ESP inside existing tiny box. There is also no board with good terminal connections for ESP (like on board for Arduino). Yes, I could find bigger box, somehow install it instead of existing one, do my own wiring instead of terminal board, etc. But why should I do that if I can simply install tiny adapter for ESP-01 inside existing box and get the same result?
I'm quite sure that there are another people who can meet similar situation. So, this solution is for them. Of course, if you develop system from scratch, better to choose ESP.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.