feat(bengle): add A013 integrated-scale telemetry - #601
Merged
Conversation
Decode Bengle's dedicated shot packet, expose its integrated weight and firmware gravimetric flow through existing machine and scale surfaces, and wire the current tare and end-of-shot MMRs without changing plain DE1 telemetry.
ODevStudio
marked this pull request as ready for review
August 11, 2026 19:02
…actions Revise PR #601 in place: - MachineSnapshot stays pure machine telemetry (weight/weightFlow/milkTemperature removed; steamTemperature retained). - MilkTemp from A013 drives Bengle probeAttached/probeTemperature via an independent subscription; BengleProbeBridge registers BengleMilkProbe as before. - Wire real TargetMilkTemp MMR (0x008038A8, x10, 0-85C, 0=disabled); remove Awaiting-FW stub. - SteamSequencer tracks actual Bengle probe state for firmware-autonomous stop; third-party sensors keep the app-side path. - ScaleController always feeds the control estimator; display weightFlow uses device flow when provided, settle-zero applies only to app-derived flow. - Revert unrelated CRLF test change; update API specs and docs for the fan-out.
- EndOfShotWeight declared range 0..10000 g at x100 (raw max 1,000,000); setStopAtWeightTarget clamps to 10000. - MockBengle SAW clamp 0..10000 g, stop-at-temperature clamp 0..85 C to match real Bengle. - Pin ranges in bengle_saw_test, mock_bengle_test, mock_bengle_steam_probe_test. - Docs/PR wording: A013 is consumed as the Bengle transport telemetry source.
tadelv
approved these changes
Aug 12, 2026
tadelv
added a commit
that referenced
this pull request
Aug 12, 2026
…actions Revise PR #601 in place: - MachineSnapshot stays pure machine telemetry (weight/weightFlow/milkTemperature removed; steamTemperature retained). - MilkTemp from A013 drives Bengle probeAttached/probeTemperature via an independent subscription; BengleProbeBridge registers BengleMilkProbe as before. - Wire real TargetMilkTemp MMR (0x008038A8, x10, 0-85C, 0=disabled); remove Awaiting-FW stub. - SteamSequencer tracks actual Bengle probe state for firmware-autonomous stop; third-party sensors keep the app-side path. - ScaleController always feeds the control estimator; display weightFlow uses device flow when provided, settle-zero applies only to app-derived flow. - Revert unrelated CRLF test change; update API specs and docs for the fan-out.
Closed
36 tasks
This was referenced Aug 12, 2026
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
0xA013shot packet, so current integrated weight, firmwareGFlow, and milk-probe data were unavailable.0xA013is consumed as the Bengle transport telemetry source and fanned out into Decaid's existing abstractions — machine fields feed the normalMachineSnapshotstream, Weight/GFlow feed the integrated scale surface (weightFlowis device-provided), andMilkTempdrives the existing Bengle milk-probeSensor(probeAttached/probeTemperature), which appears through the normal/ws/v1/sensors/<id>/snapshotAPI.TargetMilkTempMMR (stop-at-temperature) and fixedSteamSequencerso firmware-autonomous stop fires only when the Bengle internal probe is actually attached; a Bengle with only a third-party sensor keeps the app-side stop path.0xA00D; no inherited USB, discovery, UI, MTU, calibration, or unrelated Bengle work was added.Firmware Source of Truth
Bengle constants, packet layout, and MMR behavior in this PR were verified directly against the
tadelv/Benglefirmware source (fork ofrheasman/Bengle).2377c7e0e48e9ee2c43cf02ad2f82028252f56e8(tadelv/Bengle master, fetched during implementation).T_BengleShotSamplelayout inBengleMynewtBLE/src/APIDataTypes.hpp(28 bytes, offsets/scaling incl.MilkTempU16D2 with 0 = no probe);EndOfShotWeight0x00803864×100 RWD andScaleTare0x0080388Cwrite-trigger inBengleMainCPUFirmware/src/Classes/Data/MMR.def;TargetMilkTemp0x008038A8×10 RWD, range 0..85, 0 = disabled, consumed by the steam state machine inShotMachine.cpp.MemMap.cregistersS/A013as the 19th characteristic while its comments still say 18, andBengleMynewtBLE/MemMap.defomitsS.Change Type (select all)
Scope (select all touched areas)
Linked Issues
Root Cause (if bug fix)
N/A (feature).
Regression Test Plan (if bug fix or refactor)
simulate=1+ curl/websocat)bengle_telemetry_test.dart,bengle_steam_stop_test.dart,bengle_saw_test.dart,scale_controller_test.dart,steam_sequencer_test.dart,serial_parity_test.dartA013frame fans out to machine + integrated-scale + probe surfaces (machine snapshot carries no weight/GFlow/milk-temp); device flow passes through display while control flow stays estimator-derived; tare writes the real MMR and telemetry continues; stop-at-weight/stop-at-temperature write the real registers with ×100/×10 scaling; Bengle-internal-probe vs third-party-sensor select firmware vs app-side stop; plain DE1 stays onA00D.Documentation Obligations (required)
assets/api/rest_v1.ymlorassets/api/websocket_v1.yml(if REST/WebSocket changed)doc/Api.md(if user-facing endpoint changed)doc/Plugins.md(if events/API changed)doc/Skins.md(if skin behavior changed)doc/Profiles.md(if profile handling changed)doc/DeviceManagement.md(if device flows changed)Security Impact (required)
Yes/No) No.Yes/No) No.Yes/No) No.Yes/No) Yes.Yes/No) No.Yes/No) No.Yes, explain risk and mitigation: only a model-confirmed Bengle subscribes toA013/serialS; short frames are rejected, all constants were checked against current firmware, and a plain-DE1 regression test locks the existing path.User-Visible Changes
0xA013is consumed as the Bengle transport telemetry source and routed into Decaid's existing machine, scale and sensor abstractions: machine telemetry (including the existingsteamTemperature) on/ws/v1/machine/snapshot, integrated weight + firmware GFlow on the normal scale surface, and the internal milk probe as a normal sensor on/ws/v1/sensors/<id>/snapshot. Stop-at-temperature and stop-at-weight now drive real firmware registers (TargetMilkTemp,EndOfShotWeight).Verification
Local gates (run before pushing)
dart format lib test- 694 files, 0 changedflutter analyze- no issuesflutter test- 2,899 passed; 7 pre-existing failures in plugin JS-sandbox (plugin_manager_permissions_test.dart) and webui token tests (webui_token_injection_test.dart), reproduced identically onmainand unrelated to this PR./scripts/fetch_dye2_plugin.sh- not re-run in this revisionManual verification (if applicable)
simulate=1): No.tadelv/Bengle@2377c7e0), focused fake-transport machine/scale/probe integration, serial command order, MMR write bytes (address + ×10/×100 scaling), reconnect behavior, plain-DE1 isolation, and full repository tests.simulate=1REST/WebSocket session.Evidence
Compatibility & Migration
Yes/No) Yes; the machine snapshot loses the temporary nullable weight/weightFlow/milkTemperature fields added by the draft (they were never onmain), and plain DE1 behavior is unchanged.Yes/No) No.Yes/No) No.NoorYes, explain exact steps: No migration or configuration steps.Risks & Mitigations
tadelv/Benglemaster2377c7e0; the compact golden decoder and transport tests pin observable behavior.