Universal RF Receiver

13 replies [Last post]
brett
Offline
Providence, United States
Joined: 9 Jan 2010

For those that want to live on the edge.  I've posted beta 309.1 which has my new urf rx module.  This requires you to connect an Arduino with a RF receiever and feed the serial output to the Livebox for interpretation.  It should work on a HAHNode too if you wire it correctly.

There isn't any documenation on how this all works but if you are keen I can get motiviated to get some started, its on my do to list along with overhauling the pachube web page to xively.

I successfully got it to recieve the signal from Byron transmitter and have it decode, in the arduino, and the pulse stream corrected interpretted by the C backend on the Livebox - thus my beta posting.

Teaser of some debug output.

[inf][rfrx.c:101:serialInputHandler] Reset RF decoders
[inf][rfrx.c:85:serialInputHandler] -11248,400,-1056,1136,-336,400,-1056,400,-1056,416,-1056, 
384,-1072,384,-1072,400,-1072,384,-1072,400,-1056,400,-1056,1136,-336,400,-1072,384,-1072,384,
-1072,400,-1072,384,-1072,384,-1072,384,-1088,1120,-336,384,-1088,1120,-352,368,-1088,1120,-352,
368,-10016 [inf][urfdecoder.c:194:URFConsumer] MATCH - rf:2 on [inf][bsc.c:120:bscSetState] state=1 [inf][tx.c:19:xapSend] send xap-header { v=12 hop=1 uid=FF00EE02 class=xAPBSC.event source=dbzoo.livebox.urfrx:rf.2 } input.state { state=on }

There will be a new section which will look something like this and a new WEB tab to create it.

[urfrx]
devices=1
rf1.label=RF 1
rf1.off=0101017A0437046001600101271018401014
rf1.on=010201820436046A015601700436045001700101271018100001820339
enable=1
usbserial=/dev/ttyUSB1

Anyway  early days but it looking promising.

Brett

brett
Offline
Providence, United States
Joined: 9 Jan 2010
URF RX notes

I made a start on some notes: http://www.dbzoo.com/livebox/universalrfrx

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Auto correction of pulse lengths

Brett

Having a play with the URFRX. I can receive the RF streams sent out by the HAH but the pulse lengths vary a little too much.

e.g.

 -11200,1040,-336,336,-1024,1040,-352,1008,-352,336,-1040,1024,-336,336,-1040,320,

-1040,1040,-336,1024,-352,336,-1040,1024,-336,336,-1040,320,-1056,320,-1040,1024,-352,1008,

-368,320,-1040,1024,-352,1024,-336,336,-1040,1008,-368,320,-1040,320,-1056,1008,-10016

Using http://www.dbzoo.com/public/pulseTrainToURF.html I get

I would say that 0, 2 and 4 are actually the same pulse def, as are 1 and 3

If I manually edit the stream to this 

-11264,1024,-320,320,-1024,1024,-320,1024,-320,320,-1024,1024,-320,320,-1024,

320,-1024,1024,-320,1024,-320,320,-1024,1024,-320,320,-1024,320,-1024,320,-1024,

1024,-320,1024,-320,320,-1024,1024,-320,1024,-320,320,-1024,320,-1024,1024,-320,

1024,-320,1024,-10048

Then I get this definition

I have had a look at altering USECPERTICK but that had little effect

Is there a way to 'pull in' the pulses to set values?

Also I was hoping that this code would also pick up my HE light switches but it doesn't so I need to play some more 

Mark

brett
Offline
Providence, United States
Joined: 9 Jan 2010
The pulses will always float

The pulses will always float around like this so if you want to TUNE the definition down it has to be done by hand.
Capturing RF is a little tricky like this, and I didn't want to put too much intelligence into how the stream is interprets because guarantee once I did that it would be wrong anyway.

I think I had some HE light switches here and it captured those.   It might be the intergap has to be extended >10ms slightly.

#define _GAP 10000 // Minimum gap between transmissions (uS)

In the RFRX.h file.

