Skip to content
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

Feature request: Ability to update node firmware from provided Url #833

Open
olavt opened this issue Jul 23, 2024 · 11 comments
Open

Feature request: Ability to update node firmware from provided Url #833

olavt opened this issue Jul 23, 2024 · 11 comments

Comments

@olavt
Copy link

olavt commented Jul 23, 2024

I'm looking into the firmware upgrade functionality that was recently added and it looks like it's only possible to update the firmware through the DCL.

It would be nice to have the ability to download the firmware from a provided Url directly for testing.

@marcelveldt
Copy link
Contributor

We actually have this already but we didnt yet have time to document it. Stay tuned as it will follow soon

@olavt
Copy link
Author

olavt commented Jul 23, 2024

Great! I was just looking at the API-commands in the source code and couldn't see how one could trigger the update from a provided Url. Can you give me a hint until the docs gets there?

@marcelveldt
Copy link
Contributor

Great! I was just looking at the API-commands in the source code and couldn't see how one could trigger the update from a provided Url. Can you give me a hint until the docs gets there?

Not yet as we need to finish it. Currently the path to store manual update json files is hardcoded.

Ensure that the path /root/updates exists and place the json files in there. Here is one example of such a file.
65521-32769-2-OTA-Requestor-Example-App.json

@olavt
Copy link
Author

olavt commented Aug 2, 2024

Wouldn't it be better to put the updates directory under the data directory by default?

@olavt
Copy link
Author

olavt commented Sep 14, 2024

I see that this was released now:

#884

Where can I find any docs on how to use this new feature?

@fish12345
Copy link

fish12345 commented Sep 18, 2024

I see that this was released now:

#884

Where can I find any docs on how to use this new feature?

I would also be interested in details on how to use the local OTA feature.
A dedicated explanation for the usage in combination with Homeassistant OS (where the Matter Python Server runs in a Docker instance) would be an awesome addition.
@agners, since you implemented the feature. Could you please help providing a short "how to"?

Btw. I put a .json-file for my device under test in /root/updates/ of the docker container, but when I click "update device" in the Web UI it tells me there is no update available.
Log also doesn't really tell me where it searched for updates:

2024-09-18 10:42:19.693 (MainThread) DEBUG [matter_server.server.device_controller] <Node:7> Check for updates.
2024-09-18 10:42:19.852 (MainThread) INFO [matter_server.server.device_controller] <Node:7> There is no update information for this device on the DCL.
2024-09-18 10:42:19.855 (MainThread) INFO [matter_server.server.device_controller] <Node:7> No new update found.

@agners
Copy link
Collaborator

agners commented Sep 18, 2024

@fish12345 you need to have the json file in place when the Matter Server starts (the json files are only parsed on startup). You may need to use --ota-provider-dir to provide a custom directory which you bind mount into the container.

@olavt
Copy link
Author

olavt commented Sep 18, 2024

@agners Do you have a sample json file with the correct file::// syntax for the update directory with the corresponding --ota-provider-dir syntax?

@fish12345
Copy link

fish12345 commented Sep 18, 2024

Thanks @agners, the information that the json files are only parsed on startup was the key for me.

I copied the json file to /root/addon_configs/core_matter_server/updates/ on my Homeassistant. Turns out they already expose the ota path. After that, I started the Matter server addon.

Now the update can be started.

@olavt, I also tried to copy the firmware image next to the .json file and use "otaUrl": "file:///my_file.ota" in the .json file instead of an https URL. Regarding the rest of the content, I adapted the example mentioned in #833 (comment)
It seems to work, but transmission is still ongoing, so I don't know for sure yet.

@olavt
Copy link
Author

olavt commented Sep 18, 2024

@agners Maybe there should be an API to be able to create the json information without having to upload it to the filesystem and without having to re-start the Python Matter Server?

@marcelveldt
Copy link
Contributor

@agners Maybe there should be an API to be able to create the json information without having to upload it to the filesystem and without having to re-start the Python Matter Server?

That is out of scope for now. Feel free to PR that if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants