-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Server ota updates #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can use the included BasicOTA example, but you need to add Edit: My answer seems to be irrelevant after PeWos edited the question. |
Hi @gellis12 I edited the question before you answered me, i had write bad a word. I have tried adding the update library but it only works in local with the arduino ide. What function do I have to add that is like the ESP8266 ESPhttpUpdate function? |
I am porting it to ESP32, but actually have 2 working versions: the only http one (using WifiClient) and the only https one(using WifiClientSecure). So I am trying to unify both (to keep closer to ESP8266) and make a PR. |
Could you publish http version of OTA update? |
Any chance of publishing a working version ? :) thanks |
Sorry for say that, but it's still missing some important functions for full port, like:
I think it's too early to release but HTTPClient port is one step closer... |
Ok thanks, am just looking for an easy way to do OTA updates - if it works at all, that would be great ! |
So we are looking for OTA Updates for ESP32 in Arduino IDE. Something can help me? |
there is a nice example i used called AWS_S3_OTA_Update.ino hope this helps. |
does AWS_S3_OTA_Update.ino really work? here is the serial reply on my test: [code]
ota sample from esp32-idf is working fine in my test. any suggestion? |
Peter- |
For NonSSL as @lbernstone say, 100ms is too low for almost servers response. For SSL mbedtls still doesn't peek bytes so WiFiClientSecure can't get the magic header from new firmware and updater fail at this part |
Thank you very much for the replies. I changed the delay to this:
s3 bucket is http accessible even if it gave me https link to the bin file after upload. here is the reply I got in my terminal, added:
here is the code used to get headers:
from the original code, I added:
to indicate im getting end of line rearranged so I clearly see the header reply:
content type from my S3 header is "application/macbinary", so I changed that also, just to set the isValidContentType
the remaining codes is unchanged, but I get this always:
|
tried also with my EC2 as the file server here is the reply in my terminal:
am always getting Error Occurred. Error #: 8 Im using EC2 server on esp32-idf ota sample without problem any suggestions? |
Update::writeStream does a stream peek, which as @copercini mentioned, doesn't work yet. I removed lines 305-308 (the magic byte check) from Update.h and it works. |
thank you very much for your help. let me answer my previous question: answer: and for those who has slow internet like mine, just need to change the delay after GET request. here is the code I used:
here is the response on my serial terminal
|
@peterzcruz it works with magic byte check or excluding it? |
I did not exclude the magic byte. no changes made on Updater.cpp and Update.h. thank you @copercini and @lbernstone |
Just some updates:
|
Dear @lbernstone , Connected to ACRONICS |
Has anyone been able to do something like this to update ESP32 firmware through a URL: |
Hi Petter, I have trouble to find the proper includes/library for the ESPhttpUpdate thing. I am on "v3.0-dev-1024-g92748142". I want to auto-update ESPs in the Field that phone home every once in a while (like every day or week or at reboot). Andreas |
@huyhl248 I experienced the same as you. The AWS_S3_OTA_Update.ino example works fine but if the new .bin file is relatively large (in my case ~900 - 975KBKB and in your example ~481KB) it returns an Error #6 code (UPDATE_ERROR_STREAM). Also the bytes written always exceed the new .bin file size.
Has anyone figured out a workaround? |
Working with SSL now! =) After add WiFiClientSecure::peek(); febcda0 |
Hello, The only working fix still seems to be disabling the actual verifyheader check in the writestream function. The OTA sketch works, but only when we disable the verifyheader / peek function. |
I can confirm @krish2487's observations. OTA upgrades over TLS only work if the |
using the same code as @peterzcruz but with my own server (dedicated server on UKFast in UK) I can successfully upload a modified version of the AsyncBrowser that then allows access to files previously uploaded to the SPIFFS area on the ESP32. The .bin file is stored in a subfolder (/img) on the server and reports as 756kbytes in size but is actually 773376 bytes in size which is what the uploader reports.
I am working on a package to include a web server running on 1 core of the ESP32, an application running on the other core, with the ability to update the package from our own servers. |
Hi, same errore here: |
The delay listed by @tmsio on August 24 was the ticket for me .. works now with AWS and also my own web server :) THANKS to all !!! |
Hi everyone,
And sometime the kernel just panics:
Here's my current
|
Hi @Donderda , try to create a hotspot on your phone and try again. Regards. |
Setting _timeout to 5000 didn't work for me! :( |
Hi @huyhl248, can you try another HotSpot? Thank You |
Hi @tmsio ,
Please help me! |
Hello @tmsio and everybody, Your trick worked perfectly for me, but I understand that modifying a library is not a good practice (if the library gets updated, you loose the modification, for example). But the good news is that the Stream library has a function that allows you to modify its timeout parameter: .setTimeout(msegs). So in my case I used That's it. I hope it helps. All the best |
My issue with this was that while reading the headers, I was reading to the \r new line character, and there was another trailing \n new line character, which was showing up as 10 as the first byte instead of e9. To fix I'm doing this before Update.writeStream(*client), to advance by one more character before it checks the first byte: |
I use TinyGSM to dowload via Update. Also hit FFFF... at the beginning. |
It is due to unimplemented peek() in TinyGSM. The peek() always return -1 aka 255 or FF. |
i'm running an esp32 with the OTA sketch and I am getting
Is there still no other solution other than modifying the library? This was even using the |
It is possible to update my esp32 via ota from a server like the esp8266. I have read this page http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html#http-server but the function can't be compiled with esp32.
Thanks in advance
The text was updated successfully, but these errors were encountered: