I really love the approach and code, thank you very much!
Unfortunately, the server recognised the wrong version number for me. Early in the binary, there is the following text: esp32-arduino-lib-builder 00:39:13 Feb 21 2021 v3.3.4-432-g7a85334d8 . server.py recognised this version number, instead of the one from my project.
To make the search more robust, I suggest to change the code in checkForUpdates to
This will ensure that the binary contains (for HOST PoolWeather and VERSION v0.0.2) exactly the following text: update?dev=PoolWeather&ver=v0.0.2, followed by 0x00 to terminate the string. The regex can then be adjusted to m = re.search(b"update\?dev=" + __dev.encode('UTF-8') + b"&ver=(v\d+\.\d+\.\d+)\x00", data, re.IGNORECASE).
Note that also update should be dropped from the urlBase.
Also note that after this update older binaries will no longer be recognised during upload.
I really love the approach and code, thank you very much!
Unfortunately, the server recognised the wrong version number for me. Early in the binary, there is the following text:
esp32-arduino-lib-builder 00:39:13 Feb 21 2021 v3.3.4-432-g7a85334d8
.server.py
recognised this version number, instead of the one from my project.To make the search more robust, I suggest to change the code in
checkForUpdates
toThis will ensure that the binary contains (for HOST
PoolWeather
and VERSIONv0.0.2
) exactly the following text:update?dev=PoolWeather&ver=v0.0.2
, followed by 0x00 to terminate the string. The regex can then be adjusted tom = re.search(b"update\?dev=" + __dev.encode('UTF-8') + b"&ver=(v\d+\.\d+\.\d+)\x00", data, re.IGNORECASE)
.Note that also
update
should be dropped from theurlBase
.Also note that after this update older binaries will no longer be recognised during upload.
I've created a fork with these updates, see https://github.com/dloeckx/esp-update-server
PS: I am using platform.io , not sure if this matters.