Documente Academic
Documente Profesional
Documente Cultură
Device: openPicus FLYPORT and EnOcean Nest IDE version: 2.2 External Libs: EnOcean_ESP3, tools OpenPicus Free IDE Connections: -
Description
This app is a simple example of how to use the EnOcean NEST to interface Flyport modules with the EnOcean sensors and actuators.
The provided firmware contains libraries able to send and receive the EnOcean radio packets.
Brief introduction
EnOcean NEST can be used with both FLYPORT Wi-Fi or FLYPORT Ethernet modules. EnOcean is a wireless standard for Home Automation devices. The main advantage of this technology is the installation it's very easy (no wires and no masonry works needed). EnOcean pushes technology and environmental responsibility to the limits. EnOcean modules combine micro-energy converters with ultra low power electronics and reliable wireless communications. This enables EnOcean customers to create self-powered wireless sensor solutions that are fundamental for efficiently managing energy in buildings and industrial applications (please refer to www.enocean.com for further reference). This expansion board is a great tool to create Smart Building automation based on Flyport programmable modules. Create a low cost Internet gateway for EnOcean devices to access your home using a Smartphone or a Tablet. Onboard is the 868Mhz EnOcean transceiver TCM-310 connected to Flyport using UART port. The source code available let's you send/receive EnOcean telegrams to/from the devices.
EnOcean libraries
The libraries needed by EnOcean NEST are EnOcean_ESP3 and tools. EnOcean_ESP3 library performs the validation of data with CRC8 calculation, in both receive and transmit directions.
Command
UARTSendPacket ( int port, UINT8 *buf) getPacket ( UINT8 *pBuffer, UINT32 length)
Description
Function to send the provided radio telegram over the air. UART port to use packet to send Function to process the received radio telegram. The buffer that contains the data to process and validate The length of data
www.openpicus.com
rev.1.0 19.09.2012
Page
Every radio telegram have a ESP3 packet type. To help with the hex code of the different types the following enumeration is defined inside EnOcean_ESP3.h: typedef enum { RADIO = 0x01, RESPONSE = 0x02, RADIO_SUB_TEL =0x03, EVENT =0x04, COMMON_COMMAND = 0x05, SMART_ACK_COMMAND = 0x06, REMOTE_MAN_COMMAND = 0x07 }ESP3_PACKET_TYPE;
The receive is continuously checked by the condition if(UARTBufferSize(2)>1) { vTaskDelay(20); char receivedPacket[257]; toRead = 0; toRead = UARTBufferSize(2); UARTDebug32("\r\n Byte to read= ",toRead);
www.openpicus.com
rev.1.0 19.09.2012
Page
UARTRead(2,receivedPacket,toRead); result = getPacket((UINT8*)(receivedPacket), toRead); UARTDebug("\r\n return = ", result); UARTWrite(1,"\r\n"); IOPut(p19, toggle); IOPut(p21, toggle); UARTFlush(2); }
www.openpicus.com
rev.1.0 19.09.2012
Page