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

/media/uploads/charly/elv_max_fensterkontakt.jpg

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 /media/uploads/charly/_scaled_rfm22.jpg

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
0Bmessage length in bytes(without CRC)
48message counter
00flag??
30type; 30=window contact
06 0F 1Fsource address (ID of sensor)
00 00 00destination address (0 = broadcast)
00groupID??
02payload (02=open, battery good, 00=closed)
72 D5CRC

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
0Cmessage length in bytes(without CRC)
30message counter
02flag??
50type; 50=PushButtonState
04 B5 F7source address (ID of sensor)
00 00 00destination address (0 = broadcast)
00groupID??
00 01payload (01=AUTO, battery good, 00=ECO)
56 25CRC

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
17message length in bytes(without CRC)
A0message counter
04flag??
00type; 00=PairPing
04 B5 F7source address (ID of sensor)
00 00 00destination address (0 = broadcast)
00groupID??
12 05 0F 4A 45 51 30 34 36 39 33 39 30Payload

Description of Payload:

12 05 0F???
4A 45 51 30 34 36 39 33 39 30SerialNumber in ASCII: "JEQ0469390"

Future work

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:

18 Oct 2013

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

19 Oct 2013

Hi Florian!

Yes I'm trying to send valid MAX!-Messages. I've tested some different configs. But at the moment I only get the IPREAVAL-Interrupt for these messages. There seems to be a problem on sending the valid Sync-Word. I can't detect the ISWDET for the SyncWord at the moment.

And it seems I have a problem with my setup on mbed: When I add a

led1 = 1;

in the ISR to show which interrupt occurred, my mbed crashes when it receives a MAX!-Message from an original MAX!-Device. Strange!

I can give you my actual setup for my FRM22 or my testprogramm for sending.

Charly

Please log in to post comments.