Appearance
Reference — MDV battery switch module
The MUXEN devices this module publishes
| Device | Function | Instance comes from |
|---|---|---|
| Remote battery switch | 25 | InstanceNum of that device, written by hand. 255 out of the box, and nothing is published until it is set |
| Battery | 5 | InstanceNum of that device. Forced to 0 at startup if it has never been set |
MQTT topics on the Brain follow device/<function>/<instance>/<frame>, so device/25/0/life is the switch and device/5/0/life the battery.
What the switch frame carries
| Switch position | closed or open, taken from the feedback contact |
| Bus power state | whether the module is currently injecting onto the MUXEN bus |
| Supply state | whether the module's own power input is good |
| Injected current | what the module is putting onto the bus and the auxiliary output, in 0.1 A |
| Boat power-up flag | set for OnOffPulseLength after the switch closes |
| Boat power-down flag | set for OnOffPulseLength after the switch opens |
What the battery publishes
Voltage, current, temperature and state of charge, read from the Hella IBS; the parc it is bound to; and a charge request derived from the voltage against AlertVmin / AlertVmax and their hysteresis. Alongside it, the charge and discharge limits — which the sensor does not know, so they are the four values written in the battery's own configuration.
The battery is published only while the module is powering the bus.
Commanding it
From the Brain, on device/25/<instance>/command:
sh
mosquitto_pub -h 127.0.0.1 -t 'device/25/0/command' -m '{"relay": true}'
mosquitto_pub -h 127.0.0.1 -t 'device/25/0/command' -m '{"relay": false}'
mosquitto_pub -h 127.0.0.1 -t 'device/25/0/command' -m '{"relay": "auto"}'| Field | Values |
|---|---|
relay | true — close the main switchfalse — open it"auto" — release the force and leave the module to its own logic |
injection | true — force bus power onfalse — force it off"auto" — release the force |
A command carrying both "on" and "off" at once is refused and both are cleared.
Forcing the injection overrides the whole power-injection logic, including the shutdown delay and the sleep. It is a bench and troubleshooting tool, not a way to configure the boat.
Parameters
Every device carries the four read-only identifiers common to all can-mdv boxes (Reference). Values below are defaults.
Remote battery switch — function 25
| Parameter | Default | Meaning |
|---|---|---|
InstanceNum | 255 | 255 means not addressed |
EnablePowerInjection | 1 | 0 — the module never powers the MUXEN bus, and publishes no battery1 — the bus is powered while the main switch is closed |
PowerInjectionOffDelay | 600000 | ms the bus stays powered after the main switch opens, before the module cuts it and sleeps |
OnOffPulseLength | 2000 | ms the boat power-up / power-down flags stay set after the switch moves |
RemoteSwitchTimeout | 300000 | ms the module will drive a coil waiting for the feedback contact before giving up |
ReverseSwitchDrive | 0 | 0 — relay 1 opens, relay 2 closes1 — the two are swapped |
IMeaCoef | 291 | scaling of the injected-current measurement |
BatteryIbsType | 1 | 0 — Hella IBS 12 V1 — Hella IBS 24 V. Read once, at startup |
RemoteSwitchEqn | empty | logic equation; every rising edge of its result toggles the main switch. Read once, at startup. Up to 255 characters |
Battery — function 5
| Parameter | Default | Meaning |
|---|---|---|
InstanceNum | 0 | set to 0 by the module if it has never been addressed |
BindToParc | auto | which battery parc this bank belongs to; decided from the first valid voltage and then frozen |
AlertVmin / AlertVminHyst | 240 / 5 | low-voltage threshold and its hysteresis, in 0.1 V |
AlertVmax / AlertVmaxHyst | 285 / 5 | high-voltage threshold and its hysteresis, in 0.1 V |
VChargeMax | 285 | maximum charge voltage published with the battery, in 0.1 V |
VDischMax | 240 | minimum discharge voltage, in 0.1 V |
IChargeMax | 500 | maximum charge current, in 0.1 A |
IDischMax | 500 | maximum discharge current, in 0.1 A |
The battery group carries a few further parameters shared with every MUXEN battery device; this firmware uses only the ones listed above.
Automatic parc detection
Applied once, to the first valid voltage read from the sensor, then written to flash.
| Measured voltage | Parc |
|---|---|
| 43.0 – 60.0 V | 1 |
| 10.0 – 16.0 V | 2 |
| 20.0 – 30.0 V | 3 |
| anything else | standalone |
The equation
RemoteSwitchEqn is a logic expression over signals read from the MUXEN bus, in the same syntax used by the relay equations of other MUXEN devices.
| Operator | Meaning |
|---|---|
& | and |
| | or |
! | not |
^ | exclusive or |
# | latch |
[ ] | sub-expression |
A signal is written as its type followed by its parameters in parentheses — B8S(3,I,1,0,0) is dry-contact input 1 of Bloc 8 number 3. Every rising edge of the whole expression toggles the main switch; the level itself does nothing.
Routines
| Routine | Effect |
|---|---|
| 1 | restore defaults — payload bit 0 restores the instance number, any higher bit restores everything else |
The locate routine is not implemented on this firmware: muxen-uds locate is refused.
Timings
| Switch frame published every | 500 ms, and immediately on any change |
| Battery published every | 1 s |
| Battery sensor polled every | 500 ms |
| Feedback contact confirmed after | 2 s of a steady new position |
| Bus power held after the switch opens | PowerInjectionOffDelay, 10 min by default |
| Module goes to sleep after the bus power is cut | 5 s |
| Coil drive gives up after | RemoteSwitchTimeout, 5 min by default |
| System LED | one blink per second while awake, off while asleep |
Limits
| Main switches driven | 1 |
| Battery sensors read | 1 |
| MUXEN instances | 0 – 62 |
| LIN speed | 19 200 bit/s, fixed |
| MUXEN bus speed | 500 kbit/s |
Known limitations
- The battery sensor type and the equation are read only at startup; a power cycle is needed after changing either.
- Instance numbers take effect for published frames immediately, but for commands and for the diagnostic session only after a power cycle.
- With
EnablePowerInjectionat 0 the module drives the switch but publishes no battery.
Versions
| Hardware | Version | Image |
|---|---|---|
| can-mdv v2 | 6.2 | 010010029-V2-app_mdv-firmware.srec |
