CAN Communication Protocol

From OpenMotics
Jump to navigation Jump to search
Direction Nr Of Bytes Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte6 Description
S->M
5
1
1
Input Nr
Press State
Checksum
-
-
-
Input nr has been pressed (Press state=0) or released (Press state=1)
M->S
5
0
1
Input Nr
Press State
Checksum
-
-
-
Respond to uCAN that input press/release message has been well received
M->S
4
0
2
Sensor Nr
Checksum
-
-
-
-
Request Sensor data of Sensor Nr
S->M
8
2
2
Sensor Nr
Temp1
Humidity1
Brightness1
Temp2
Checksum
Return sensor data in System Value format
M->S
6
0
3
Led Nr
Led Value
Led Function
Checksum
-
-
Set Led of Micro CAN
M->S
6
0
4
Sensor Nr
Led Value
Led Function
Checksum
-
-
Indicate Sensor Nr of Micro CAN
M->S
6
0
5
Input Nr
Led Value
Led Function
Checksum
-
-
Indicate Input Nr of Micro CAN
M->S
4
0
10
Sensor Nr
Checksum
-
-
-
-
Request RAW sensor temperature information
S->M
7
10
10
Sensor Nr
Temp.MSB
Temp.LSB
Sensor Type
Checksum
-
Sent RAW temperature information
M->S
4
0
11
Sensor Nr
Checksum
-
-
-
-
Request RAW sensor humidity information
S->M
7
11
11
Sensor Nr
Humidity.MSB
Humidity.LSB
Sensor Type
Checksum
-
Sent RAW humidity information
M->S
4
0
12
Sensor Nr
Checksum
-
-
-
-
Request RAW sensor brightness (Visible+IR) information
S->M
8
12
12
Sensor Nr
Brightness.MSB
Brightness.LSB
Sensor Type
Time/gaining Reg (1h)
Checksum
Sent RAW brightness (Visible+IR) information
M->S
4
0
13
Sensor Nr
Checksum
-
-
-
-
Request RAW sensor brightness (IR only) information
S->M
7
13
13
Sensor Nr
Brightness.MSB
Brightness.LSB
Sensor Type
Time/gaining Reg (1h)
Checksum
Sent RAW brightness (IR only) information
M->S
4
0
14
Sensor Nr
Checksum
-
-
-
-
Request the Timing/Gain (timing register 1h of TSL2561) parameter
S->M
7
14
14
Sensor Nr
Timing/gaining
Sensor Type
Checksum
-
-
Sent the timing/gain parameter (1h) of TSL2561
M->S
5
0
15
Sensor Nr
Timing/Gain
Checksum
-
-
-
Set the Timing/Gain parameter of TSL2561 (timing register 1h of TSL2561) parameter
M->S
4
0
90
Input Nr
Checksum
-
-
-
-
Reset uCAN with specified input Nr
M->S
4
0
91
Sensor Nr
Checksum
-
-
-
-
Reset uCAN with specified Sensor Nr
M->S
3
0
92
Checksum
-
-
-
-
-
Reset all uCAN's
M->S
6
0
94
ID.Byte2
ID.Byte1
ID.Byte0
Checksum
-
-
Reset uCAN with specific ID
S->M
7
94
94
ID.Byte2
ID.Byte1
ID.Byte0
AppMode
Checksum
-
Resetting CAN has been done (App_mode=1 -> App running, =0 -> In Bootloader)
S->M
7
1
95
ID.Byte2
ID.Byte1
ID.Byte0
Ping Message
Checksum
-
Ping the Master to see if the Master is available
M->S
7
0
95
ID.Byte2
ID.Byte1
ID.Byte0
Ping Message
Checksum
-
Master will respond to a ping request from a uCAN
M->S
7
0
96
ID.Byte2
ID.Byte1
ID.Byte0
Ping Message
Checksum
-
Ping the Micro CAN slave to see if the Micro CAN is available
S->M
7
1
96
ID.Byte2
ID.Byte1
ID.Byte0
Ping Message
Checksum
-
Micro CAN will respond to a ping request from the Master
S->M
7
120
120
ID.Byte2
ID.Byte1
ID.Byte0
Inp(0-5)
Checksum
-
New input found
M->S
8
0
120
ID.Byte2
ID.Byte1
ID.Byte0
Inp(0-5)
Input Nr
Checksum
Program input in Eeprom
S->M
7
121
121
ID.Byte2
ID.Byte1
ID.Byte0
Sensor(0-1)
Checksum
-
New sensor found
M->S
8
0
121
ID.Byte2
ID.Byte1
ID.Byte0
Sensor(0-1)
Sensor Nr
Checksum
Program Sensor Nr in Eeprom
M->S
7
0
122
ID.Byte2
ID.Byte1
ID.Byte0
ID_NE
Checksum
-
Program ID_NE in Eeprom
M->S
7
0
123
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Time
Checksum
-
Write bootloader time in byte 128 of the Micro CAN EEPROM
S->M
7
123
123
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Time
Checksum
-
Response on bootloader time being programmed
M->S
7
0
124
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Startup message
Checksum
-
Write bootloader startup message in byte 129 of the Micro CAN EEPROM
S->M
7
124
124
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Startup Message
Checksum
-
Response on bootloader startup message being programmed
M->S
7
0
130
ID.Byte2
ID.Byte1
ID.Byte0
Modbus address
Checksum
-
Write the Modbus thermostat address in the uCAN
S->M
7
130
130
ID.Byte2
ID.Byte1
ID.Byte0
Modbus address
Checksum
-
Response on Thermostat Modbus address being written
M->S
7
0
131
ID.Byte2
ID.Byte1
ID.Byte0
Thermostat type
Checksum
-
Write the Modbus thermostat type in the uCAN
S->M
7
131
131
ID.Byte2
ID.Byte1
ID.Byte0
Thermostat type
Checksum
-
Response on Thermostat Modbus type being written
M->S
7
0
198
ID.Byte2
ID.Byte1
ID.Byte0
Config Nr
Checksum
-
This instruction will sent the CAN config (x 199) but only per config_nr line, in other words if config_nr=8, led Min/Max (8 199) will be the response
M->S
6
0
199
ID.Byte2
ID.Byte1
ID.Byte0
Checksum
-
-
This instruction will request to sent the full CAN config (1-13 199) so message (1 199), (2 199) etc will all be sent over
S->M
8
1
199
ID.Byte2
ID.Byte1
ID.Byte0
Input Link 0
Input Link 1
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
2
199
ID.Byte2
ID.Byte1
ID.Byte0
Input Link 2
Input Link 3
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
3
199
ID.Byte2
ID.Byte1
ID.Byte0
Input Link 4
Input Link 5
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
4
199
ID.Byte2
ID.Byte1
ID.Byte0
Sensor Link 0
Sensor Link 1
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
5
199
ID.Byte2
ID.Byte1
ID.Byte0
Sensor Type
F1
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
6
199
ID.Byte2
ID.Byte1
ID.Byte0
F2
F3
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
7
199
ID.Byte2
ID.Byte1
ID.Byte0
Bootloader Mode
ID_NE
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
8
199
ID.Byte2
ID.Byte1
ID.Byte0
Led_min
Led_Max
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
9
199
ID.Byte2
ID.Byte1
ID.Byte0
AD value inp2.MSB
AD value inp2.LSB
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
10
199
ID.Byte2
ID.Byte1
ID.Byte0
AD value inp3.MSB
AD value inp3.LSB
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
11
199
ID.Byte2
ID.Byte1
ID.Byte0
AD value inp4.MSB
AD value inp4.LSB
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
12
199
ID.Byte2
ID.Byte1
ID.Byte0
AD value inp5.MSB
AD value inp5.LSB
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
13
199
ID.Byte2
ID.Byte1
ID.Byte0
AD value DC in.MSB
AD value DC in.LSB
Checksum
Part of the CAN Config of this Micro CAN
S->M
8
14
199
ID.Byte2
ID.Byte1
ID.Byte0
Modbus address
Thermostat Type
Checksum
Part of the CAN Config of this Micro CAN
S->M
7
200
200
ID.Byte2
ID.Byte1
ID.Byte0
ID_NE
Checksum
-
Sent ID to Master (ID_NE="E"->Existing&programmed ID, ="N"->New ID&not progr)
M->S
7
0
200
ID.Byte2
ID.Byte1
ID.Byte0
Response
Checksum
-
Sent Response ID to slave (Response="O"->OK ID can be used, ="E"->Error, ID exists)
S->M
7
240
240
ID.Byte2
ID.Byte1
ID.Byte0
Error_code
Checksum
-
Error_code=0: message received with wrong Checksum
M->S
7
0
246
ID.Byte2
ID.Byte1
ID.Byte0
Led Brightness Min
Checksum
-
Set Led Min for this uCAN only
M->S
7
0
247
ID.Byte2
ID.Byte1
ID.Byte0
Led Brightness Max
Checksum
-
Set Led Max for this uCAN only
M->S
4
0
249
0
Checksum
-
-
-
-
Broadcast message to reset all temp/humidity sensors
M->S
5
0
250
LedBrightMin
LedBrightMax
Checksum
-
-
-
Broadcast Min/Max of led brightness for all uCAN's


Notes:

  • M->S: This means that the Master or CAN Control is sending information to Micro CAN (Slave)
  • S->M: This means that the Micro CAN (Slave) is sending information to the Master or CAN Control
  • This CAN protocol only works for firmware Version 2.x.x
  • CAN protocol speed is 25kbps
  • Standard SID that is used in all communications between CAN Control and Micro CAN's is 6. All communication initiated by API instruction "FM" can have SID 0, 1, 5 or 6.
  • Checksum is calculated as the sum of the previous bytes. Example: Nr of bytes=5 (so 5 bytes to transmit), Checksum=Byte0+Byte1+Byte2+Byte3