Brett

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
I'll give it a try

Brett

I know for a fact that these light switches send out at least 3 different pulse streams. I presume to work with new and legacy HE devices. 

Mark

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Bsenode mod

I've modifed the basenode with RF receiver code to include the generalized 433MHz OOK decoder in the Jeelib samples.

This is an alternative to the URFRX code Brett has written. This code will decode the signals from HE, BBSB, Byron as well as some others. The decoder are all opensource. 

A typical output to the HAH would look like this 

OK 8 0 0 182 0

OK 3 47 0 187 0

OK 2 81 0 213 0

BBSBA 128 80 49 129

BBSBA 128 80 49 145

OK 7 12 0 196 0

This is showing the roomnode packets being received and the HAH sending BBSB commands to turn off the kitchen lights :)
A HE307 light switch would give code like this 
HE 77 43 173 204 212 44 1
HE 76 77 213 212 204 0
BBSBA 0 160 176 136
The second two lines are consistent, the first one seems to change with each press. 
With this info I can write a LUA script to set endpoints for the various devices based on physically pressed switches, PIR sensors etc
It's currently running on my HAH without issues. 
AttachmentSize
RFRXOOK020414.zip 7.22 KB
bobonline19
Offline
Joined: 4 Apr 2013
HAHCentral hex RF supoport

Hi all,

Does the compiled hex of HAHCentral or HAHCentral no config enable the RF support on pin 4?

I finally got my nodes built and hope to start using room nodes and URF soon. I have a 433MHz receiver connected to port 1 of my HAHCental none.

Thanks

Robin

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi Robin ,the hex files are

Hi Robin,

the hex files are older versions I believe.

you would be best to copy the text from here

https://code.google.com/p/livebox-hah/source/browse/trunk/userapps/ardui...

into the arduino IDE and upload to your node.

no config version not required anymore as node id hardcoded as you can see in above code, also, remember to uncomment the define RF bit.

 

Goodluck,

Garry,

 

ps this has rf on pin4, digital pin on port 1 (confusing...yeah!)

bobonline19
Offline
Joined: 4 Apr 2013
Thanks Garry,I got the IDE

Thanks Garry,

I got the IDE installed and the code compiled but ran out of time. Hopefully get it loaded and finally start testing nodes later this week.

Does it matter which target you select for a JeeNode? anything 328?

I assume it is AVR ISP to program vis the USB->Srrial cable?

Thsnks

Robin

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Robin, so far so good!i use

Robin, so far so good!

i use the duemilanove 328 but I guess as long as it's 328 16mhz, you'll be fine.

no need to worry about ISP, this is for burning bootloaders, node kits from the shop come with bootloaders already on.

just select the correct com port for your usb/serial lead and click upload! Job done.

Garry.

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Board selection

Hi Robin

I use Arduino Duemilanove w/ ATmega328 if the bootloader used was atmega (uses 57600baud) but some AVRs I have were programmed with the optiboot bootloader. These work (for me) using the Arduino Uno board setting (uses 115200baud)

If you find Arduino won't upload to AVR with Duemilanove and you are sure you have the right port selected, try the other.

Mark 

bobonline19
Offline
Joined: 4 Apr 2013
Thanks mark,garry I went for

Thanks mark,garry

 

I went for duemilanove 328 and that seemed to work. Used AVR ISP to program and then the serial monitor built into the ardunio ide to verify the function. All looks good do far although I'm not getting great range, need to check my antenna lengths next I think.

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Mark. I'm using your

Thanks Mark.

 

I'm using your sketch on my Basenode, i can detect most of my HE / BBSB kit using the jeelabs generalized OOK decoder

 

Andrew

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Hi Brett, I've had some

Hi Brett,

 

I've had some sucess with your URF Rx sketch but only with Home easy / BBSB kit

it doesnt seem to want to pick up any streams from other 433mhz kit - could this be as simple as the kit is not using OOK encoding

i expected to see something even if just vague pulses...

Thanks

Andrew

Hardware Info