I have a bunch of ESP32s across the country that are all flashed with OTA.
Essentially, I upload a new bin file and JSON file on a web server and have ESP32 compare its version with the version from the JSON file and if it is lower than that it updates.
However, if I want to only update one of them, there is no way to do it without updating the other ones too.
I have their mac addresses somewhere, but is there a way to perhaps have them ping a web server so that I get exact mac addresses, and have it so that it firstly compares the mac address with mac address in json file and if it is the same mac address + it is a lower version that it updates?
Second, sometimes, they will lose internet connection and reboot seems to fix it
So, after getting their mac addresses or whatever is necessary to identify them one by one, is there a way to reboot only one of them?
(this is perhaps the most important function to me)
Thirdly, they all have 2 led indicators, first is if the important process is ongoing (it has a connection to the remote PC) and second is if it has wifi connection. I'd like to be able to see those indicators for each one of these one by one, if the process is ongoing and if it has wifi connection without someone being there physically.
So TLDR:
I need to have a list of all ESP32s, their current status (process is ongoing, wifi is found), ability to reboot one of them or even put them in provisioning mode and put a new update to only one of them.
Is there a way to do this with OTA? (reboot, flash only a specific device, ping for information, etc)
Is there a way to do this with OTA? (reboot, flash only a specific device, ping for information, etc)
Last edited by statusquo on Wed Sep 28, 2022 9:26 am, edited 1 time in total.
Re: Is there a way to do this with OTA? (reboot, flash only a specific device, ping for information, etc)
There is few options to do it. Here you can find 2 of them:
- mqtt; device can report itself, with status, mac etc and can listen to messages from server; messages can be sent to all devices or to just one
- http/s; esp32 can polling server and to check if there is required any action.
- mqtt; device can report itself, with status, mac etc and can listen to messages from server; messages can be sent to all devices or to just one
- http/s; esp32 can polling server and to check if there is required any action.
-
- Posts: 48
- Joined: Wed Feb 05, 2020 6:29 pm
Re: Is there a way to do this with OTA? (reboot, flash only a specific device, ping for information, etc)
Hi statusquo and All,
I'm doing this exercise as well. The way I'm pursuing is based on MAC addr identity. The web server, which is also a file server and a WiFi access point, stores the new exe file with the MAC address as a preamble. As per previous tip the client polls the web server supplying its MAC address in the GET request. If the MAC address matches the preamble then the web server replies with the filename to download (as an additional precaution the target MAC address is added to the filename as a preamble so the station/client can check it, too)
Both the server and the client are ESP32 devices.
I'm now stacked with the file sending. I can easily send files up to few KB, but not the size of 950KB since the client always crashes
Did you succeed in OTA file sending? Thank you!
Added on June the 30th
The crash described here above has been solved including part of the "native OTA" exercise.
I'm doing this exercise as well. The way I'm pursuing is based on MAC addr identity. The web server, which is also a file server and a WiFi access point, stores the new exe file with the MAC address as a preamble. As per previous tip the client polls the web server supplying its MAC address in the GET request. If the MAC address matches the preamble then the web server replies with the filename to download (as an additional precaution the target MAC address is added to the filename as a preamble so the station/client can check it, too)
Both the server and the client are ESP32 devices.
I'm now stacked with the file sending. I can easily send files up to few KB, but not the size of 950KB since the client always crashes
Did you succeed in OTA file sending? Thank you!
Added on June the 30th
The crash described here above has been solved including part of the "native OTA" exercise.
Re: Is there a way to do this with OTA? (reboot, flash only a specific device, ping for information, etc)
Hey, sorry man! I'm not used to this forum, so I didn't see any notifications.sergiomarina wrote: ↑Mon Jun 27, 2022 10:17 amHi statusquo and All,
I'm doing this exercise as well. The way I'm pursuing is based on MAC addr identity. The web server, which is also a file server and a WiFi access point, stores the new exe file with the MAC address as a preamble. As per previous tip the client polls the web server supplying its MAC address in the GET request. If the MAC address matches the preamble then the web server replies with the filename to download (as an additional precaution the target MAC address is added to the filename as a preamble so the station/client can check it, too)
Both the server and the client are ESP32 devices.
I'm now stacked with the file sending. I can easily send files up to few KB, but not the size of 950KB since the client always crashes
Did you succeed in OTA file sending? Thank you!
Added on June the 30th
The crash described here above has been solved including part of the "native OTA" exercise.
Hope you solved your OTA issue.
We are currently testing the MAC address thing.
-
- Posts: 48
- Joined: Wed Feb 05, 2020 6:29 pm
Re: Is there a way to do this with OTA? (reboot, flash only a specific device, ping for information, etc)
Good to hear that. On my side the bin transfer is now ok.
So far, the solution I described works.
Since the url has a length constraint I add only the ending three bytes of the MAC address (good enough)
To limit the number of http handlers the GET messages ending portion is segmented by tokens so to achieve distinction.
Reorganizing the coding I might add a task to manage the OTA. It can be an improvement for the future
So far, the solution I described works.
Since the url has a length constraint I add only the ending three bytes of the MAC address (good enough)
To limit the number of http handlers the GET messages ending portion is segmented by tokens so to achieve distinction.
Reorganizing the coding I might add a task to manage the OTA. It can be an improvement for the future
Who is online
Users browsing this forum: No registered users and 358 guests