Skip to content

Reference — MDV battery switch module ​

The MUXEN devices this module publishes ​

DeviceFunctionInstance comes from
Remote battery switch25InstanceNum of that device, written by hand. 255 out of the box, and nothing is published until it is set
Battery5InstanceNum 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 positionclosed or open, taken from the feedback contact
Bus power statewhether the module is currently injecting onto the MUXEN bus
Supply statewhether the module's own power input is good
Injected currentwhat the module is putting onto the bus and the auxiliary output, in 0.1 A
Boat power-up flagset for OnOffPulseLength after the switch closes
Boat power-down flagset 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"}'
FieldValues
relaytrue — close the main switch
false — open it
"auto" — release the force and leave the module to its own logic
injectiontrue — force bus power on
false — 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

ParameterDefaultMeaning
InstanceNum255255 means not addressed
EnablePowerInjection10 — the module never powers the MUXEN bus, and publishes no battery
1 — the bus is powered while the main switch is closed
PowerInjectionOffDelay600000ms the bus stays powered after the main switch opens, before the module cuts it and sleeps
OnOffPulseLength2000ms the boat power-up / power-down flags stay set after the switch moves
RemoteSwitchTimeout300000ms the module will drive a coil waiting for the feedback contact before giving up
ReverseSwitchDrive00 — relay 1 opens, relay 2 closes
1 — the two are swapped
IMeaCoef291scaling of the injected-current measurement
BatteryIbsType10 — Hella IBS 12 V
1 — Hella IBS 24 V. Read once, at startup
RemoteSwitchEqnemptylogic equation; every rising edge of its result toggles the main switch. Read once, at startup. Up to 255 characters

Battery — function 5

ParameterDefaultMeaning
InstanceNum0set to 0 by the module if it has never been addressed
BindToParcautowhich battery parc this bank belongs to; decided from the first valid voltage and then frozen
AlertVmin / AlertVminHyst240 / 5low-voltage threshold and its hysteresis, in 0.1 V
AlertVmax / AlertVmaxHyst285 / 5high-voltage threshold and its hysteresis, in 0.1 V
VChargeMax285maximum charge voltage published with the battery, in 0.1 V
VDischMax240minimum discharge voltage, in 0.1 V
IChargeMax500maximum charge current, in 0.1 A
IDischMax500maximum 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 voltageParc
43.0 – 60.0 V1
10.0 – 16.0 V2
20.0 – 30.0 V3
anything elsestandalone

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.

OperatorMeaning
&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 ​

RoutineEffect
1restore 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 every500 ms, and immediately on any change
Battery published every1 s
Battery sensor polled every500 ms
Feedback contact confirmed after2 s of a steady new position
Bus power held after the switch opensPowerInjectionOffDelay, 10 min by default
Module goes to sleep after the bus power is cut5 s
Coil drive gives up afterRemoteSwitchTimeout, 5 min by default
System LEDone blink per second while awake, off while asleep

Limits ​

Main switches driven1
Battery sensors read1
MUXEN instances0 – 62
LIN speed19 200 bit/s, fixed
MUXEN bus speed500 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 EnablePowerInjection at 0 the module drives the switch but publishes no battery.

Versions ​

HardwareVersionImage
can-mdv v26.2010010029-V2-app_mdv-firmware.srec

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