mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1435] Firmware update progress callback #1227
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1227
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sladerix on GitHub (Jun 19, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1435
Hi everyone, I'm using this library for the "Update Firmware" function. Very useful.
However I was wondering if there is a way to get the update progress with some callback or something..
I see in the serial monitor that while updating, the library, prints a lot of dots "." so I imagine that could be possible to have a callback for the progress of it.
is it something already implemented or should I edit the library myself?
Thanks in advance
@tablatronix commented on GitHub (Jun 19, 2022):
You can add your own arduinoota callbacks in your code also I think there is one wm callback at least
@Sladerix commented on GitHub (Jun 19, 2022):
Ouh ok. Where can I find the full documentation about this?
@tablatronix commented on GitHub (Jun 19, 2022):
The Arduinoota example sketch or esp examples
@Sladerix commented on GitHub (Jun 20, 2022):
Ok thanks, I found some examples in File > Examples > ArduinoOTA and File > Examples > Update
But I wish to keep using the WiFiManager Library at the moment. I will take a look in the source files
@Sladerix commented on GitHub (Jun 20, 2022):
In the source file I didn't found pretty much, apart for the setPreOtaUpdateCallback accessibile method.
And the handleUpdating function that is private... but the only things it does is to write the bytes with the Update object I think (and other checks).
also there is this comment:
... // add progress handler for debugging ...@tablatronix commented on GitHub (Jun 20, 2022):
you should be able to use them both
@Sladerix commented on GitHub (Jun 20, 2022):
Uhm I didn't understand how to use both given the fact that the "autoConnect" is blocking.
However I tried like so (do not work, only prints dots while updating):
if I try to uncomment
ArduinoOTA.begin();it goes in crash loop@tablatronix commented on GitHub (Jun 21, 2022):
Sorry I wasnt thinking, let me see what I can add
@tablatronix commented on GitHub (Jun 21, 2022):
Sorry i meant Update ( we are using httpupload not arduinoota oops
add a callback for Update library inside a wm ota callback
@Sladerix commented on GitHub (Jun 21, 2022):
OK.
Now it works as expected!
Thanks very much!!!
Full code example for future people
@Sladerix commented on GitHub (Jun 21, 2022):
Do you think it's possibile to send BLE data in that callback?
Because I did something like:
But only the Serial.printf is executed..
it's a WiFi + BLE limitation?
@tablatronix commented on GitHub (Jun 21, 2022):
I think you are pretty limited during ota updates, you can declare this function so its not anonymous and try that.
But I think interrupts are stopped during ota.
I have never tried it or seen an example, I usually avoid even updating displays or neopixels.
The httpupdate ota can maybe be run async and with loop, but I think there are issues and i have not gotten the async branch httpupdate working either...
feel free to open a new issue about this specifically, and ill look around for any pre written code or check the esp repo issues.
If you know another lib that does this well for reference that would be good also.
@Sladerix commented on GitHub (Jun 21, 2022):
Actually I ended by showing the progress on an LCD, instead of sending it over BLE, and it worked. So for what I’ve to do I’m happy like that.
_(small note: both in the serial monitor and on LCD the percentage do not go to 100% but stops about 77% and then the esp32 restarts.
The flashing goes ok because it works then.
I think this is related to the “asynchronous-ness” of the update process (?) that can’t fire the callback all the way to the end because the update actually finishes before it can call the “onProgress” the last few times?
Just curious, not an important thing)_
@ha11otronix commented on GitHub (Mar 29, 2024):
Is it possible to show the same Progress on browser itself instead of Serial printing? I may not have access to Serial while doing OTA then showing it on browser helps.
@tablatronix commented on GitHub (Mar 30, 2024):
I tried that and ota is receiving data via webserver+wifi and its not really possibly to reliablly send data during this, I find that if ota misses even 200ms it can fail.
If you ever find any implementation that has done this and it works let me know