TDT-Protocol on CAN » Historie » Version 34
Maximilian Seesslen, 18.01.2023 18:22
1 | 12 | Maximilian Seesslen | h1. Intro |
---|---|---|---|
2 | 1 | Maximilian Seesslen | |
3 | 17 | Maximilian Seesslen | With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue. |
4 | An monitor-software is able to display values without knowing anything about the sensors or their configuration. |
||
5 | 24 | Maximilian Seesslen | The CANId of sensors is actually their configurable ID or an global command. |
6 | 1 | Maximilian Seesslen | |
7 | 17 | Maximilian Seesslen | Sensor values are ususally not very important so the CAN-IDs start at 0x200 (max ids 0x800); |
8 | |||
9 | 1 | Maximilian Seesslen | |_. Size |_. Decription |_. Examples | |
10 | 34 | Maximilian Seesslen | | 1 | Kind | * Measure value |
11 | * System command |
||
12 | * Network management |
||
13 | * Alarms |
||
14 | * multipacked data blob | |
||
15 | 17 | Maximilian Seesslen | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set | |
16 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
||
17 | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
||
18 | 1 | Maximilian Seesslen | | 4 | Value | 32Bit | |
19 | 2 | Maximilian Seesslen | |
20 | 28 | Maximilian Seesslen | h2. Values |
21 | |||
22 | * Date: year 2B, month 1B, day 1B |
||
23 | * Time: hour 1B, minute 1B, second 1B, subsecond 1B |
||
24 | |||
25 | 12 | Maximilian Seesslen | h2. Device behaviour |
26 | |||
27 | 1 | Maximilian Seesslen | All devices should shut down after 5 hours when no master-heartbeat is received. |
28 | |||
29 | h1. IDs, ranges and commands |
||
30 | 12 | Maximilian Seesslen | |
31 | 17 | Maximilian Seesslen | h2. CAN IDs |
32 | 29 | Maximilian Seesslen | |
33 | * 11-Bit-Identifier, (CAN 2.0A); 2048; 0x800 |
||
34 | * 29-Bit-Identifier, (CAN 2.0B); 0x20000000 |
||
35 | 2 | Maximilian Seesslen | |
36 | 1 | Maximilian Seesslen | |_. Range |_. Decription |_. Examples | |
37 | 10 | Maximilian Seesslen | | 0x010-0x0FF | Alarms | Devices have an issue | |
38 | 2 | Maximilian Seesslen | | 0x100-0x1FF | Control commands | Set global actuator | |
39 | | 0x200-0x2FF | Sensors/actors fixed | | |
||
40 | 9 | Maximilian Seesslen | | 0x300-0x6FF | Sensors/actors dynamic | | |
41 | | 0x6FF-0x7FF | Low priority boradcast | Power on devices | |
||
42 | |||
43 | 2 | Maximilian Seesslen | h2. Global actuator |
44 | |||
45 | 1 | Maximilian Seesslen | Global means that all actuators of an type is addressed and not one concrete partipiant. |
46 | 14 | Maximilian Seesslen | An specific partipiant can be specified when sending the target CAN-Id in the value. |
47 | 2 | Maximilian Seesslen | In this way the message is still high priority other than the "Remote Transmission Request" |
48 | |||
49 | 3 | Maximilian Seesslen | |_. ID |_. global actuator |_. Decription | |
50 | | 0x100 | System command | Perform system command; e.g. reboot, poweroff | |
||
51 | 6 | Maximilian Seesslen | | 0x101 | Date/Time | Set date/time of all actuator | |
52 | 8 | Maximilian Seesslen | | 0x102 | Illumination | Set brightness of lamps | |
53 | 1 | Maximilian Seesslen | | 0x103 | Powerswitch | Power on devices | |
54 | 14 | Maximilian Seesslen | | 0x104 | Plant watering pump | Automatically watering indoor plants | |
55 | 8 | Maximilian Seesslen | |
56 | 12 | Maximilian Seesslen | h2. System commands |
57 | 1 | Maximilian Seesslen | |
58 | |_. Sub-ID |_. Type | |
||
59 | 12 | Maximilian Seesslen | | 0x0 | Shutdown | |
60 | | 0x1 | Heartbeat | |
||
61 | |||
62 | h2. Illumination commands |
||
63 | |||
64 | 13 | Maximilian Seesslen | |_. Sub-ID |_. Type | |
65 | | 0x0 | Set ambient light | |
||
66 | | 0x1 | Get ambient light | |
||
67 | | 0x2 | Set ambient light, fading | |
||
68 | | 0x3 | Get ambient light, fading | |
||
69 | | 0x4 | Set plant light | |
||
70 | 1 | Maximilian Seesslen | | 0x5 | Get plant light | |
71 | |||
72 | h2. Powerswitch commands |
||
73 | |||
74 | |_. Sub-ID |_. Type | |
||
75 | | 0x0 | Set powerline for multimedia | |
||
76 | | 0x1 | Get powerline for multimedia | |
||
77 | 17 | Maximilian Seesslen | |
78 | |||
79 | h1. Multipacket-Strings |
||
80 | |||
81 | |_. Address |_. Type | |
||
82 | | 0x0 | Package count | |
||
83 | | 0x1 | Package number | |
||
84 | | 0x2..0x3 | Data | |
||
85 | |||
86 | h1. Actuator introduction |
||
87 | |||
88 | 1 | Maximilian Seesslen | When introduction is requested by system command, each device must send description for each subid. |
89 | 18 | Maximilian Seesslen | |
90 | h1. Example |
||
91 | |||
92 | 23 | Maximilian Seesslen | h2. Turn on the lights |
93 | |||
94 | 27 | Maximilian Seesslen | |_.Data |_.Size |_.Description | |
95 | |0x100 | 29 Bits | CAN-Id: Global command | |
||
96 | |0x0 | 1 Byte | Message-Type: Global command | |
||
97 | |0x0 | 1 Byte | Sub-Id: Set ambient light | |
||
98 | |0x1 | 1 Byte | Data-Type: Integer | |
||
99 | |0x1 | 1 Byte | PWM: PWM permilli | |
||
100 | |1000 | 4 Byte | Value: Full Brightness | |
||
101 | |||
102 | 15 | Maximilian Seesslen | |
103 | h1. Usecases |
||
104 | |||
105 | * simple actors can filter message to "Global actuator" messages, at least "system commands" |
||
106 | * There are 14 or 28 Filters on STM32Fs |
||
107 | 25 | Maximilian Seesslen | |
108 | h1. ID Assigning |
||
109 | |||
110 | Some STM32 have an internal 96-bit unique ID. |
||
111 | |||
112 | h1. V2 |
||
113 | |||
114 | |_. Size |_. Decription |_. Examples | |
||
115 | | 1 | Packet type | Standard TDT packet | |
||
116 | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set | |
||
117 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
||
118 | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
||
119 | | 4 | Value | 32Bit | |
||
120 | |||
121 | h2. Multimessage package |
||
122 | |||
123 | 30 | Maximilian Seesslen | There should be the posssibillity to write the complete SPI-Flash even if it takes forever. |
124 | 31 | Maximilian Seesslen | Not every slave needs to be able to send super big blocks. But every slave should be able to |
125 | send e.g. descriptions. |
||
126 | 30 | Maximilian Seesslen | |
127 | 32 | Maximilian Seesslen | * Is order of messages an issue? Multiple Mailboxes. |
128 | |||
129 | 25 | Maximilian Seesslen | |_. Size |_. Decription |_. Examples | |
130 | | 1 | Packet type | Multimessage package | |
||
131 | | 1 | count | Number of packages | |
||
132 | | 1 | number | 0: value=data length in bytes | |
||
133 | | 4 | Value | 32Bit | |
||
134 | |||
135 | |_. Size |_. Decription |_. Examples | |
||
136 | | 1 | Packet type | Multimessage package 2 | |
||
137 | | 1 | id | Mailbox | |
||
138 | | 1 | number | 0: value=data length in bytes | |
||
139 | | | | 1: value=number of messages | |
||
140 | | | | 2..x: data | |
||
141 | 31 | Maximilian Seesslen | | 4 | Value | 32Bit | |
142 | 30 | Maximilian Seesslen | |
143 | h2. Diagnose |