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