Add MIDI SysEx firmware upgrade for v1.0.0+ devices - #20
Merged
Conversation
Devices on v1.0.0 and later support streaming a UF2 image over SysEx to the inactive A/B partition (Begin/Bytes/End/Abort, tags 0x20-0x23, as in drumtool.js flash). Add an upgrade dialog that mirrors the legacy flow: it auto-opens when a connected non-legacy device reports firmware older than the bundled release, downloads the UF2, streams it with per-chunk ACK/NAK handshaking and a progress bar, then auto-dismisses once the device reboots and reconnects with the new version. The firmware is bundled at build time: a prebuild script fetches the latest GitHub release UF2 into static/firmware/ and records it in a manifest, because GitHub's release-asset CDN sends no CORS headers and the browser cannot fetch the bytes directly. This replaces the runtime githubReleaseService; the app now works offline and never advertises a version it cannot deliver. Hidden behind the sysexFirmwareUpgrade feature flag; the flow can be forced open on any device via datoFeatures.showFirmwareUpgrade().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FirmwareUpgradedialog mirrors the legacy flow: auto-opens when a connected non-legacy device reports firmware older than the bundled release, shows download/upload progress, and auto-dismisses once the device reboots and reconnects with the new version.prebuildscript (scripts/fetch-latest-firmware.mjs) downloads the latest release UF2 intostatic/firmware/and writesfirmwareManifest.json. GitHub's release-asset CDN sends no CORS headers, so the browser cannot fetch the bytes cross-origin; serving same-origin fixes both this flow and makes the app usable offline. Replaces the runtimegithubReleaseService.sysexFirmwareUpgradefeature flag (default off).Notes
docker build). If GitHub is unreachable at build time, the script falls back to the committed UF2 with a warning.Test plan
datoFeatures.enable('sysexFirmwareUpgrade'), connect a v1.0.0+ DRUM on older firmware → prompt appears, upgrade streams with progress, dialog closes after rebootdatoFeatures.showFirmwareUpgrade()on an up-to-date device → forced flow flashes and auto-dismisses after reconnectnpm run build(including prebuild fetch) andnpm run checkpass