EnOcean -> USB Serial Communication (C++)
Posted
by
regorianer
on Programmers
See other posts from Programmers
or by regorianer
Published on 2012-06-19T11:59:24Z
Indexed on
2012/06/19
15:23 UTC
Read the original article
Hit count: 482
I guess it is not the right place to ask here for enocean specific details, but maybe I am doing something wrong by using serial connections and you can help me no matter if there is knowledge about this technology or not.
I have a problem to communicate with the RCM152 Module.
I have written a C++ program to communicate with the RCM152 by emulating packets of the PTM 200. I teach the RCM152 to listen to the following packets:
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 55 <-- start byte
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 00 <-- head begin
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 07
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 07
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 01 <-- head end
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 7a <-- CRC Check
[06/19/12 04:21:44.546] INFO: SENDING BYTE : f6 <-- packet type
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 20 <-- My action (00 and 10 -> OFF, 20 and 30 -> ON)
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 00 <-- serial.byte 3
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 24 <-- serial.byte 2
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 21 <-- serial.byte 1
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 87 <-- serial.byte 0
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 30 <-- status
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 03 <-- 03 for send, 01 for receiver
[06/19/12 04:21:44.546] INFO: SENDING BYTE : ff <-- begin destination
[06/19/12 04:21:44.546] INFO: SENDING BYTE : ff
[06/19/12 04:21:44.546] INFO: SENDING BYTE : ff
[06/19/12 04:21:44.546] INFO: SENDING BYTE : ff <-- end destination
[06/19/12 04:21:44.546] INFO: SENDING BYTE : ff <-- Transmission quality (sender ff)
[06/19/12 04:21:44.546] INFO: SENDING BYTE : 00
[06/19/12 04:21:44.547] INFO: SENDING BYTE : 10 <-- CRC Check
A PTM200 Device or a SG-FUS-24-230 Device are sending equivalent packets like:
[06/19/12 04:30:31.106] INFO: Received Byte: 55
[06/19/12 04:30:31.106] INFO: Received Byte: 00
[06/19/12 04:30:31.106] INFO: Received Byte: 07
[06/19/12 04:30:31.106] INFO: Received Byte: 07
[06/19/12 04:30:31.106] INFO: Received Byte: 01
[06/19/12 04:30:31.106] INFO: Received Byte: 7a
[06/19/12 04:30:31.106] INFO: Received Byte: f6
[06/19/12 04:30:31.106] INFO: Received Byte: 40
[06/19/12 04:30:31.106] INFO: Received Byte: 00
[06/19/12 04:30:31.106] INFO: Received Byte: 24
[06/19/12 04:30:31.106] INFO: Received Byte: 6c
[06/19/12 04:30:31.106] INFO: Received Byte: 2f
[06/19/12 04:30:31.106] INFO: Received Byte: 30
[06/19/12 04:30:31.106] INFO: Received Byte: 01
[06/19/12 04:30:31.106] INFO: Received Byte: ff
[06/19/12 04:30:31.106] INFO: Received Byte: ff
[06/19/12 04:30:31.108] INFO: Received Byte: ff
[06/19/12 04:30:31.108] INFO: Received Byte: ff
[06/19/12 04:30:31.108] INFO: Received Byte: 37
[06/19/12 04:30:31.108] INFO: Received Byte: 00
[06/19/12 04:30:31.108] INFO: Received Byte: d1
I can control the device connected to the RCM152 like I want to with my sending packets (thats a good fact and means that the RCM152 has learned my packets and can use them. Also the actions (0x10 -> ON, 0x30 -> OFF) are working fine), but the problem is, that no matter which serial I choose, the RCM152 reacts to these packets. I only want to have actions if the teached-in serial is send and all other packets with different serials to be ignored. The RCM152 is not reacting to the packets sent by the PTM200 nor by the SG-FUS-24-230 because these are not teached-in. Thats exactly what I want to have with the packets created myself.
What am I doing wrong?
The libraries I am using are these for C++ http://pvbrowser.de/pvbrowser/sf/manual/rllib/html/
The enocean EEP says: For this purpose of a determined relationship between transmitter and receiver each transmitting device has a unique Sender-ID which is part of each radio telegram. The receiving device detects from the Sender-ID whether the device is known, i.e., was already learned, or unknown. A telegram with unknown Sender-ID is disregarded.
© Programmers or respective owner