Skip to content

Commissioning ​

Everything below is run on the boat's Brain. Two things to know before you start:

  • This gateway does not ship "unaddressed". Unlike most CanCan applications, its watermaker device leaves the factory on instance 0 and starts publishing as soon as it is powered. Decide its number deliberately, and never put two un-renumbered Eco Sistems gateways on the same boat.
  • Every instance change takes effect at the next restart. Write with --reboot.

1. Wire it and check it lives ​

CAN 1 to the MUXEN bus, CAN 2 to the watermaker's CAN bus at 250 kbit/s, power on. The system LED must blink once a second. Anything else: see Common mistakes.

2. Find it on the bus ​

sh
muxen-uds -i can0 uid --scan

The scan returns the box's UID, and the devices it answers for.

3. Give it its identities ​

The gateway is two MUXEN devices:

DeviceFunctionFactory instanceWhat it is
Watermaker200the watermaker itself — the important one
Generic I/O17255 (not addressed)the relays and inputs of the box

Number them by UID, taken from the scan above:

sh
# the watermaker, here instance 1
muxen-uds -i can0 uid --uid <the-box-uid> --instance 1 --preferred-function-code 20

# the box's own I/O, here instance 4
muxen-uds -i can0 uid --uid <the-box-uid> --instance 4 --preferred-function-code 17

--preferred-function-code is not optional here: this box answers on two functions, and without it the tool does not know which of the two you are numbering.

Because the watermaker device already answers on instance 0, it can also be renumbered directly:

sh
muxen-uds -i can0 -F 20 -I 0 writeconfig --name InstanceNum --value 1 --reboot

Instance numbers run 0…62 and must be unique per function on the boat. Do this one box at a time — two unconfigured boxes on the bus at once collide.

If you leave the generic I/O at 255 it publishes nothing and cannot be reached by function and instance; that is fine if you are not using the relays and inputs.

4. Check the watermaker appears ​

sh
mosquitto_sub -h 127.0.0.1 -t 'device/20/#' -v

With the watermaker powered and talking, a life payload arrives once a second:

device/20/1/life {"data":{"state":"standby","salinity":0,"productionFlow":0,
                          "ProductLiterCmpt":0,"FlowNowRateFromMaxFlow":100},...}

Nothing at all on this topic means the gateway is hearing nothing from the unit — it publishes only while the watermaker is alive. Go to Common mistakes — Eco Sistems gateway.

5. Check the commands both ways ​

Start production from the Brain and watch the state change:

sh
mosquitto_pub -h 127.0.0.1 -t 'device/20/1/command' -m '{"produce": true}'
mosquitto_pub -h 127.0.0.1 -t 'device/20/1/command' -m '{"rinsing": true}'
mosquitto_pub -h 127.0.0.1 -t 'device/20/1/command' -m '{"off": true}'

The state field of the life topic must follow: production, rinçage, standby. It is the unit that reports the change, so a state that does not move means the watermaker refused the command, not that the gateway failed to send it.

Then, while producing, the flow:

sh
mosquitto_pub -h 127.0.0.1 -t 'device/20/1/command' -m '{"productionFlowUp": true}'
mosquitto_pub -h 127.0.0.1 -t 'device/20/1/command' -m '{"productionFlowDown": true}'

These two are accepted only while the unit is producing, and the flow cannot be lowered below the unit's minimum. Leave at least a second between commands.

6. Keep a copy ​

sh
muxen-uds -i can0 -F 20 -I 1 readconfig --save-as-csv ecosistems.csv
muxen-uds -i can0 -F 17 -I 4 readconfig --save-as-csv ecosistems-io.csv

There is little to lose here — the instance numbers and the I/O settings — but a factory reset puts the watermaker back on instance 0, which on a boat with two units is an immediate conflict.

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