[Solved] ESP8266 update firmware OTA?


#1

Hi,
Some of you have tested the firmware update of their ESP8266 by air?

I know it works in the same Wi-Fi network, but off the wifi network is that possible?


#2

On remote location? Not that i am aware of, there are some tests with httpUpdate but i did not see any positive results on that either.


#3

@Agroelektronik
i’ve test this method http://www.esp8266.com/viewtopic.php?f=160&t=12948&start=12 but no result… but it seems to work with guys.


#4

This is interesting, i will try during the next weekend


#5

Yheaa let me know your results !!!


#6

Guys, maybe this can help: http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html

I haven’t tried it, but it sure sounds promising…


#7

yes i know local update, but i’m interesting with http update at the end of your doc. i never make it working


#8

Not mine, just stumbled upon it… :slight_smile:

Here is another one: https://myelectronicslab.com/esp8266-ota-example-arduino-code-tutorial-air-update/


#9

Thanks for this link, but i know to do that : it’s on wifi network. My wish is on another network, by internet with a http server


#10

Hmmmm, AFAIK, that would be insecure, because ESP8266 can’t hold really complicated security to prevent unauthorized access and reflash by third person…

Other way is to reflash it by OTA and in “local” WiFi, but from platform which is ON THAT network - directly connected or on VPN access. That would make it a bit more secure (not bullet-proof, but better than straight access to bare ESP from Internet).

And, your ESP has public IP? How did you manage to do that? It is usual to have ESP connected to some router, and then with some kind of NAT connected to Internet… and by this method you have option to access it from anywhere… At least I can… Although I haven’t tried this Firmware-over-the-Air script, I guess it COULD be managed on router (I don’t think it is ESP’s fault).


#11

httpupdate does not work that way, its not a push update.
ESP holds code with hardcoded web address and it checks periodicaly for a new file on that address.
So security depends on server side, not esp.


#12

This is the begin of the story :
http://www.esp8266.com/viewtopic.php?f=160&t=12948&start=16


#13

Hello there! Yes, we use OTA outside local network.
But you need a remote server to “put” updated sketch, and then point your code to find the server IP and check if there´s a new code there. If so, it updates the code over the air.
Complicated? Yeah, but if you guys want I can do a post explaining it step by step!
Regards from Brazil!


#14

Viva o Brasil :wink:

Great news i think lot of us , use ESP8266 and are interested with OTA outside local network.

One question :
I have an account www.000webhost.com (free site hosting), can that be enough to store the .bin sketch (by filezilla for example), and then the ESP8266 will look, regularly, if there is a new code?

I saw that it was possible but without a positive result on my side.
On your side, did you try?

Regards from France!


#15

That would be ok, only dissadvantage would be you need separate location for bin files in your weblocation for every device because of mqtt credentials and other differences.
device 1 www.000webhost.com/bin1
device 2 www.000webhost.com/bin2 etc

@guilherme could post code for solution they use.


#16

I think first, update One device, will be a very good starting !
After , we could find solution for many other Devices (separate location for bin files, connect on a server …)


#17

Agree on that, testing first :hammer::wrench::nut_and_bolt::nut_and_bolt:


#18

:star_struck: Show us what you are able de to :muscle:


#19

Hello there!
Yes, it is enough! We use hostgator.com , the same service that holds our webpage www.gpstech.com.br, holds our bin files.
And that works =)


#20

Actually not, Agro.
You can “store” MQTT credentials on Arduino EEPROM memories. Then your code only have to look on the server for the next version of the code.
Well, perhaps it is better if I add our code here =)
Give me a couple of hours and I will add the code here!