Hello Everyone who gets this message,
This topic is regarding firmware types and OTA possibilites of a composite board based on ATmega328p and ESP8266 (it seems to be a clone of Robotdyn UNO+WiFi R3 ATmega328P+ESP8266, 32Mb flash, USB-TTL CH340G, Micro-USB)
After reading Initial set up for UNO with Wi-FI (XC4411) and Robotdyn atmega328 uno r3 + Wifi I still have some unclear points.
The current situation:
ESP8266 firmware is updated according to the description of Espressif (Flashtool v3.8.5) with AT.bin v 1.7.4.
SoftwareSerial is applied to pin 6, 7 as RX, TX. Wiring works, DIP switch is set as 3, 4 is ON, other OFF.
External Antenna is used.
I tried lib WiFiEspAT.h from GitHub created by jandrassy.
I applied ChangeATBaudRate sketch and Serial Monitor (at baudrate: 115200) replied: "Sending baud rate change... Baud rate 9600 baud is working. Firmware version is 1.7.4.0"
I also tried SerialPassThrough sketch but it is not clear what would be the right result. When I typed into Serial Monitor "AT", I received "OK". But when I typed in "AT+GMR", reponses "ERROR" (baud rate: 115200, no response at 9600) How shall I pass through AT commands to ESP correct way?
After many searches I am not sure that this config (UNO+Wifi 32Mbit) is OTA capable?
If yes, how? What libs have to be used?
Another dilemma is arosen: Why do we use AT commands' firmware to control ESPs? I mean what is the advantage of it compared to other firmwares? (To tell the truth: what other firmwares are existing?) When I started to explore work with ESP modules I imagined that communication between Uno and ESP is through UART (print) and a receiving sketch is uploaded to ESP. But it seems that a common way is to use AT commands. Why?
Thanks!
you can split your projects into two sketches, one for the esp8266 and one for Uno, but that can be inconvenient. I found it much simpler to use the esp8266 as network adapter with a firmware if it can't be used standalone.
one big advantage of using the esp8266 as network adapter with standard Arduino networking API is that you can switch to other network adapter like some with Ethernet library, other WiFi library or native library of ESP32 or esp8266 if you decide that you want to use it standalone.
the esp8266 AT 1.7.4 is a very good and stable firmware. it is the best esp8266 AT firmware version. the most limiting thing is that it can run only one TCP server. the next shortcomming is that it can't do SSL in passive receive mode used by my WiFiEspAT library.
there are two other well known esp8266 firmwares:
ESP-Link - is very old and the main purpose is OTA upload to ATmega. There is no standard Arduino networking API library for this firmware. basically it doesn't support the use of esp8266 as network adapter
WiFiLink firmware - this was created by arduino.org to support standard Arduino networking API with the WiFiLink library and OTA upload support to ATmega328 was added. I maintain WiFiLink in my fork but I couldn't fix all the problems made by original developer.
Thanks Juraj,
the reason of using this composite UNO+ESP8266 board is that my original project is on UNO and I want to make it network capable without unnecessary troubles... only replace the board in the box.
In my plan there is adding some new features to the project: reports about the operation (emails by IFTTT or web server or Blynk) over internet.
Now it is clear that usage of AT commands makes our projects versatile (from hardware side, but software side too)
There are still some points which are not clear: is this config OTA-able? If yes, which library is offered by you?
If not, no problem, I can put in USB cable to the board if it is necessary... (Or WifiLink, in your answer, referred to it? )
And Which library could be fit for establish the above mentioned functions (wifi connection, sending, receiving some data to internet)?
with Uno, 'self update' is not possible over network because every networking library makes the sketch larger then half of the flash memory. Self update over SD card with SD bootloader is not possible because networking library plus SD library plus ArduinoOTA library don't leave space for your code. If you had Mega+WiFi, you could use my ArduinoOTA library.
So for OTA update for ATmega328p over esp8266 on Serial the esp8266 must do what avrdude does from PC. If you want to have a networking library and OTA upload with esp8266, the only option is WiFiLink. I used it one season in my Regulator project with Arduino Uno WiFi Developer Edition (the project uses only TCP, not UDP). And WiFiLink can't do SSL connection (https). Rest server and Blynk are OK. There is no memory space to serve static files from Uno but you can put static files into esp8266 file system and the WiFiLink firmware's web server will serve them. btw. WiFiLink firmware is an Arduino sketch.
if you decide to write a sketch for esp8266 for the networking part and you upload from linux, then avrdude can upload over the esp8266. but windows version of avrdude can't do network upload.
Thanks,
As I am not so deep in programming as you, I summarize what I understood:
OTA update with this config (UNO with integrated ESP8266, 4MB) is not so trouble-free, therefore I should forget it or change to Mega. As my original project runs on Uno, I won't change to other board.
If I'd want to use WifiLink, should I upload a special WifiLink firmware to ESP?
The other approach is to use USB to upload sketches to UNO (not OTA) and ESP8266 uses AT firmware.
Which lib is used in this case on UNO? As I read, Uno can handle ESP with AT commands well and it works only as a gate to internet of uno board. Is it possible to send and get requests from internet?
all links in this case go to my GitHub. there is really nothing better. You approached me because I understand the Uno+WiFi board and it is because I deal with esp8266's use as network adapter and for OTA upload.
for WiFi Link firmware, WiFiLink library. but not the version from Library Manager, but my fork
for AT firmware 1.7+ my WiFiEspAT library (for older AT firmware WiFiEsp by B.Portaluri. both libraries are in Library Manager)
Hello Juraj,
I checked your WiFiEspAT/examples/Basic/WebServer and WebClient. They worked well.
And I read a lot about ESP8266 as NodeMCU/DevBoard and only Shield.
I concluded that ESP8266 is in different formats: ESP-01 only a shield to add wifi to other MCUs; NodeMCU is a development board with GPIO and could be used as MCU, there is no necessary an UNO or Mega.
But what could be the reason to create this UNO+ESP8266 Board with 4 MB.
If I use ESP as a shield it is absolutely unnecessary that huge Flash memory.
I cannot use it as a NodeMCU, because ESP has not so much GPIO;
UNO is not upgraded to OTA ability because of low memory on UNO's board;
But what is the best purpose of use and how it can be exploited?
Correct me, please, if i came to wrong conclusions or there were inaccurate ideas.
1.) there are different use cases. and full AT 1.7+ requires 2 MB flash too
2.) esp8266 was developed as network adapter. the standalone use is a stretch
3.) there are esp8266 firmware which can OTA update ATmega328p
I bought Arduino Uno WiFi Developer Edition in 2017 as my first Arduino and then I totally didn't know how it works.
It is an Uno with esp8266. But the esp8266 is not on Serial, but there is a i2c to Serial chip. So basically the ATmega has a Serial added over I2C (I had to write a new library for this, because the original worked only at 9600 baud). And another trick on this board is that an esp8266 pin controlls switching of esp8266 Serial directly to RX/TX of ATmega328p for OTA update because the bootloader listens there, not on I2C.
And the software for the board was very limited at first (it used esp-link firmware (good for OTA upload)). They developed WiFiLink then, so I could use the board with standard Arduino networking and later migrate to Wemos D1 (many problems) and later to boards with Ethernet without rewriting the networking part. All the time my project has OTA update because it runs in a box on other floor.
I used the Uno WiFi in my project one year and it was fully utilized. I had static html files for web pages in the flash of esp and the Uno handled only the requests for data.