-
Notifications
You must be signed in to change notification settings - Fork 363
feat!: OTA refactor #1612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: OTA refactor #1612
Conversation
|
I'm not able to currently test this with real devices (no OTA bench setup)... @andrei-lazarov might you be able to test a few OTA scenario, confirm the logic works, and also covers what's needed from the point of view of custom firmware providers? Frontend support for the new stuff isn't done yet, will have to use MQTT requests for now. git clone --depth 1 -b ota-refactor https://github.com/Koenkk/zigbee2mqtt
git clone --depth 1 -b ota-refactor https://github.com/Koenkk/zigbee-herdsman
cd zigbee-herdsman
pnpm i --frozen-lockfile
pnpm run prepack
cd ../zigbee2mqtt
pnpm i --frozen-lockfile
pnpm link ../zigbee-herdsman
pnpm run prepackNote: make sure you see the link in the console logs at step If you see any behavior that current CI tests are not covering, let me know. |
|
I quickly tested an OTA without index: The initial time estimate was wrong. At the end it automatically interviewed, but didn't reconfigure. ProgressThis is quite a lot for me to digest, but I can test more scenarios |
|
It worked! That's always a good start 😁 cd zigbee-herdsman
git pull
pnpm run prepackYou should be able to use the
For You should also be able to override the various configs per OTA update call: They will take precedence over the Z2M defaults, and your As for |
|
@Koenkk do you want to do a final review of all 4 PRs, and start merging this? I think I've covered pretty much all, just docs remaining. Sidenote: we should put a small notice in whatever release this gets into, that the logging regarding OTA has changed substantially (just in case anyone used it for some kind of integration, or had filtered some stuff which could make it appear/disappear now). |
I would propose to merge it, it's not critical and allows to get feedback 1 month earlier. So ready to go, really nice work! ❤️ Feel free to take out of draft and slam merge buttons. |
Design changes
AsyncGeneratorto handle block/page/end requestscheckfunction insideupdatefor consistency (no duplicate logic)checkandupdatereturn types have changed to adapt to new featurescheckis called withoutqueryNextImageRequestpayload (undefined), automatically notify the device to trigger it then replyNO_IMAGE_AVAILABLE(fallback to prevent device from requesting again)updateis called withoutqueryNextImageRequestpayload (undefined), automatically notify the device to trigger it, then reply as appropriate based on image availability (which will make the device start OTA update or not).updatewhile one is runningEndpoint.waitForCommandAPI that was solely intended for OTA use, now handled internallyLogic changes & co can be derived from list of below tests.
CI Tests
CC: if you want to review this @andrei-lazarov @sjorge @burmistrzak 😉