3.4. EnOcean¶
The venocean interface allows a ME to communicate with EnOcean devices. EnOcean devices have multiple applications:
EnOcean Sensors (Temperature, Humidity, Light, …)
EnOcean Switches (Light, Power, …)
EnOcean Actuators (Light, Relay, …)
The figure below represent all the interactions to communicate with a EnOcean device.
3.4.1. EnOcean transceiver¶
The EnOcean transceiver supported is the TCM515. The TCM515 provides a radio link between EnOcean devices and an external host connected via a UART interface. It handles the ERP (EnOcean Radio Protocol) and embed the data in a ESP3 (EnOcean Serial Protocol) packet. ESP3 is the protocol used to communicate from a host device to the TCM515. It can be used to send and receive EnOcean radio telegrams as well as configure the TCM515 itself.
3.4.2. TCM515 driver¶
A TCM515 driver has been implemented in order to communicate with the TCM515. It uses the serdev framework to access the serial port. To assign a serial port to the driver the following dts subnode must be added to the chosen UART:
&uart<nr> {
...
status = "okay";
enocean {
compatible = "enocean,tcm515";
current-speed = <57600> /* default baudrate */
};
};
The driver allows other drivers to subscribe to it. When new data is received each subscriber will receive it. A write function to send data to an EnOcean device is also available. If a response is expected its possible to set a one time callback.
3.4.3. ESP3 packet¶
Data structure:
Byte |
Group |
Content |
Value hex |
Description |
---|---|---|---|---|
0x00 |
None |
Sync byte |
0x55 |
|
0x01 |
Header |
Data length MSB |
0xnn |
|
0x02 |
Header |
Data length LSB |
0nn |
|
0x03 |
Header |
Optional length |
0xnn |
|
0x04 |
Header |
0xnn |
||
0x05 |
None |
CRC8 Header |
0xnn |
|
0x06 |
Data |
Data |
… |
Contains the EnOcean payload (telegram) |
0x06 + x |
Data |
Optional data |
… |
Contains additional data. Extends the data field |
0x06 + x + y |
None |
CRC8 data |
0xnn |
The EnOcean data is contained in the data field and it’s the only part of the ESP3 packet that the venocean backend sends to the venocean front end. The rest of the data is used by the TCM515 driver.
3.4.4. venocean backend¶
The backend subscribes to TCM515 driver to receive EnOcean telegrams. When new data is received the backend extract the data part of the ESP3 packet and forward it to the venocean front end through the shared ring.
3.4.5. venocean front end¶
The front end received the EnOcean telegram through the shared ring. An ME can get the EnOcean data by calling the venocean_get_data() function. This function is blocking and will return only when new data is received.
3.4.6. Supported EnOcean devices¶
Here is a list of supported EnOcean devices. This devices have been tested and work with the TCM515 transceiver. The EnOcean telegrams are organized as shown in the EnOcean equipment profiles.
3.4.6.1. Switches¶
PTM210 frame format:
Byte |
Content |
Value hex |
Description |
---|---|---|---|
0x00 |
RORG |
0x76 |
Radio telegram type RPS |
0x01 |
Data |
0xnn |
|
0x02 - 0x05 |
Sender ID |
0xnnnnnnnn |
EnOcean Unique ID |
0x6 |
Status |
0xnn |
Status bits |
More to come …
3.4.7. Future developments¶
BE/FE add possibility to send EnOcean telegrams from the front end.
Implement more TCM515 commands as needed and provide an interface (sysfs ?) to interact with the TCM515.
BE supports for multiple FEs