Skip to content

Add SimHub DIY belt tensioner support to the G Tensioner#47

Open
mherbold wants to merge 8 commits into
mainfrom
simhub-diy-belt-tensioner
Open

Add SimHub DIY belt tensioner support to the G Tensioner#47
mherbold wants to merge 8 commits into
mainfrom
simhub-diy-belt-tensioner

Conversation

@mherbold

Copy link
Copy Markdown
Owner

What changed

The G Tensioner page gets a device type selector (Connection group) with three options:

  • MAIRA SBT — default, behavior unchanged
  • SimHub DIY (motion addon firmware) — binary framed protocol at 250000 baud, both belt positions in one frame (positions mapped 0–1800 tenths → 0–65535), detected by sending the firmware's enabled-motors query and matching its Enabled motors:<n> reply
  • SimHub DIY (belt tensioner plugin firmware)M1 <v> / M2 <v> text lines at 19200 baud (signed ±32767 scale), detected passively via the "<n> steppers enabled" boot banner the Nano prints after the DTR reset on port open

Both protocols were verified against the official firmware sources downloaded from simhubdash.com.

Why

SimHub DIY belt tensioner owners can drive their hardware from MAIRA with the stock SimHub firmware — no reflash — so the rig keeps working with SimHub for other games. Both firmware variants are supported because the motion addon is a paid SimHub license feature; many rigs run the free legacy plugin firmware.

Implementation notes for review

  • The G Tensioner signal pipeline (surge/sway/heave, auto-tune, seat of pants, tests) is untouched; only the output stage in GTensioner.cs is device-aware.
  • Neither SimHub firmware has a vibration command, so ABS / wheel slip / rumble are synthesized PC-side by oscillating the position stream at 60fps from Tick (SendSimHubPositions). Sending stops 1s after the last base position update so the device can park/sleep itself, mirroring how the SBT sleeps when S packets stop.
  • Calibration (N/A/B), max motor speed (M), and inverted arms (I) commands are MAIRA-SBT-only; the min/neutral/max window is applied PC-side for SimHub devices, and the inverted-arms switch is disabled for them (their homing fixes the position sense in firmware).
  • UsbSerialPortHelper gains an optional handshakeRequestData parameter: null = existing "WHAT ARE YOU?" text probe, empty = passive listen, bytes = raw binary probe. Probing remains gated to known USB-serial bridge chips.
  • New device-name strings added across all 35 language resx files via the localization script (BOMs preserved).
  • Built clean: Debug/x64, exit 0, no warnings.

Not included

  • WordPress documentation update for the G Tensioner page (normally handled by the /commitpush doc-sync flow) — the device picker section still needs to be added there.
  • Hardware testing: verified against firmware source only; the calibration sweep and vibration test buttons are the quickest on-hardware checks. Note the legacy firmware physically runs its homing sweep whenever the port opens (same as under SimHub).

🤖 Generated with Claude Code

mherbold and others added 8 commits July 24, 2026 13:43
The G Tensioner page now has a device type selector with three options:
the MAIRA SBT (default, unchanged), and the SimHub DIY belt tensioner
running either its motion addon firmware or its free legacy belt
tensioner plugin firmware. Supporting both firmwares matters because
the motion addon is a paid SimHub feature, and speaking the stock
SimHub protocols means owners keep SimHub compatibility for other
games without reflashing.

- Motion addon firmware: binary framed protocol at 250000 baud, both
  belt positions per frame, detected by an "enabled motors" query.
- Legacy plugin firmware: M1/M2 text lines at 19200 baud, detected
  passively via the boot banner printed after the DTR reset.
- Neither firmware has a vibration command, so ABS / wheel slip /
  rumble effects are synthesized PC-side by oscillating the position
  stream at 60fps; sending stops 1s after telemetry stops so the
  device can park itself.
- UsbSerialPortHelper gains a handshakeRequestData parameter for
  passive and binary handshakes.
- New device name strings localized across all 35 languages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… events

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant