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

Add latest release check #293

Merged
merged 17 commits into from
Feb 16, 2024
Merged

Add latest release check #293

merged 17 commits into from
Feb 16, 2024

Conversation

iranl
Copy link
Collaborator

@iranl iranl commented Feb 7, 2024

Closes #189

Checks latest github release on boot and every 24 hours.

TODO

  • Switch to using https://api.github.com/repos/technyon/nuki_hub/releases/latest
  • Checkbox to enable/disable update check (disabled by default) and publication of topics related to update check
  • Home assistant update sensor
  • Add new HA topics to removeHASSConfig()
  • Add a button to WebCfg to download the latest firmware binary
  • Add a button to WebCfg to open the latest release notes

@iranl iranl marked this pull request as draft February 7, 2024 22:20
@technyon
Copy link
Owner

technyon commented Feb 8, 2024

Hi,

thanks for looking into this.

Feel free to join us on discord

https://discord.gg/vzbQbag9

@iranl iranl changed the title [DRAFT] Add latest release check Add latest release check Feb 8, 2024
@iranl iranl marked this pull request as ready for review February 8, 2024 21:18
@iranl iranl marked this pull request as draft February 8, 2024 21:21
@iranl iranl marked this pull request as ready for review February 8, 2024 21:25
@iranl iranl marked this pull request as draft February 12, 2024 21:53
@technyon
Copy link
Owner

I see you're including a hard-coded certificate, not sure if this is a good idea. Certificates expire, this one in 2031 which is a long time, but we'll have to make sure to keep it updated. Not sure about alternatives though.

Update Network.cpp

Revert "Update over HTTPS"

This reverts commit 505e988.

Revert "Update Network.cpp"

This reverts commit f81876f.
@iranl iranl force-pushed the update-check branch 2 times, most recently from f302348 to 8559cf6 Compare February 15, 2024 21:56
@iranl
Copy link
Collaborator Author

iranl commented Feb 15, 2024

I see you're including a hard-coded certificate, not sure if this is a good idea. Certificates expire, this one in 2031 which is a long time, but we'll have to make sure to keep it updated. Not sure about alternatives though.

Would definitely not be ideal for release.

Maybe should have kept my testing in regard to truly automatic updating out of this PR, immediatly ran into CPU exceptions while testing this code.

I have removed it from the PR and will consider revisiting this functionality in the future.

Instead I added two buttons on the /ota page of WebCfg (if update checking is enabled). One that will link to the latest release URL and one that is a direct link to the binary from /webflash in master. This would for now be the quickest way to update to latest.

This PR should be ready to go now, I've tested it without issue.

@iranl iranl marked this pull request as ready for review February 15, 2024 22:12
@technyon technyon merged commit a1c2590 into technyon:master Feb 16, 2024
1 check passed
@iranl iranl deleted the update-check branch February 16, 2024 13:35
@alexdelprete
Copy link
Collaborator

This is a long-time wanted functionality. :)

In reality I asked if it was possible to OTA flash from GitHub, to avoid the manual upload of the bin.

So basically have the device download from github and flash. Would it be possible?

Thanks a lot @iranl

@iranl
Copy link
Collaborator Author

iranl commented Feb 22, 2024

This is a long-time wanted functionality. :)

In reality I asked if it was possible to OTA flash from GitHub, to avoid the manual upload of the bin.

So basically have the device download from github and flash. Would it be possible?

Thanks a lot @iranl

Flashing the binary straight from GitHub should be possible, but too complex to make it part of this PR. Will probably revisit when I'm done with open issues I can contribute to.

@alexdelprete
Copy link
Collaborator

alexdelprete commented Feb 22, 2024

I thought the upload was more complex than a GET from an URL. My bad...:)

I'm too used with Tasmota.

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

Successfully merging this pull request may close these issues.

Feature Request: Adding a link to current Releases in the UI
3 participants