chiefwigms / picobrew_pico

MIT License
149 stars 63 forks source link

check in alternate firmware (2 different build branches) #363

Closed tmack8001 closed 1 year ago

tmack8001 commented 1 year ago

still no "publicly" known way to determine which binary to load to which C via UID... eye-roll-gif-16

tmack8001 commented 1 year ago

.... CI/CD ... oh how I missed you

tmack8001 commented 1 year ago

Updated the firmware selection logic to have 2 different "latest" firmwares for a PicoC device: pico_c_<version>.bin and pico_c_<version>_alt.bin. With the new MachineType that is assignable in config.yaml as PicoBrewC_Alt and selectable in the /devices.html screen with a "cautionary" toggle switch. It is now possible to switch which firmware is able to be pulled from the server if and only if you know which firmware should be pulled (if screen gets garbled up... use the known button presses documented in this project to then start up the machine to select the other firmware after changing in the server).

tmack8001 commented 1 year ago

@chiefwigms I have one thing to fix in the html template I've built. I'll let you know when this is completed.

tmack8001 commented 1 year ago
image image

alright with this last change to devices.html, devices.py and __init__.py this is good to merge.

Decided to also add a test of the configuration options to firmware selection in test_pico_api.py this way we don't regress on that functionality.

tmack8001 commented 1 year ago

The one thing to make this all work after you load the wrong firmware is to include a "needs_firmware" boolean to the PicoBrew device session model that could override the existing logic within /API/pico/checkFirmware since both of these firmwares are 0.1.34.... ~though maybe I'll accomplish that separate to this PR @chiefwigms to allow this to get in?~

Just modifying the alternate firmware value should then toggle this device.needs_firmware=True condition so should be fairly straight forward.

tmack8001 commented 1 year ago

Alright, this is completely finished now allowing a configured device to be marked as needing firmware (not explicitly, but implicitly by marking it as an alternate firmware at time of creation or post creation flipping the value of this flag).