Skip to content

Wrong version parsed from firmware.bin #6

@dloeckx

Description

@dloeckx

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

  String checkUrl = String( ota_update_server) + String("update?dev=" HOST "&ver=" VERSION);

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'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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions