Skip to content

muxen-uds — Overview ​

muxen-uds is how the MUXEN Brain talks to the electronic boxes on the boat's own CAN bus. Every MUXEN device — a battery monitor, a power distribution box, a tank sensor interface, an NMEA 2000 gateway — carries a small configuration table and a firmware image. muxen-uds reads that table, writes it, restarts the device, makes it blink for identification, and uploads a new firmware into it.

For the owner or the crew this is the machinery behind "the installer changed a setting" and "the yard updated the boxes". Nothing here runs by itself: no command in this manual is issued unless somebody, or an HMI screen, asks for it.

For an installer or an integrator it is the diagnostic tool of the MUXEN bus: a command-line program on the Brain, and a WebSocket daemon that gives the same commands to a web interface.

The problem it solves ​

A MUXEN device has no screen and no keyboard. Its settings — battery voltage thresholds, tank calibration, its own address on the bus — live in a table inside the device, and the only way in is the CAN bus it is wired to.

muxen-uds speaks UDS (Unified Diagnostic Services, ISO 14229) over that bus. UDS is the automotive diagnostic protocol; MUXEN uses three of its services plus a few vendor routines:

UDS serviceCodeUsed for
ECU Reset0x11reset — cold start a device
Read Data By Identifier0x22readconfig — walk the parameter table
Write Data By Identifier0x2Ewriteconfig — change one parameter
Routine Control0x31locate, factory, routine
Request Download / Transfer Data / Transfer Exit0x34 / 0x36 / 0x37firmware — upload an image

Background on the protocol itself: https://en.wikipedia.org/wiki/Unified_Diagnostic_Services.

What ships in the package ​

One Debian package, muxen-uds, installs five programs:

ProgramWhat it is
muxen-udsthe command-line tool — every command lives here
muxen-udsdthe WebSocket daemon, run by systemd as muxen-uds.service
muxen-scanwrapper, execs muxen-uds scan
muxen-uidwrapper, execs muxen-uds uid
muxen-deploywrapper, execs muxen-uds deploy

Plus a bash completion file, two nginx snippets and the systemd unit. See Reference for the exact paths.

The CLI and the daemon are built from the same command implementations, so a command behaves identically whether it was typed in a shell or sent as JSON over the WebSocket. The only differences are how parameters arrive and how results are printed.

Where it sits on the boat ​

   HMI / web interface            shell on the Brain
        (@muxen/uds)                  (muxen-uds)
             |                              |
      ws://…/ws/uds                         |
             |                              |
      muxen-udsd  ────────────┬─────────────┘
                              |
                        ISO-TP / UDS
                              |
                        can0 (MUXEN bus)
                              |
        ┌─────────────┬───────┴───────┬──────────────┐
     device 64     device 320     device 640      device …

muxen-uds is the single owner of diagnostic traffic on the MUXEN bus. Other MUXEN components do not write UDS frames themselves; they drive muxen-uds. muxen-portal, for instance, uses the muxen-uds WebSocket for its scans, readconfig calls, firmware uploads and resets.

What it talks to:

PeerHow
MUXEN devicesUDS over ISO-TP on can0 (the interface is configurable)
Web interfacesWebSocket JSON on port 12345, usually reverse-proxied at /ws/uds
muxen-firmwarereads the firmware images and their products.json catalog from /usr/lib/muxen/firmware
The boat configurationreads /etc/muxen/deploy.json or /etc/muxen/configuration/<project>.json, writes /var/lib/muxen/deployed.json
systemdmuxen-uds.service, PartOf=muxen.target

It does not publish to MQTT and holds no state of its own beyond the deployed-device cache.

What it does not do ​

  • It does not monitor. muxen-uds acts when asked and is otherwise idle; live boat data is the business of the other MUXEN daemons.
  • It does not manage addresses automatically. A device that shares its address with another has to be fixed by hand — see Devices, addressing and discovery.

Document map ​

DocumentContent
Getting startedinstall, verify the service, first scan, first read
Devices, addressing and discoveryaddressing, scan, uid, locate, address collisions
Device configurationreadconfig, writeconfig, backup, factory
Deploying a boat configurationdeploy, checkconfig, project files
Firmwarelistfirmware, firmware upload, what can go wrong
Web clients — @muxen/udsthe @muxen/uds TypeScript client and a Vue 3 sample
Troubleshootingsymptom → cause → action, FAQ, tips
ReferenceCLI, options, files, units, defaults, exit status
WebSocket protocolthe WebSocket JSON wire format
CAN transportCAN identifiers, ISO-TP framing, timeouts and retries

Integration of multiplexed solutions
MUXEN and the MUXEN logo are trademarks of MUXEN SAS.