OTA Solution - Build your own OTA platform (2/2, ESP32 OTA Application)

  Переглядів 12,376

That Project

That Project

2 роки тому

This project is about creating the most basic solution for OTA updates, from server to device.
This could help you understand how servers and devices work for OTA updates.
Let's complete the ESP32 side following the previous video.
[ESP32TIME]
github.com/fbiego/ESP32Time
[ESP32 Update]
github.com/espressif/arduino-...
[MBED md5.h File Reference]
tls.mbed.org/api/md5_8h.html
[Project Github]
github.com/0015/ThatProject/t...
#ESP32 #OTA #Update #MBED #MD5 #ThatProject

КОМЕНТАРІ: 58
@MarcdHotman
@MarcdHotman 2 роки тому
This was awesome, will definitely make use of it. It helped plenty. Look forward to seeing how this can be done more secure so that nobody can copy your code.
@ws302
@ws302 2 роки тому
Excellent. Good project and explained very well. Thank you.
@ThatProject
@ThatProject 2 роки тому
That Project's Channel - ukposts.info Join FB Group - facebook.com/groups/138965931539175
@achalasamapriya2701
@achalasamapriya2701 2 роки тому
awesome .keep em rolling 😘😘
@enpei6608
@enpei6608 2 роки тому
nice
@aidenDE
@aidenDE 7 місяців тому
Great Project, how does it work with skipping whole versions tho ?
@ThatProject
@ThatProject 7 місяців тому
Thanks. What do you mean by skipping the whole version? FW updates without version check?
@dezenbusiness
@dezenbusiness 2 роки тому
excellent video, do you think you could make an example by replacing SPIFFS with an SD card
@ThatProject
@ThatProject 2 роки тому
Thanks. Not right now, but I'll apply it to the next version. Thank you.
@wp0049830
@wp0049830 Рік тому
Great project. Is it possible to perform OTA via the Internet instead of local network? Which platform do you suggest?
@ThatProject
@ThatProject Рік тому
For testing purposes, I put it in the local. You can deploy this on a cloud server such as AWS or Azure. Also, in this case, you need to consider security as well. In order to strengthen security, the overall system must be upgraded to work based on HTTPS/SSL.
@wp0049830
@wp0049830 Рік тому
@@ThatProject Thanks, I'll try that on AWS EC2
@ThatProject
@ThatProject Рік тому
@@wp0049830 Please let me know if you have any updates. If I get a chance, I want to try it too.
@wp0049830
@wp0049830 Рік тому
@@ThatProject Hi, It works on AWS EC2, atleast the HTTP version, I didnt try on HTTPS. I installed Python, gunicorn and nginx on EC2. Now it is possible to FOTA the ESP32 on the Internet without relying on third party apps, thanks a lot :)
@ThatProject
@ThatProject Рік тому
@@wp0049830 Congrats! You made it. Now you have your own solution for updating device firmware automatically. That's awesome!
@varunkumarr9633
@varunkumarr9633 2 роки тому
I’m using esp32 module I’m facing issues with touch pins i want to deactivate that one how to did bro ?
@meierthomas
@meierthomas 2 роки тому
Thanks for this complete solution. I have two questions: 1) My ESP32 based project (design phase) doesn't have a display and is away from the user. in addition it's in deep sleep; it wakes up 4 times a day to send sensor data via a RESTful API to a database and a front end access the database for reporting etc. So the user doesn't directly access to the ESP32. So the only meaningful solution would be for the ESP32 to check for availability of new firmware every time it wakes up (or every nth time it wakes up) and automatically pulls down the code and does the firmware refresh. The firmware version can be pushed to the database so it can be displayed on the front end. Also a status message if the firmware update was not successful could be displayed on the front end so the user can manually access the ESP32 if needed. Can this be done? 2) How do I ensure that this code coexists with the actual firmware? Does this use different storage regions on the ESP32?
@ThatProject
@ThatProject 2 роки тому
1) Assuming that all the APIs you mentioned are working normally, this system will work properly. 2) The firmware in use is no longer accessible(but you can get the information), and the new firmware can be saved to the ESP32's internal file system or external SD card.
@meierthomas
@meierthomas 2 роки тому
@@ThatProject Sorry re 2) what I meant is the OTA code running on the ESP32 needs to be integrated into the main firmware (in my case reading the sensor data and then pushing it to the db via the Rest APIs). There's a lot going on in your code and I'm not clear where I would insert my firmware code
@ThatProject
@ThatProject 2 роки тому
@@meierthomas Let's say you made the second new firmware binary file that has a new function to pushing to the DB through the REST API you made. After it's installed from the inside, all functions are integrated into the main firmware. Therefore, the first main firmware had to contain an update solution. My code is modularized by function. I recommend you create a new class and add the code you want.
@meierthomas
@meierthomas 2 роки тому
@@ThatProject Ok are you suggesting in my firmware I create a class that utilises your OTA code which will then check for new versions of my firmware? Sorry for all these "simple" questions but I really like the overall solution. On a side note is adopting this for ESP8266 a massive change for a nonprofessional developer like myself or is it a question if swapping a few libraries?
@ThatProject
@ThatProject 2 роки тому
@@meierthomas Not sure how best to do it because I don't understand all of your circumstances but I believe it works. I don't think you need to change a lot to use ESP8266 instead of ESP32. Let me know if you have an issue.
@nelsontechnologiesconsulti6552
@nelsontechnologiesconsulti6552 2 роки тому
Great project. One question. If the main.py script is stopped and restarted, the display says Server Not Responding. Even with the script up and running again, it doesn't refresh until I restart the esp32. Any ideas?
@ThatProject
@ThatProject 2 роки тому
Check the server every 10 seconds for the test. The most recommended method is to change the time to check once a day or once a week. Also, if there is no response from the server, removing this part is one option. void SimpleOTA::serverFirmwareCheck() { version->setNewFirmware(network->checkVersion()); if (version->newFirmwareVersion() == -1) { //display->newMessage("Server Not Responding"); }
@nelsontechnologiesconsulti6552
@nelsontechnologiesconsulti6552 2 роки тому
@@ThatProject Thank you! I solved my issue by modifying that statement. void SimpleOTA::serverFirmwareCheck() { version->setNewFirmware(network->checkVersion()); if (version->newFirmwareVersion() == -1) { display->newMessage("Server Not Responding"); } else { if (version->hasNewUpdate()) { display->newMessage("New Build Available! ->"); } else { initDisplay(); } } }
@7zzZKnightZzz7
@7zzZKnightZzz7 3 місяці тому
I'm using the Lilygo Dongle ESP32 S3 and I noticed my update fails because the file size does not match. Prior to the download messages it says "File Length: 989328" but when it completes, and the SPIFFS listing shows the download_firmware.bin is 391424 bytes. Any idea what could be the issue? I also noticed I have some additional files in the SPIFFS listing, like a 'config.json' (141 bytes) and a 'img_log.gif' (267008 bytes) - I wonder if this ESP32 has run out of space? I'm confused on how to move forward. thanks.
@ThatProject
@ThatProject 3 місяці тому
It seems as if the new firmware file is not downloaded properly because there is no SPIFFS space. If you are using an ESP32-S3 with a large Flash size, would you like to change the partition to a larger one? If this isn't enough, you may need to use an SD card.
@7zzZKnightZzz7
@7zzZKnightZzz7 3 місяці тому
@@ThatProject Not sure what is going on. I tried the same code on the Lilygo T-Display-S3, which has even more space available, and every time I download the firmware it downloads a different size. These were the size in bytes over multiple attempts: 663, 774144, 656896, 774144, 656896. The checksum succeeds but the size is obviously wrong. Download Percent always reaches 100%, but the Size in the SPIFFS folder is just off each time. I'll try a ESP32-S2 device next, and see if it works any better than the Lilygo S3 that I've tried so far.
@7zzZKnightZzz7
@7zzZKnightZzz7 3 місяці тому
Same issue on an S2 device - The firmware is 961888 bytes, but two downloads reported 661504 and 660992 bytes. I must be doing something fundamentally wrong. But I have to say, your code is pretty damn awesome. I really appreciate you even responding. If you got any thoughts on what I'm doing wrong, I appreciate them. Thank you again.
@7zzZKnightZzz7
@7zzZKnightZzz7 3 місяці тому
@@ThatProject I think the issue might be the PlatformIO board_build.partitions = huge_app.csv. I've tried other partitions and they all fail to even upload from PlatformIO, but I don't know which one to use to increase the SPIFFS size (assuming that's the issue).
@7zzZKnightZzz7
@7zzZKnightZzz7 3 місяці тому
I tried making my own custom partitions table and set the SPIFFS size to 0x100000 (1048576 bytes), which exceeds my file size, and I still don't get the full upload. Instead of a file size 989328, it uploaded to SPIFFS only 757504 bytes.
@adiyasurenjargalsaikhan3218
@adiyasurenjargalsaikhan3218 25 днів тому
Thanks awesome project, I tried ur code but when I try to execute Update.writeStream(); nothing has flashed. This function returned zero... What I made wrong?
@ThatProject
@ThatProject 25 днів тому
It seems like a situation where writing is impossible. There is a possibility that the FW file downloaded from the server exceeds the available flash capacity and the FW is not stored in flash memory correctly. Would you like to check the size of the downloaded FW?
@ivanarakistainmarkina385
@ivanarakistainmarkina385 Рік тому
Would it be possible to do OTA over celllular connectivity instead of Wifi?
@ThatProject
@ThatProject Рік тому
I think so. I believe you can replace it with a cellular code.
@ae_circuit
@ae_circuit 8 місяців тому
@@ThatProject could You please cover this in one of your video? Your explanation makes things easy to understand.
@GildiaMystica
@GildiaMystica 10 днів тому
Hi, after download file from a server, every time size of file differs by 14 bytes what affects the MD5
@GildiaMystica
@GildiaMystica 10 днів тому
downloaded file has 14bytes more.
@GildiaMystica
@GildiaMystica 10 днів тому
http.getSize() retunr -1 but why? Using Postman everything is okay, the body of request has the same size which was calculated on the server.
@ThatProject
@ThatProject 10 днів тому
@@GildiaMystica Are you sure? What about MD5 checksum?
@GildiaMystica
@GildiaMystica 5 днів тому
@@ThatProject MD5 file on the server is correct( checked by calculator), on the ESP32 is wrong cuz something affects on the size( and body of file?) during download. I tried download smaller file, txt example about 50kb and everything is okay, is it chance that file is too big? Idk cuz everytime i tried download and upload code like you with little diffrence ( printing on serial).
@GildiaMystica
@GildiaMystica 5 днів тому
my bad, sorry, everything is okay, i didnt mention that i create my own php server, and i didnt add header with content-length which didnt allow to get file size.
@nelsontechnologiesconsulti6552
@nelsontechnologiesconsulti6552 2 роки тому
Trying to upload 1.8mb firmware to esp32. Hangs around 60%. Smaller firmware works fine. Any ideas? Wifi is strong.
@nelsontechnologiesconsulti6552
@nelsontechnologiesconsulti6552 2 роки тому
Finally got it to finish but saying Checksum is wrong.
@ThatProject
@ThatProject 2 роки тому
@@nelsontechnologiesconsulti6552 First, you cannot save more than 1.5MB of files to SPIFFS from the default partition scheme. If you need more space, please use SD Card. I guess this is why you get the wrong checksum here.
@nelsontechnologiesconsulti6552
@nelsontechnologiesconsulti6552 2 роки тому
@@ThatProject Thank you!! I have the SD working in a demo. Do you have any library in this project that would use this instead of SPIFFS or do you know how to implement this in your project? THanks again!!!
@ThatProject
@ThatProject 2 роки тому
@@nelsontechnologiesconsulti6552 Unfortunately, there is no project video using SD yet. I recommend you google this part.
@DmitriyKhazansky
@DmitriyKhazansky 2 роки тому
What display model is this?
@ThatProject
@ThatProject 2 роки тому
It's ER-TFTM035-6. You can find it by googling.
@nhanNguyen-wo8fy
@nhanNguyen-wo8fy 8 місяців тому
4:30
@xamashee
@xamashee 2 роки тому
Can we call it a CI/CD?
@ThatProject
@ThatProject 2 роки тому
Hi Max. That's a good point. The basic concepts of CI/CD are continuous integration, continuous service delivery, and continuous deployment, and solutions to address the challenges posed by dev ops team. What I've created is the least simple way to keep quality control of the service. Completing a CI/CD solution requires much more work.
OTA with the ESP32 (Over The Air)
8:38
Programming Electronics Academy
Переглядів 46 тис.
Teenagers Show Kindness by Repairing Grandmother's Old Fence #shorts
00:37
Fabiosa Best Lifehacks
Переглядів 30 млн
Ах Ты Ж Су... Не Провоцируй Меня! @NutshellAnimations
00:15
Глеб Рандалайнен
Переглядів 3,3 млн
#225 How-to Manage your ESP32 and ESP8266 over the Air (IOTappstory.com)
11:52
DevCon23 - Using ESP-IDF FreeRTOS Functionality Within an ESP32 Arduino Project
41:56
Is Adam Savage Still an Atheist?
8:16
Adam Savage’s Tested
Переглядів 117 тис.
How to update ESP32 (Or ESP8266) over Wi-Fi network (OTA)
17:15
OTA Drive
Переглядів 19 тис.
ESP32 OTA update via internet (once for ever)
7:10
OTA Drive
Переглядів 10 тис.
ESP-IDF ESP-32 HTTP/HTTPS OTA(Over The Air) Firmware Update
15:06
Embedded Hacks
Переглядів 12 тис.
Tech Note 082 - ESP32 Over-the-Air (OTA) Updating
8:52
G6EJD - David
Переглядів 37 тис.
programming projects that taught me how to code
9:49
isak
Переглядів 209 тис.
Клавиатура vs геймпад vs руль
0:47
Balance
Переглядів 923 тис.
Broken Flex Repair #technology #mobilerepair
0:50
ideal institute aligarh
Переглядів 1,8 млн
Phone charger explosion
0:43
_vector_
Переглядів 45 млн
The ARM chip race is getting wild… Apple M4 unveiled
4:07
Fireship
Переглядів 679 тис.