-
Notifications
You must be signed in to change notification settings - Fork 2
CAN bus configuration
CAN bus (Controller Area Network) is a common, well documented communication protocol. It is used by dobiss to communicate between the different Dobiss modules like:
- DO5011/DO5311
- DO5450/DO5400 PRO
- The Dobiss Wifi Bridge
There are many CAN to USB adapters available. I used the SH-C30A from DSD TECH.
CAN bus connects all the modules on a single bus. The bus does not allow for branches. The first and last module should have the 120 Ohm switch activated to reduce noise on the bus. On the Dobiss modules this red switch is located near the top of the module near the CAN bus interface (marked with M, CL, CH).
To install the CAN-USB adapter, either leave the R120 switch in the off position and connect the adapter between 2 modules. Or connect the adapter after the last module and turn OFF the switch on the last module and ON on your adapter.
The adapter will show up in Linux as a network interface with the name canX (normally can0). You can monitor the bus using WireShark/TShark for debugging purposes. You will need to do this to obtain the arbitration ID for every module in your setup. This arbitration ID is needed to send commands to the module. This arbitration ID is not the same as the module number which is used in the Dobiss configuration software.
To find the module ID, you can use the Dobiss app to trigger different lights, dimmers, scenes, ... and monitor the messages on the CAN interface.
The messages on the CAN bus use the arbitration ID to direct communication to the module targeted by the command. They also contain a binary payload.
In the project we make use of 2 types of messages:
- command messages to set the status of an output/dimmer. This messages generate no response.
- Status request messages to request the status of every output of a module. This request is send to the arbitration ID that is one bit lower than the ID used to command the module. The module responds to this message with several messages containing several bytes per message. Every byte represents the status of an output. The statuses are sent in order from the lowest output number to the highest. In the project the number of expected response messages for every module are hard coded in the config file config/config/dobiss_entity_config.py.