Repository navigation
feat(bridge): two-way DSO150 bridge and app-side send - #3
Merged
Merged
Conversation
amd989
force-pushed
the
claude/dso150-bridge-39bdfd
branch
from
November 16, 2026 12:49
df65c8e to
b7cf1e4
Compare
The ESP32 bridge (renamed firmware/readout-bridge) now picks its chip at build time: FS9721 (unchanged: receive-only, 2400 baud, deep sleep) and DSO150 (two-way UART at 115200 8N1, direct 3.3 V wiring, never sleeps). Envs per chip and board: fs9721-esp32dev(-vdd), fs9721-esp32c3(-vdd), dso150-esp32dev, dso150-esp32c3. - New RX characteristic (write, write without response) whose bytes go out the UART unchanged; info reports chip and baud; advertises as "Readout DSO150 XXXX" with the same advertising layout. - MTU 247, notifications sized to the negotiated MTU less 3, flushed on a full chunk or a short gap; retries on NimBLE ENOMEM, 4 KB UART buffer and a 15-30 ms connection interval for waveform throughput. - Core: MeterModel.Dso150, MeterCapabilities.Dso150, a placeholder Dso150Driver (no readings yet), and explicit driver and capability switches so no model falls through to the 121GW's. - IMeterConnection.SendAsync (and MeterSession.SendAsync) writes to a bridge's RX characteristic: Plugin.BLE, BlueZ and the simulated meter. - Bridges get MTU 247 after connecting (logged); DSO150 notifications are logged as text until its driver decodes them. - Bridge README: DSO150 wiring and power, a milestone-0 hardware test, throughput notes and the open SYST:BAUD vs fixed 921600 decision. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
amd989
force-pushed
the
claude/dso150-bridge-39bdfd
branch
from
November 18, 2026 12:05
b7cf1e4 to
c91be4c
Compare
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
Phase 2 of the DSO150 plan (DSOShell's
docs/READOUT.md): the ESP32 bridge becomes two-way and gets a DSO150 profile, and the app gets a generic way to send bytes to a bridge. The bridge stays a dumb byte pipe; all protocol knowledge stays in Readout.Core and the DSOShell firmware.Bridge firmware
firmware/fs9721-bridgeis renamed tofirmware/readout-bridge, with the chip picked at build time:fs9721-esp32dev,fs9721-esp32dev-vdd,fs9721-esp32c3,fs9721-esp32c3-vdd.dso150-esp32dev(RX 16, TX 17) anddso150-esp32c3(RX 20, TX 21).3065c3ca-b78a-4b98-96b6-280cf0784ec4(write and write without response, DSO150 builds only): bytes written to it go straight out the UART.chip=,baud=,firmware=(plussymbols=for the FS9721). Advertises asReadout DSO150 XXXX, keeping the layout from f34c649 (name in the advertisement, 128-bit service UUID in the scan response).BLE_HS_ENOMEMit waits and retries instead of dropping bytes. DSO150 builds also get twice NimBLE's default buffers, a 4 KB UART RX buffer, a 16-byte RX FIFO threshold, and ask for a 15-30 ms connection interval.deploy-esp.shdefaults tofs9721-esp32dev.Readout.Core and the app
MeterModel.Dso150,MeterCapabilities.Dso150(no remote keys, no clock, no LCD extras) and a placeholderDso150Driverthat takes bytes and makes no readings (Phase 3 writes the real one).MeterDrivers.ForandMeterCapabilities.Fornow list every model and throw on unknown ones, so a DSO150 can never fall through to the 121GW driver.BridgeBluetooth:RxCharacteristicUuid,PreferredMtu, andModelFromNamerecognisesDSO150.IMeterConnection.SendAsync(ReadOnlyMemory<byte>, CancellationToken)andMeterSession.SendAsync, implemented in:BleMeterConnection(Plugin.BLE): writes with response to RX, one write at a time, in chunks of at most 512 bytes. ThrowsNotSupportedExceptionwhen the meter has no RX (a 121GW, an FS9721 bridge).BlueZMeterConnection(Linux): same rules, viaBlueZNames.PickRxCharacteristic.SimulatedMeterConnection: raisesDataSent(the demo 121GW ignores the bytes).RequestMtuAsync; only Android needs the request, iOS and Windows report what they negotiated).dso150 rx ...) until the driver decodes them.get_statusreportsDSO150as the meter type.Docs
CLAUDE.mdanddocs/FS9721.mdpoint at the renamed folder.Open decision
SYST:BAUDfollowing is out of scope: the bridge stays at 115200. The README lays out the two options for later: the bridge followsSYST:BAUD(it peeks at the protocol in that one place) or a fixed 921600 link.Testing
pio runfor all six envs succeeds, with no warnings frommain.cppdotnet test --project Readout.Tests: 305 passed. New tests cover name parsing, model, capabilities and driver selection, the placeholder driver, session and simulatedSendAsync, and the BlueZ RX lookup. The firmware check now also covers the RX UUID, each chip's name and the MTU.firmware/readout-bridge/README.md)Notes for Phase 3
dso150 rxlog inBleMeterConnection(or drop it to Debug) once the driver decodes, or waveforms will flood the log.STRM:MEASon connect, it needs a hook.LcdDrawabledraws the 121GW face for any model that isn't an FS9721.🤖 Generated with Claude Code