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

OTA Upload: Show progressbar #1748

Closed
caco3 opened this issue Jan 2, 2023 · 13 comments
Closed

OTA Upload: Show progressbar #1748

caco3 opened this issue Jan 2, 2023 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@caco3
Copy link
Collaborator

caco3 commented Jan 2, 2023

Issue

See:

@caco3 caco3 self-assigned this Jan 2, 2023
@caco3 caco3 added the enhancement New feature or request label Jan 2, 2023
@caco3
Copy link
Collaborator Author

caco3 commented Jan 3, 2023

@jomjol @haverland @Slider0007

I created a new OTA page which shows a progressbar during uploading.

Could you test it before we release it into the wild?

Keep in mind that you first have to install it and only then can test it with the next OTA!

https://github.com/jomjol/AI-on-the-edge-device/actions/workflows/build.yaml?query=branch%3Anew-ota-page

@caco3
Copy link
Collaborator Author

caco3 commented Jan 3, 2023

@jomjol When I test it with a firmware.bin it sporadically fails because it hangs after:

I (53147) OTA FILE: File reception complete
I (53257) OTA FILE: Found file: firmware.bin (1703472 bytes)
I (53317) OTA: Starting OTA update
I (53327) OTA: Running partition type 0 subtype 16 (offset 0x00010000)
I (53327) OTA: Writing to partition subtype 17 at offset 0x1f0000

This only seems to happen in the legacy mode where we do not reboot before the flashing.
Would it make sense to also replace this with a flashing after a reboot?

@Slider0007
Copy link
Collaborator

Slider0007 commented Jan 4, 2023

Could you test it before we release it into the wild?

@caco3 : The progress bar looks really good, is more informative and update executed without any issue.
Some remarks:

  • What in my opinion is a bit unusual is the fact that the upgrade starts immediately just by selecting the file. I would prefer to acitivly trigger such a critical task by pressing a button. This also gives me the chance to revert my maybe wrong file selection.
  • When I select a file with e.g. spaces the overlay gets flashed and reminds me but the ota page gets stuck. I have to reload the page. Before I was able to select another file and continue without reloading the page.
  • When I select an non suitable file (e.g..txt) the file gets processed and it's mentioned that upgrade is in progress (Upload completed, the firmware gets installed now... and progress bar is running)
    BTW: Is it possible to limit file selection dialog to only relevant files (.bin, .zip, .tflite, ...)?

Let's see what's the feedback of the others.

When I test it with a firmware.bin it sporadically fails because it hangs after:

Interesting, I use this flash method quite often but I've never had this issue before.

@jomjol
Copy link
Owner

jomjol commented Jan 4, 2023

This only seems to happen in the legacy mode where we do not reboot before the flashing.
Would it make sense to also replace this with a flashing after a reboot?

You are right and I have harmonized the update after reboot for firmware.bin in the newest rolling, as well
(flash firmware after reboot and then do a reboot by itself).

@jomjol
Copy link
Owner

jomjol commented Jan 4, 2023

Additionally I find this really cool, but I agree to @Slider0007: addtional button to start after selecting file

@caco3
Copy link
Collaborator Author

caco3 commented Jan 4, 2023

thanks for your feedbacks!
I am working on those findings.

@caco3
Copy link
Collaborator Author

caco3 commented Jan 4, 2023

@Slider0007 Please have another try.

  • The 2nd stage button is back
  • I added now validation for file name matches.
  • If it does not match but still is a .zip/.bin/.tfl/.tflite, I show a warning but accept it.
  • if it is another file extention, I deny it.
  • whitespaces are denied

@Slider0007
Copy link
Collaborator

@caco3 : Whow, that was quick :-)

I tested it again. Some comments:

  • Handling with 2nd stage button is perfect!
  • File validation doesn't accept
    • filenames with dash --> e.g. AI-on-the-edge-device__update__new-ota-page_(399c398).zip
      --> Maybe it's sufficient to check only AI-on-the-edge-device__update
    • firmware.bin
      --> Maybe, just accept all *.bin or add firmware.bin
  • Maybe it's straight forward to limit file selector by showing only valid ones using the accept attrbute?
    --> <input type="file" name="file_selector" id="file_selector" accept=".bin,.zip,.tfl,.tflite" onchange="validate_file()">
  • Uploading a tflite/tfl file --> Upload sucessful, but progress bar keeps running

Side note / keep in mind: Filename of actual release 13.0.8 (and earlier releases) also doesn't meet new file pattern.

Personal side note: I like the new page. The MB counter is quite helpful, escpecially when WIFI reception is quite bad to check if it's even loading...

@caco3
Copy link
Collaborator Author

caco3 commented Jan 5, 2023

Thanks for the feedback!

File validation doesn't accept
filenames with dash --> e.g. AI-on-the-edge-device__update__new-ota-page_(399c398).zip
--> Maybe it's sufficient to check only AI-on-the-edge-device__update

I use regex and missed the -

  firmware.bin
  --> Maybe, just accept all *.bin or add firmware.bin

That's already possible (with the warning)

Maybe it's straight forward to limit file selector by showing only valid ones using the accept attrbute?
-->

Ah nice, I didn't know that.

Uploading a tflite/tfl file --> Upload sucessful, but progress bar keeps running

that's handled now as well; I check the update task response which tells me if a restart is needed

Side note / keep in mind: Filename of actual release 13.0.8 (and earlier releases) also doesn't meet new file pattern.

Yes, that's why I only show a warning.

Personal side note: I like the new page. The MB counter is quite helpful, escpecially when WIFI reception is quite bad to check if it's even loading...

❤️

Also I added now a progressbar for the installation (simply counts up).
And it shows an error if it is not up after 300s

@Slider0007
Copy link
Collaborator

@caco3 : Perfect, everything looks good!

@caco3
Copy link
Collaborator Author

caco3 commented Jan 7, 2023

thank!

@caco3 caco3 closed this as completed Jan 7, 2023
@Slider0007
Copy link
Collaborator

@caco3: Filenames with capital letter included are not valid ones. Does this have a reason or just missing in pattern checker?

@caco3
Copy link
Collaborator Author

caco3 commented Jan 19, 2023

it was simply lazyness 😺

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

No branches or pull requests

3 participants