What is the Simplest Way to Update the Firmware of this 5v ESP8266 Module?

Juraj:
did you try OTA update? AT+CIUPDATE could update the AT firmware (if it doesn't try to update to 1.7 or 2.0)

AT+CIUPDATE is the first thing I tried, before even coming to the forum.. :smiley:
It gave an error,
that's what it always does, at least in all the times that I tried, across several different years of trying this command.

My assumption is that Espressif did not want to invest in the needed bandwidth needed for it,
so the command simply tries to communicate with a dead server, and so that's why the error..
(am I correct with this theory? or there are people for whom AT+CIUPDATE actually worked?)

Juraj:
wrong section
see # BOOT MODE section
or "1.2.4. 8 Mbit Flash" in AT reference

I see.
OK for Boot Mode indeed all needed files seem to be present..

From googling: ESP8266 boot vs "no boot", the explanation that I found, is that "no boot" will not support AT+CIUPDATE, and "Boot" will support it.
That's really the only difference?
I wonder why they created different files for that..
It could simply be a small setting in the Flash..

I also wonder why the readme.md file of v1.6.2 shows options for both Boot and No Boot,
yet the No Boot option leads to files that do not exist..
Does it mean they removed the option, and someone forgot to clean the .md file?

card5:
AT+CIUPDATE is the first thing I tried, before even coming to the forum.. :smiley:
It gave an error,
that's what it always does, at least in all the times that I tried, across several different years of trying this command.

My assumption is that Espressif did not want to invest in the needed bandwidth needed for it,
so the command simply tried to communicate with a dead server, and so that's why the error..
(am I correct with this theory? or there are people for whom AT+CIUPDATE actually worked?)

I see.
OK for Boot Mode indeed all needed files seem to be present..

Fromm googling ESP8266 boot vs "no boot", the explanation that I found, is that "no boot" will not support AT+CIUPDATE, and "Boot" will support it.
That's really the only difference?
I wonder why they created different files for that..
It could simply be a small setting in the Flash..

I also wonder why the readme.md file of v1.6.2 shows options for both Boot and No Boot,
yet the No Boot option leads to files that do not exist..
Does it mean they removed the option, and someone forgot to clean the .md file?

I never searched for use of the 'no boot' or the files for it.

the ciupdate worked for me in the past. I don't remember when I used it last time.

Juraj:
the CIUPDATE worked for me in the past. I don't remember when I used it last time.

Interesting,
it can make things easier.

In any case, I am glad I have all the files now.

I got one open end remaining.

In the file list for FlashSize=8Mb,
the file esp_init_data_default.bin is defined as optional:

When do I want to include it in my flashing, and when not?

card5:
Interesting,
it can make things easier.

In any case, I am glad I have all the files now.

I got one open end remaining.

In the file list for FlashSize=8Mb,
the file esp_init_data_default.bin is defined as optional:

When do I want to include it in my flashing, and when not?

I always include it. It is optional if it was flashed before. But it is not always compatible between SDK versions and you have a big jump from SDK 1.3 to SDK 2.2

I see.
Good point, OK I will include it.

BTW,
Section 1.2.4 in the 4a-esp8266_at_instruction_set_en.pdf file shows a slightly more expanded table:

Here they also mention flashing the blank.bin file a 3rd time, while on the readme.md it is mentioned only twice.
So I will include the 3rd blank.bin too.

I Flashed it now, it seems like it worked,
I will do some testings on it in the morning..

Thank you so much for your help Juraj,
I couldn't have succeeded if it wasn't with your help..

card5:
I see.
Good point, OK I will include it.

BTW,
Section 1.2.4 in the 4a-esp8266_at_instruction_set_en.pdf file shows a slightly more expanded table:

Here they also mention flashing the blank.bin file a 3rd time, while on the readme.md it is mentioned only twice.
So I will include the 3rd blank.bin too.

I didn't notice it. Thank you. It could be important for some experiments I plan to identify problems with uninitialized RF TX power setting causing problems by drawing too much power.

I also read that is it recommended to execute AT+RESTORE after updating the Firmware..
So I did it just in case..

It's also good If we set some settings that are then hard to get rid of..
(e.g. AT+CWJAP_DEF: If you set it and later want to clear it, you can't..
setting it to "","" will generate an error, not clear the setting..)

card5:
I also read that is it recommended to execute AT+RESTORE after updating the Firmware..
So I did it just in case..

It's also good If we set some settings that are then hard to get rid of..
(e.g. AT+CWJAP_DEF: If you set it and later want to clear it, you can't..
setting it to "","" will generate an error, not clear the setting..)

AT+CWQAP
AT+CWAUTOCONN=0

or the RESTORE

Juraj:
AT+CWQAP
AT+CWAUTOCONN=0

or the RESTORE

Interesting.

From the AT Commands reference, it seems that AT+CWQAP only works on what is now,
it is similar to "_CUR" commands, not to "_DEF" commands,
but the AT+CWAUTOCONN=0 command will definitely work - thank you for that.

Regarding ESP8266 and 5v,
there are 2 more boards that I bought, several weeks ago.

Arduino Uno Wifi: ATmega328 + ESP8266

Arduino Mega2560 Wifi: ATmega2560 + ESP8266

The Uno Wifi costs 6$,
and the Mega2560 Wifi costs 10$..

I bought one of each and received them.

It is a fantastic price for such boards

The advantage of the Mega2560 Wifi here, is that it has 4 Hardware Serial Ports,
and so, Serial Port 0 (object "serial") is connected to the USB Controller chip (CH340),
and Serial Port 3 (object "serial3") is connected to the ESP8266 chip.

That way, we can communicate with the ESP8266 in high baudrate, and not be limited by the speed that we can get with a Software based Serial Port implementation..

BTW,
we mentioned Flash memory size,
they both come with 32Mbit..
4 times of what I have in the module that I just updated..

call the boards "Uno + WiFi", "Mega + Wifi". That is the official name. They are not by Arduino so it is not in the name.
Uno WiFi are different Arduino boards.

Uno+WiFi is troubled, because ATmega328p has only one Serial to connect to USB or to esp8266. But there is a esp8266 header with RX, TX which can be wired to SoftwareSerial of ATmega.

On both you can switch RX,TX of the esp8266 to USB chip to flash the esp8266. One dip switch (7?) is for 'program' mode of the esp8266, it works same way like the switch on the adapter module.

The Mega+WiFi is ideal for my WiFiEspAT library and for OTA upload with ArduinoOTA library.

Juraj:
call the boards "Uno + WiFi", "Mega + Wifi". That is the official name. They are not by Arduino so it is not in the name.
Uno WiFi are different Arduino boards.

You're right, OK I will use these names from now on..

Juraj:
Uno+WiFi is troubled, because ATmega328p has only one Serial to connect to USB or to esp8266.
But there is a esp8266 header with RX, TX which can be wired to SoftwareSerial of ATmega.

Right,
the 3x4 Pins, labeled as "ESP Pins", expose the legs of the ESP chip.

Juraj:
On both you can switch RX,TX of the esp8266 to USB chip to flash the esp8266.
One dip switch (7?) is for 'program' mode of the esp8266, it works same way like the switch on the adapter module.

Indeed it is #7:

Juraj:
The Mega+WiFi is ideal for my WiFiEspAT library and for OTA upload with ArduinoOTA library.

Great, in that case I will use them, thank you for creating it.

BTW,
I received both these boards 2 days ago,
and I am testing them to see that they both work well.

I started with the Uno+Wifi, and set the DIP Switch to 5 and 6 = On (the rest Off),
meaning USB<->ESP8266 (Communication).

What I get in the Serial Monitor, is some program that runs, that writes
"scan start"
"scan done"

and then prints a full list of all the WLANs in my area (a list of about 20 wifi networks).

I went to google to see where this program is coming from,
and entered: ESP8266 "scan start" "scan done",
and it found me this program:

Like I wrote above, I set the DIP Switch to connect the USB controller with the ESP8266, in Communication mode.

From the code of this program (WiFiScan.ino), and the library it uses (#include "ESP8266WiFi.h"),
can you please confirm that this is indeed a program that runs on the ESP8266, and not on the ATmega328?

card5:
BTW,
I received both these boards 2 days ago,
and I am testing them to see that they both work well.

I started with the Uno+Wifi, and set the DIP Switch to 5 and 6 = On (the rest Off),
meaning USB<->ESP8266 (Communication).

What I get in the Serial Monitor, is some program that runs, that writes
"scan start"
"scan done"

and then prints a full list of all the WLANs in my area (a list of about 20 wifi networks).

I went to google to see where this program is coming from,
and entered: ESP8266 "scan start" "scan done",
and it found me this program:

Arduino/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino at master ยท esp8266/Arduino ยท GitHub

Like I wrote above, I set the DIP Switch to connect the USB controller with the ESP8266, in Communication mode.

From the code of this program (WiFiScan.ino), and the library it uses (#include "ESP8266WiFi.h"),
can you please confirm that this is indeed a program that runs on the ESP8266, and not on the ATmega328?

I would expect AT firmware in the esp8266.
There are similar network scan examples, but only other in ATmega using AT in esp8266 could be from WiFiEsp library and that prints debug outputs at default.

Upload Blink to ATmega and then switch back to esp8266 and you will see.

Juraj:
Upload Blink to ATmega and then switch back to esp8266 and you will see.

Actually the ATmega is blinking already - it came with Blink..

So I assume this can confirm that the ESP8266 is running a program, coming like this from the manufacturer..

Can I somehow send AT commands to it now,
or do I need to erase the program from the ESP8266 first?
(erasing the program requires re-Flashing like I did on the 5v module?
or there's a simpler way to disable the program from running, and get the AT commands interface back?)

card5:
Actually the ATmega is blinking already - it came with Blink..

So I assume this can confirm that the ESP8266 is running a program, coming like this from the manufacturer..

Can I somehow send AT commands to it now,
or do I need to erase the program from the ESP8266 first?
(erasing the program requires re-Flashing like I did on the 5v module?
or there's a simpler way to disable the program from running, and get the AT commands interface back?)

the ScanNetworks example is now the 'application' in the esp8266. there is no AT firmware.

you can flash the 1.7.1 version of the AT firmware. use addresses for 32Mbit flash (1024 KB + 1024 KB)

Oh, so only reflashing will remove it, OK..

Juraj,
did it happen to you that you updated the Firmware of an ESP8266 module/board,
and the RF capabilities of the module/board then became worse than with the older Firmware?

I am doing some testings today, after finally succeeding yesterday with Flashing the ESP8266 module,
and ironically the result is this:

  • With the old firmware, the module connected to my WLAN 100% of the times (tested aprox. 10 times)
  • With the new firmware, the module simply does not connect to my WLAN - 100% of the times (tested 8 times)

And so, I updated the firmware, and maybe fixed a few bugs and added some AT commands,
but the module will not connect to the wireless network at home..

To verify this, I am considering reFlashing back to the old Firmware, to test if then surprisingly the module will again connect to the WLAN 100% of the times.

Here is the original firmware, that connected perfectly:

And here is the new firmware, that does not connect at all:

When looking at the results of AT+GMR,
the difference is not just in the version of the Firmware, but also in the creator of it.

The original firmware is by Ai-Thinker,
while the new firmware was downloaded from Espressif.com..

Is there any chance to download the old Ai-Thinker Firmware somewhere, for testing?

This may have been said,
but can you not just wire this to USB-TTL convertor and program it via the Arduino IDE.

Failing that just remove and program the memory IC directly using another Arduino.

Update:

My router is a really old router,
I also have a mini-PC that cannot wirelessly connect to that router, 100% of the times.

So suspecting the old router is more the problem, I tried now to connect with the updated ESP8266 to another AP.
Since I don't have another Wireless Router at home, I took my Android phone, and enabled "Portable Hotspot" on it.

It makes the phone act like a Wireless Router, and can accept upto 10 devices connecting to the WLAN that it creates, and includes WPA2 encryption.

So in short, after trying to connect to it several times,
100% of the attempts to connect to it, with the new Firmware that I have, succeeded.

So this means that the new firmware isn't bad,
it just seems to less like old devices, like my really old router..

The older firmware, worked very well with my old router.

The hardware (of the ESP8266 module) did not change between these attempts,
so it means there are some RF Definitions that affect it..

esp8266 runs RF calibration after some count of resets so the performance improves and stabilizes over time

Really?
Is there maybe a way for me to request to run this calibration now?

I would really like to be able to connect to my router without going back to an older Firmware..
(and without buying a new router, which mostlikely will solve the problem)