Danbus protocol for home automation

DANBUS is innovative system to connect many devices to your home assistance software control.

With DanBus protocol you can connect up to 63 DL485x cards to control of all I/O and sensors of a home automation system for home control but also for other uses such as the management of greenhouses, cellars, dairies ...

The nodes are equal and send in turn their data packets on the network without stall, these data are available to all connected nodes and possibly also to a possible general control system such as Domoticz and / or other home automation systems.

On rotation each node, if on and connected, sends its data packet to the BUS, when a node is off or occupied, then the turn continues with the next node ready to transmit.

If a node has no information to send, it simply sends a ping packet.

Each node can leave the network even during the transmission of one of its packets, in this case the remaining nodes detect a wrong packet error and normally continue communications

Signal composition

There are two packets type:

  • PING package (when there is no information or request to send over the network)
  • Package INFO (with information data)

PING package (fixed length):


  • ID Sender
  • CRC with end package flag

INFO package (variable length):


  • ID Sender
  • Package type
  • ID recipient (from 1 a 63)
  • Data (optional, even 0 bytes)
  • CRC with end packet flag

Packages type

The second frame byte indicates the type of packet transmitted by the node. The most used commands are the following:

  • 0x0E - Communicates IO, when periodically (depending on the setting), or following an event, a node sends the I/O value and/or the various I2C and/or OneWire sensors into the network
  • 0x07 - Command to request the value of one of its inputs at a node
  • 0x08 - Command to set the value of an output in a node
  • 0x0B - Reboot command for a send card (all in case the destination ID is 0)
  • 0x0A - Initialize IO command with value set on EEPROM, useful to read again the configuration after having changed it
  • 0x03 - I/O configuration reading command present on EEPROM
  • 0x04 - EEPROM reading command (the starting address and the number of bytes to read must be given)
  • 0x06 - EEPROM writing command (you must give the starting address and the number of bytes to write)
  • 0x0C - Command to read the board type and firmware version
  • 0x0D - Communication of a package with error description

Error Types

Each node performs a check of the correctness of the received packets and / or the feasibility of the received commands and can detect different cases of error by composing an error message that will send on the network when it is its turn, the sent packet will be composed as a packet INFO where the standard byte will be 0x0D followed by a byte as from the following list and containing the type of problem detected:

  • 0x00 - I2C initialization / timeout error
  • 0x01 - Error 3 consecutive zeroes in position not allowed in the packages
  • 0x02 - Error 3 consecutive ones in position not allowed in the packages
  • 0x03 - Package received too long
  • 0x04 - Package felt equal to itself
  • 0x05 - Sender address out of range
  • 0x06 - Missing recipient address
  • 0x07 - Missing parameters
  • 0x08 - Too many package bytes
  • 0x09 - Missing parameters
  • 0x0A - I2C busy
  • 0x0B - Missing residual bytes
  • 0x0C - Too many data bytes
  • 0x0D - Zero parameter command error
  • 0x0E - Command error with 1 unknown parameter
  • 0x0F - Command error with 2 unknown parameters
  • 0x10 - Command error with 3 unknown parameters
  • 0x11 - Command error with 4 unknown parameters
  • 0x12 - Unexpected parameter n command error
  • 0x13 - CRC error
  • 0x14 - I2C busy
  • 0x15 - I2C timeout
  • 0x16 - OneWire busy
  • 0x18 - OneWire busy
  • 0x19 - Input number reading out of range
  • 0x1A - Non-compliant package size
  • 0x1B - EE reading beyond address limit
  • 0x1C - Write number out of range
  • 0x1D - Parameter number out of range
  • 0x1E - Node busy by previous order


stay tuned...


Print   Email