TDT-Protocol on CAN » Historie » Version 39
Maximilian Seesslen, 19.01.2023 13:13
| 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 | 35 | Maximilian Seesslen | CAN 2.0A: 0..0x7FF |
| 8 | CANOpen: 4 Bit Function code, 7 Bit Node-ID |
||
| 9 | Node-Id: 0..0x7F |
||
| 10 | Function-Code Mask: 0x780 |
||
| 11 | 1 | Maximilian Seesslen | |
| 12 | 35 | Maximilian Seesslen | Function code: |
| 13 | |_. Code |_. Decription |_. Examples | |
||
| 14 | | 0 | NMT | | |
||
| 15 | | 1 | Alarms | | |
||
| 16 | | 8 | System commands | Set Date, illumination | |
||
| 17 | | 15 | Sensor values | Temperature | |
||
| 18 | |||
| 19 | |||
| 20 | 34 | Maximilian Seesslen | |_. Size |_. Decription |_. Examples | |
| 21 | 1 | Maximilian Seesslen | | 1 | Command | Plain Sensor value; Set illumination | |
| 22 | 39 | Maximilian Seesslen | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set | |
| 23 | 17 | Maximilian Seesslen | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
| 24 | 1 | Maximilian Seesslen | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
| 25 | 2 | Maximilian Seesslen | | 4 | Value | 32Bit | |
| 26 | 28 | Maximilian Seesslen | |
| 27 | h2. Values |
||
| 28 | |||
| 29 | * Date: year 2B, month 1B, day 1B |
||
| 30 | * Time: hour 1B, minute 1B, second 1B, subsecond 1B |
||
| 31 | 12 | Maximilian Seesslen | |
| 32 | h2. Device behaviour |
||
| 33 | 1 | Maximilian Seesslen | |
| 34 | All devices should shut down after 5 hours when no master-heartbeat is received. |
||
| 35 | |||
| 36 | 12 | Maximilian Seesslen | h1. IDs, ranges and commands |
| 37 | 17 | Maximilian Seesslen | |
| 38 | 29 | Maximilian Seesslen | h2. CAN IDs |
| 39 | |||
| 40 | 36 | Maximilian Seesslen | * 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F |
| 41 | 2 | Maximilian Seesslen | * 29-Bit-Identifier, (CAN 2.0B); 0x20000000 |
| 42 | 1 | Maximilian Seesslen | |
| 43 | |_. Range |_. Decription |_. Examples | |
||
| 44 | 37 | Maximilian Seesslen | | 0x01-0x0F | Network Manager | PC | |
| 45 | 36 | Maximilian Seesslen | | 0x10-0x2F | Active controller | CANDis | |
| 46 | | 0x30-0x4F | Actor | CANSwitch | |
||
| 47 | | 0x50-0x6F | Sending sensors | Sensemux | |
||
| 48 | | 0x70-0x7F | Passive Sensors | CANRec | |
||
| 49 | |||
| 50 | 2 | Maximilian Seesslen | |
| 51 | h2. Global actuator |
||
| 52 | 1 | Maximilian Seesslen | |
| 53 | 14 | Maximilian Seesslen | Global means that all actuators of an type is addressed and not one concrete partipiant. |
| 54 | 2 | Maximilian Seesslen | An specific partipiant can be specified when sending the target CAN-Id in the value. |
| 55 | In this way the message is still high priority other than the "Remote Transmission Request" |
||
| 56 | 3 | Maximilian Seesslen | |
| 57 | |_. ID |_. global actuator |_. Decription | |
||
| 58 | 39 | Maximilian Seesslen | | 0x01 | System command | Perform system command; e.g. reboot, poweroff | |
| 59 | | 0x02 | Date/Time | Set date/time of all actuator | |
||
| 60 | | 0x03 | Illumination | Set brightness of lamps | |
||
| 61 | | 0x04 | Powerswitch | Power on devices | |
||
| 62 | | 0x05 | Plant watering pump | Automatically watering indoor plants | |
||
| 63 | 12 | Maximilian Seesslen | |
| 64 | 1 | Maximilian Seesslen | h2. System commands |
| 65 | |||
| 66 | 12 | Maximilian Seesslen | |_. Sub-ID |_. Type | |
| 67 | | 0x0 | Shutdown | |
||
| 68 | | 0x1 | Heartbeat | |
||
| 69 | |||
| 70 | h2. Illumination commands |
||
| 71 | 13 | Maximilian Seesslen | |
| 72 | |_. Sub-ID |_. Type | |
||
| 73 | | 0x0 | Set ambient light | |
||
| 74 | | 0x1 | Get ambient light | |
||
| 75 | | 0x2 | Set ambient light, fading | |
||
| 76 | | 0x3 | Get ambient light, fading | |
||
| 77 | 1 | Maximilian Seesslen | | 0x4 | Set plant light | |
| 78 | | 0x5 | Get plant light | |
||
| 79 | |||
| 80 | h2. Powerswitch commands |
||
| 81 | |||
| 82 | |_. Sub-ID |_. Type | |
||
| 83 | | 0x0 | Set powerline for multimedia | |
||
| 84 | 17 | Maximilian Seesslen | | 0x1 | Get powerline for multimedia | |
| 85 | |||
| 86 | |||
| 87 | h1. Multipacket-Strings |
||
| 88 | |||
| 89 | |_. Address |_. Type | |
||
| 90 | | 0x0 | Package count | |
||
| 91 | | 0x1 | Package number | |
||
| 92 | | 0x2..0x3 | Data | |
||
| 93 | |||
| 94 | h1. Actuator introduction |
||
| 95 | 1 | Maximilian Seesslen | |
| 96 | 18 | Maximilian Seesslen | When introduction is requested by system command, each device must send description for each subid. |
| 97 | |||
| 98 | h1. Example |
||
| 99 | 23 | Maximilian Seesslen | |
| 100 | h2. Turn on the lights |
||
| 101 | 27 | Maximilian Seesslen | |
| 102 | |_.Data |_.Size |_.Description | |
||
| 103 | |0x100 | 29 Bits | CAN-Id: Global command | |
||
| 104 | |0x0 | 1 Byte | Message-Type: Global command | |
||
| 105 | |0x0 | 1 Byte | Sub-Id: Set ambient light | |
||
| 106 | |0x1 | 1 Byte | Data-Type: Integer | |
||
| 107 | |0x1 | 1 Byte | PWM: PWM permilli | |
||
| 108 | |1000 | 4 Byte | Value: Full Brightness | |
||
| 109 | 15 | Maximilian Seesslen | |
| 110 | |||
| 111 | h1. Usecases |
||
| 112 | |||
| 113 | * simple actors can filter message to "Global actuator" messages, at least "system commands" |
||
| 114 | 25 | Maximilian Seesslen | * There are 14 or 28 Filters on STM32Fs |
| 115 | |||
| 116 | h1. ID Assigning |
||
| 117 | |||
| 118 | Some STM32 have an internal 96-bit unique ID. |
||
| 119 | |||
| 120 | h1. V2 |
||
| 121 | |||
| 122 | |_. Size |_. Decription |_. Examples | |
||
| 123 | | 1 | Packet type | Standard TDT packet | |
||
| 124 | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set | |
||
| 125 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String | |
||
| 126 | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room | |
||
| 127 | | 4 | Value | 32Bit | |
||
| 128 | |||
| 129 | h2. Multimessage package |
||
| 130 | 30 | Maximilian Seesslen | |
| 131 | 31 | Maximilian Seesslen | There should be the posssibillity to write the complete SPI-Flash even if it takes forever. |
| 132 | Not every slave needs to be able to send super big blocks. But every slave should be able to |
||
| 133 | 30 | Maximilian Seesslen | send e.g. descriptions. |
| 134 | 32 | Maximilian Seesslen | |
| 135 | * Is order of messages an issue? Multiple Mailboxes. |
||
| 136 | 25 | Maximilian Seesslen | |
| 137 | |_. Size |_. Decription |_. Examples | |
||
| 138 | | 1 | Packet type | Multimessage package | |
||
| 139 | | 1 | count | Number of packages | |
||
| 140 | | 1 | number | 0: value=data length in bytes | |
||
| 141 | | 4 | Value | 32Bit | |
||
| 142 | |||
| 143 | |_. Size |_. Decription |_. Examples | |
||
| 144 | | 1 | Packet type | Multimessage package 2 | |
||
| 145 | | 1 | id | Mailbox | |
||
| 146 | | 1 | number | 0: value=data length in bytes | |
||
| 147 | | | | 1: value=number of messages | |
||
| 148 | 31 | Maximilian Seesslen | | | | 2..x: data | |
| 149 | 30 | Maximilian Seesslen | | 4 | Value | 32Bit | |
| 150 | |||
| 151 | 1 | Maximilian Seesslen | h2. Diagnose |