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

Firmware Upgrade From URL #300

Closed
3 tasks done
nagyrobi opened this issue Feb 2, 2022 · 8 comments
Closed
3 tasks done

Firmware Upgrade From URL #300

nagyrobi opened this issue Feb 2, 2022 · 8 comments
Assignees
Labels
done The underlying issue has been fixed enhancement New feature or request
Milestone

Comments

@nagyrobi
Copy link
Collaborator

nagyrobi commented Feb 2, 2022

Perform all steps below and tick them with [x]

  • Check the related part of the Documentation
  • Update openHASP to the latest version
  • Reproduce the issue and describe all steps

Describe the bug

In the firmware upgrade web interface, updatding from URL is not working. Updating using the browser's upload form works fine.

To Reproduce

Put the OTA binary to a web server accessible via plain HTTP. Eg:
http://building.rig.local/code/openhasp/openHASP/build_output/firmware/lanbon_l8_ota_v0.6.3-dev.bin
Verify that downloading of the file from the URL is working fine using a PC.

Open a Telnet session to the plate.
Copy the URL in openHASP's From URL form field and press Update from URL button.
The web interface will show

Updating ESP firmware from: http://building.rig.local/code/openhasp/openHASP/build_output/firmware/lanbon_l8_ota_v0.6.3-dev.bin

After a while the page will return to root.

Telnet will show:

[10:44:41.533][65524/89868 27][19536/19944  3] HTTP: Sent /firmware page to 192.x x x
[10:44:50.278][65524/89660 26][19336/19940  4] HTTP: Sent /espfirmware page to 192.x x x
[10:44:50.312][65524/88212 25][19336/19940  4] HTTP: Updating ESP firmware from:
[10:45:05.515][65524/89868 27][19336/19940  4] HTTP: Sent / page to 192.x x x

Expected behavior

It should update from URL.
Also it should "remember" the URL between the updates so that just replacing the binary on the server should be enough before pressing the Update from URL button (no need to paste it every time).

Screenshots or video

N/A

@nagyrobi nagyrobi added the bug Something isn't working label Feb 2, 2022
fvanroie added a commit that referenced this issue Feb 15, 2022
@fvanroie fvanroie added enhancement New feature or request and removed bug Something isn't working labels Feb 15, 2022
@fvanroie fvanroie self-assigned this Apr 28, 2022
@fvanroie fvanroie added this to the 0.6.x milestone Apr 28, 2022
fvanroie pushed a commit that referenced this issue Apr 28, 2022
fvanroie pushed a commit that referenced this issue Apr 28, 2022
fvanroie pushed a commit that referenced this issue May 4, 2022
@fvanroie
Copy link
Collaborator

fvanroie commented May 5, 2022

Update from URL is enabled again in 0.6.3-dev.

The 0.6.2 release contains a bug that requires you to power-cycle the plate instead of the "normal" reboot. 0.6.2 actually doesn't enable the new firmware until after a power-cycle 😞

This should be fixed now in 0.6.3-dev, so updating to a newer 0.6.3 code-base can be done via Web upload, Web URL or Arduino OTA without power-cycle.

@fvanroie fvanroie added the wip Work in Progress label May 5, 2022
@nagyrobi
Copy link
Collaborator Author

nagyrobi commented May 5, 2022

Tested, works.
Only that after reboot the web interface tries to reconnect too early and displays a connection error message.

@fvanroie
Copy link
Collaborator

fvanroie commented May 6, 2022

It's a fixed time-out that goes back to the home page. The download, update and reboot process takes a variable time, so it's hard to guesstimate how long it will take. To prevent this, you would need to do active javascript polling...

@nagyrobi
Copy link
Collaborator Author

nagyrobi commented May 6, 2022

Just add +3 seconds...

@fvanroie
Copy link
Collaborator

fvanroie commented May 6, 2022

done, but I guess it should save the last update URL used to NVS and use that as the default next time...

@fvanroie fvanroie added done The underlying issue has been fixed and removed wip Work in Progress labels May 6, 2022
@fvanroie
Copy link
Collaborator

fvanroie commented May 7, 2022

Last URL is now saved. There is now also the option to follow redirects or not, this allows direct downloads from e.g. Github urls that redirect to a CDN for downloading of the actual file.

@fvanroie
Copy link
Collaborator

The feature is now part of 0.6.3-rc1

@nagyrobi
Copy link
Collaborator Author

In 0.6.4-dev 7f4e079 it's broken, OTA from URL is impossible to complete. Bar goes to the end on the screen but the plate doesn't reboot, instead the web interface jumps back to main menu. Rebooting from there doesn't result in booting from the new firmware image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done The underlying issue has been fixed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants