-
-
Notifications
You must be signed in to change notification settings - Fork 978
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
Update via fwupd #1322
Comments
This is an idea I have in the back of my mind for a while, but I have not yet taken the time to learn how fwupd works and what it would take to add support for the pinetime. |
@JF002 I do have the experience with fwupd etc. In general you need:
There's a BlueZ BLE test and backend in fwupd, but no plugins yet that actually make use of it. |
Hi @DylanVanAssche ! You worked on the support for the Pinephone modem in fwupd, right? Amazing work! I don't think the BLE spec defines any standard protocol for OTA. InfiniTime implements the DFU (legacy) protocol (here and here). InfiniTime exposes the version of the firmware via the DeviceInformation Service. The protocol has already been implemented in multiple companion apps (Siglo, ITD, Amazfish, Gadgetbridge,..), and in multiples languages (C, Python, Go,..). These implementation could be use as examples for the plugin in fwupd. In which languages should those plugins be written? |
Yes :) I also work on Tow-Boot support and for Android devices as well :)
DFU? There's already a plugin for that! https://github.com/fwupd/fwupd/tree/main/plugins/dfu
The plugin will need to subclass probably the DFU plugin, add a method to get that info from the watch to make fwupd aware of the watch, disable upgrades when battery power is low, expose version information.
Exactly! But it is pretty well documented it seems, awesome! |
That is USB Device Firmware Update. InfiniTime provides Nordic Semiconductor's OTA DFU (legacy) service. I think this sounds relatively out of scope for fwupd and we do have at least four implementations that should work on desktop Linux. I'm closing this for now as it does not sound like a thing InfiniTime (or its team) will take on any time soon. |
Just my 2 cents :)
Well, this kind of stuff is what fwupd does... It focus on firmware updates for internal devices but also devices connected over USB or Bluetooth. Having a fwupd plugin will make firmware updates work out-of-the-box on any Linux distro, without having to install any app. This would also allow to remove all update implementations from the apps so they can focus on what they do well: notifications, step counter, heartbeat, etc. Moreover, users have more trust into updates as Infinitime devs only have the power to upload releases to the LVFS (repo of firmware used by fwupd). Example: UPower already displays the Infinitime battery level in GNOME Settings for example. UPower handles all kinds of batteries, fwupd handles all kinds of firmware upgrades on Linux.
If Infinitime devs want to generate CAB files (archives with the firmware binary to flash and some metainfo), it should be doable to have a plugin in fwupd. Building the firmware etc. is not something I am familiar with, but I can help with the other stuff (CAB files, plugin, etc.). |
Someone would have to focus on implementing Nordic's protocol and its maintenance.
Same with GitHub's releases, really.
There are prebuilt binaries on the release page, as a PoC those could be used. |
To the point of view of InfiniTime, fwupd is "just another companion app". But in my opinion, fwupd is a great tool that helps with upgrading firmware of many devices, and I think adding the support for the PineTime and InfiniTime would be a great addition for both projects and the end users. @DylanVanAssche Would you like to take up the challenge? What's currently missing in InfiniTime to make it possible? Do you have any info about the CAB file format? Is this something we could easily generate at build time together with other build artifacts (firmware image, DFU, resources,...) ? |
Well, support for fwupd needs some kind of support from Infinitime people to package the release as a CAB file and upload it to LVFS as LVFS wants 'vendors' to upload the firmware themselves (preferably). postmarketOS has now an OEM account which can assist with all of this, I'm part of the postmarketOS account as well
I cannot make any promises on this, but it should be doable since the upgrade process is nicely documented. I have the experience to make such plugins and I may have been experimenting already a bit ;) I'm wondering though how updates to bootloaders, etc. are handled instead of Infinitime itself. In the last releases I only downloaded a ZIP, opened it with Gadgetbridge and flashed it. However, that one does not have bootloaders I think? In the early releases I saw that bootloaders, etc. are separate firmwares to flash? My question: Can we bundle this in 1 ZIP to flash and do it all at once before rebooting or do these things really need to flashed separately with each time a reboot? |
Yes, that seems quite reasonable, and that's probably something we can add to our release workflow!
Firmware update and bootloader update are effectively 2 differents things.
Starting from InfiniTime 1.11 (next release), we'll introduce the external resources : image and fonts stored in the SPI flash of the PineTime. Resources are packaged into a separate file and must be flashed separately from the firmware. Companion apps can update both in a row without any user interaction. I'll re-open this issue to track the work done on this topic and to discuss how the firmware should be packaged and deployed for fwupd. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@lman0 Let's try to keep this discussion focused on fwupd. Please ask this question on this post. |
Verification
Pitch us your idea!
companion apps (for Linux) don't need to all implement the update mechanism
Description
Many users probably already have fwupd installed and update firmware for their computer with it. The modem on the Pinephone for example can be updated with it. It would be nice if I could update all firmware from a central place. Companion apps on Linux could get rid of the code to update the Pinetime. The releases would be hosted on LVS and there are additional checks that fwupd does such as disable firmware versions if the install failed for too many users or ensuring the device is not running only on battery. Additionally there are UIs for it already.
The text was updated successfully, but these errors were encountered: