Skip to content

fix(kiss): default serial and usb-serial interfaces to TNC mode#449

Open
chrissnell wants to merge 1 commit into
mainfrom
fix/kiss-serial-tnc-default
Open

fix(kiss): default serial and usb-serial interfaces to TNC mode#449
chrissnell wants to merge 1 commit into
mainfrom
fix/kiss-serial-tnc-default

Conversation

@chrissnell

Copy link
Copy Markdown
Owner

Problem

"Network KISS works fine but serial receives nothing." Confirmed root cause: a mode-default asymmetry. tcp-client and bluetooth default to TNC mode, but serial and usb-serial defaulted to Modem. A serial/USB interface connects to a device that is the radio (hardware TNC, LoRa modem, radio with built-in KISS TNC), so Modem mode is wrong for it:

  • Received frames are routed into the TX governor instead of the iGate/digi/map -> operator sees no packets (the reported symptom).
  • TX fails with no backend registered for channel.

This is the same trap the LoRa-Pi reporter hit, and it explains why network (tcp-client, auto-TNC) worked while serial (defaulted Modem) didn't.

Fix

Give serial/usb-serial the same TNC default tcp-client and bluetooth already have (invariant 16b):

  • configstore.KissTypeDefaultsTnc(type) -- one shared predicate (true for tcp-client/serial/usbserial) now drives the Mode=tnc + AllowTxFromGovernor default in both dto.KissRequest.ToModel and normalizeKissInterface.
  • Kiss.svelte -- the new-row $effect applies the same default when the operator selects serial/usb-serial. The UI always sends mode explicitly, so this is the operative path for interactive creation; the backend default is the API/programmatic backstop.
  • Migration 26 (kiss_serial_tnc_default) -- repairs existing serial/usb-serial rows stuck at the modem default, skipping any modem-backed channel exactly as migration 20 does for tcp-client.

An explicitly supplied Mode is still honored verbatim, and validateKissInterface still rejects tnc+governor-TX on a modem-backed channel -- so the rare legitimate "graywolf-as-soundmodem over a serial/PTY link" setup must pick Mode=modem explicitly (same tradeoff tcp-client already made).

Verification

  • go build ./..., go vet -- clean
  • go test ./pkg/configstore/... ./pkg/webapi/... ./pkg/app/... ./pkg/kiss/... -- pass (incl. new TestMigrateKissSerialTncDefault and DTO serial-default cases)
  • npm run build + npm test (463/463) -- pass

Wiki invariant 16b updated (now covers all three hardware-TNC types, the shared predicate, and migration 26).

A serial or usb-serial KISS interface connects to a device that IS the
radio (hardware TNC, LoRa modem, radio with a built-in KISS TNC), yet it
defaulted to Modem mode while tcp-client and bluetooth default to TNC.
In Modem mode a hardware TNC's received frames are routed into the TX
governor instead of the iGate/digi/map -- the operator sees no packets --
and TX fails with 'no backend registered for channel'. This is the
recurring 'network KISS works but serial receives nothing' report.

Give serial/usb-serial the same TNC default tcp-client already has:

- Shared predicate configstore.KissTypeDefaultsTnc(type) drives the
  Mode=tnc + AllowTxFromGovernor default in dto.KissRequest.ToModel and
  normalizeKissInterface.
- Kiss.svelte applies the same default in the UI (the UI always sends
  mode explicitly, so it, not the backend default, is the operative path
  for interactive creation).
- Migration 26 (kiss_serial_tnc_default) repairs existing serial/
  usb-serial rows stuck at the modem default, skipping modem-backed
  channels exactly as migration 20 does for tcp-client.

An explicit Mode is still honored, and validateKissInterface still
rejects tnc+governor-TX on a modem-backed channel, so the rare
soundmodem-over-serial setup must pick Mode=modem explicitly.

Go + web build and tests pass.
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