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

fix: add recovery page #232

Merged
merged 1 commit into from
Jun 20, 2024
Merged

fix: add recovery page #232

merged 1 commit into from
Jun 20, 2024

Conversation

tdb3
Copy link
Contributor

@tdb3 tdb3 commented Jun 19, 2024

This PR enhances safety for www.bin updates by providing a failsafe web interface in the event of an update failure occurring in the normal AxeOS settings page. This enables a user to attempt another, or different, www.bin update without having to connect with USB.

Aims to provide at least a partial fix for Issue #213.
The recovery page is accessible at /recovery when there is a working www partition and / and /recovery when the www partition is borked.

recovery_page

Rationale/Notes:

  • Updating with esp-miner.bin is currently safer than updating with www.bin (partitions factory, ota_0, and ota_1 include failsafe mechanisms).
  • Currently, when www.bin is updated, it's all or nothing. The update either works or there is no longer a working web interface (since the sole www partition is overwritten during the update).
  • Rather than try to create multiple www partitions (space being a luxury), the approach was to implement "just enough" of a minimal interface to enable the user to recover.
  • Decided not to include esp-miner.bin uploading in the recovery page for now because if the device's factory/ota_0/ota_1 is messed up, the web HTTP server may not work at all in the first place.
  • Why include the recovery page in C rather than the AxeOS webapp? If the www partition is messed up, the web interface is unavailable. This implementation enables the recovery page to be shown even when any/all of the AxeOS webapp is broken
  • A future enhancement for updates in general would be integrity checking the update files (e.g. update files include a signature of a hash of the partition contents). This recovery page would still be compatible (since other types of issues can occur, such as power bumps during update).

Initially tested by:

mv www.bin www.bin.backup
echo "a messed up www.bin file" > www.bin

Uploaded the broken www.bin through the AxeOS settings page, then restarted.
At this point the default route presents the recovery page.

mv www.bin.backup www.bin

The valid www.bin was then uploaded, and once complete, restart button clicked.
The original AxeOS web interface is restored.

Adds a recovery web interface to enable users
to recover from a failed www.bin update.
Partial fix for Issue skot#213.
@skot
Copy link
Owner

skot commented Jun 19, 2024

Looked over the changes, tried the whole process with the messed up www.bin file and then recovering it... works very well! I support merging this in for the 2.1.9 release. @Georges760 want to take a look?

@WantClue
Copy link
Collaborator

Tested works very well.

@tdb3
Copy link
Contributor Author

tdb3 commented Jun 20, 2024

If I get time today, I might try a riskier test like purposefully interrupting a www.bin update (e.g. turn off PC WiFi) then seeing that recovery still works.

@skot
Copy link
Owner

skot commented Jun 20, 2024

If I get time today, I might try a riskier test like purposefully interrupting a www.bin update (e.g. turn off PC WiFi) then seeing that recovery still works.

I yanked bitaxe power mid-update. Recovery page came up and I was able to recover the bitaxe.. this is sweet!

@skot skot merged commit db49aa1 into skot:master Jun 20, 2024
1 check passed
tommywatson pushed a commit to tommywatson/ESP-Miner that referenced this pull request Jun 20, 2024
Adds a recovery web interface to enable users
to recover from a failed www.bin update.
Partial fix for Issue skot#213.
skot added a commit that referenced this pull request Jun 20, 2024
* Fixed fan speed web update #141

These changes fix fan rpm/percent requested and update both on the web

* fix readme

* refactor self_test to be modular for new hardware

* Supra 402 (#221)

* port TCH Supra 402 branch

* refactor TMP1075 (unused?) driver using i2c_master module

* pulled in @BitMaker-hub stratum_task.c DNS changes from PR #185

* removing serial debug

---------

Co-authored-by: Skot <[email protected]>

* adjust share accpeted/rejected functions to take higher level GLOBAL_STATE to fix share accounting.

* Code clean resulting from looking into #218 (#220)

* Code clean resulting from looking into #218

* Fixed asic count

Set canary value for invalid device's asic_count

---------

Co-authored-by: tommy <[email protected]>

* fix another pointer error

* Changes efficiency metric display in AxeOS (#231)

Fixes #230

* try to explain nonce space duration from paramters (#228)

* try to explain nonce space duration from paramters

* Fix Nonce Space duration for BM1397 (no version-rolling)

* fixed issue with version mask on 1397. added easy serial debugging on 1397

* cleanup jobID debugs

---------

Co-authored-by: Skot <[email protected]>

* Update bm1397.c to increase the max frequency to 650Mhz (#209)

* Update bm1397.c to increase the max frequency to 650Mhz

The original version was setting everything above 500Mhz to 500Mhz, the update increases the limit to 650Mhz.
No changes to the web interface - drop-down still shows up to 575Mhz

* Update edit.component.ts to include higher freqeuncy for BM1397

* Updated BM1397 frequencies to above 500Mhz

* Update bm1397.c

* Update bm1397.c

* UN-Update readme.md

* Update bm1397.c

* Update bm1397.c

* Update bm1397.c

* fix: add recovery page (#232)

Adds a recovery web interface to enable users
to recover from a failed www.bin update.
Partial fix for Issue #213.

* refactor: unify merge_bin scripts (#189)

Combines the functionality of merge_bin_update.sh
and merge_bin_with_config.sh into merge_bin.sh.
Also adds more verbose usage printing.

* fix: check www.bin size before updating (#216)

Adds a basic sanity check for www.bin uploading.
Returns 400 if upload is attempted on a file larger
than the available partition space.

---------

Co-authored-by: tommy <[email protected]>
Co-authored-by: Georges Palauqui <[email protected]>
Co-authored-by: Skot <[email protected]>
Co-authored-by: Nathan Day <[email protected]>
Co-authored-by: yanir99 <[email protected]>
Co-authored-by: tdb3 <[email protected]>
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.

3 participants