Reading ELV® MAX! Wireless Devices like Window sensor with RFM22 and mbed
.
Abstract
Here http://mbed.org/users/charly/notebook/connecting-a-radio-window-shutter-contact-to-knx/ I described how to connect a wireless window shutter contact via a RFM12-transceiver-module to my KNX-home automation system. As the decoding of the messages has to be done by the mbed and not by th RFM12 there is not much time to do other tasks beside. The modules are now at the end of live phase and that was why I was searching for a new solution!
The same producer ELV® has now a product line called MAX! http://www.elv.de/max-funk-heizungsregler-system.html, which is sold by some distributors.
Other fellows http://www.fhemwiki.de/wiki/MAX , http://sourceforge.net/p/culfw/code/388/tree/trunk/culfw/clib/rf_moritz.c, http://www.domoticaforum.eu/viewtopic.php?f=66&t=7015&start=15 , http://www.mikrocontroller.net/topic/160474#1605728 where able to decode most of the rf-protocol.
And here https://github.com/matthijskooijman/arduino-max is a solution, which uses the RFM22 modules from HopeRF, which I already used before and uses the RF22-Library I ported to mbed.
So I tried and was able to read the messages from the window sensor!
Hardware
Window Sensor
wireless window shutter contact by ELV ®: http://www.elv.de/max-fensterkontakt.html
The sensor sends one message for every change of state ( open /close, battery-good/low,others??), if it is not paired with another devices.
The sensor sends and waits for an ACK if paired with another device. It sends ?? times if no ACK is received. So you get a more reliable connection.
RFM22
by HopeRF, sold by many distributors
Details see http://mbed.org/users/charly/notebook/rfm22/
Connecting
Just connect the SPI-interface from RFM22 to the mbed (pins see http://mbed.org/users/charly/notebook/rfm22/
Software
Here is a test-program to see what the sensor is sending:
http://mbed.org/users/charly/code/RF22_MAX_test/
The test-program uses the RF22-Library
Import libraryRF22
Library for HopeRF RFM22 / RFM22B transceiver module ported to mbed. Original Software from Mike McCauley (mikem@open.com.au) . See http://www.open.com.au/mikem/arduino/RF22/
Library RF22Max based on RF22:
Import libraryRF22Max
Class to communicate with ELV(R) MAX! wireless devices with RFM22B-Modules. Based on Library RF22. Initial version unable to send! Only receive! See http://mbed.org/users/charly/notebook/reading-a-max-wireless-window-sensor-with-rfm22-an/
Sample Output
Output of window-state change message
Recv: len: 255 F4 A9 1D AA EB 8A 2C 24 EA 7A D2 3B 02 42 22 0A 19 6B A9 CF E8 E8 E8 E8 E8 E8 E8 E8 E8 E8 len: 14 dewhiten: 0B 48 00 30 06 0F 1F 00 00 00 00 02 72 D5 Message count: 48 Flags: 00 Packet type: 30 (ShutterContactState) Packet from: 06 0F 1F Packet to: 00 00 00 GroupID: 00 Payload: 02 State: open Battery: good
Description of the RF-Protocol
MAX!-Window sensor sends window open message
from the example above
Message:
0B 48 00 30 06 0F 1F 00 00 00 00 02 72 D5
Description:
byte(s) | description |
---|---|
0B | message length in bytes(without CRC) |
48 | message counter |
00 | flag?? |
30 | type; 30=window contact |
06 0F 1F | source address (ID of sensor) |
00 00 00 | destination address (0 = broadcast) |
00 | groupID?? |
02 | payload (02=open, battery good, 00=closed) |
72 D5 | CRC |
MAX! ECO-Switch sends Auto message
Message:
0C 30 02 50 04 B5 F7 00 00 00 00 00 01 56 25
Description:
byte(s) | description |
---|---|
0C | message length in bytes(without CRC) |
30 | message counter |
02 | flag?? |
50 | type; 50=PushButtonState |
04 B5 F7 | source address (ID of sensor) |
00 00 00 | destination address (0 = broadcast) |
00 | groupID?? |
00 01 | payload (01=AUTO, battery good, 00=ECO) |
56 25 | CRC |
MAX! device sends PairPing message
Message:
17 A0 04 00 04B5F7 000000 00 12 05 0F 4A 45 51 30 34 36 39 33 39 30
Description:
This Message is sent at most 5 times if a device in in Pairing mode (for example by long pressing the ECO-Button on a button Switch. The device to be paired to mus return a PairPong Message
byte(s) | description |
---|---|
17 | message length in bytes(without CRC) |
A0 | message counter |
04 | flag?? |
00 | type; 00=PairPing |
04 B5 F7 | source address (ID of sensor) |
00 00 00 | destination address (0 = broadcast) |
00 | groupID?? |
12 05 0F 4A 45 51 30 34 36 39 33 39 30 | Payload |
Description of Payload:
12 05 0F | ??? |
4A 45 51 30 34 36 39 33 39 30 | SerialNumber in ASCII: "JEQ0469390" |
Future work
- Add support for other MAX!-Modules like eco-switch -> 09/2013 done
- Connect to my KNX-HomeAutomationSystem like here http://mbed.org/users/charly/notebook/connecting-a-radio-window-shutter-contact-to-knx/ -> 09/2013 done
- Add support for pairing the MAX!-devices with my mbed, so ACKs are sent -> not as easy as I thought, but work in progress...
A work in progress (still not working) version of a send-program can be found here
Import programRF22_MAX_test_Send
Test program to send MAX!-Messages with a RFM22-Module
Acknowledgements
to all the other people who helped to decode the protocol and providing libraries and code!
2 comments on Reading ELV® MAX! Wireless Devices like Window sensor with RFM22 and mbed:
Please log in to post comments.
hi, your work inspired me to port your code to a raspberry pi. at the moment i think i get most (maybe not all of the messages). i get a lot of IPREAVAL Interupts but i think i get not all messages. i had the same problem catching the overflow interrupt. i disabled it. i want to write messages in future. do you work on this topic? at the moment i have a lot of free time at the moment and will try it. maybe we can talk about some points of that topic.
cheers
florian