Sniffing the Lutron radio

How does the Wink Hub do what it does? What's stored in the database? What does the aprond daemon do? what does aprontest communicate with? What is the ultimate question?
evq
Posts: 4
Joined: Fri Feb 20, 2015 2:27 pm

Sniffing the Lutron radio

Postby evq » Fri Feb 20, 2015 2:37 pm

I've been poking at the Lutron radio and I've managed to put a sniffer in between the lutron-core daemon and the tty.

I've created a buildroot for the Wink hub that might be interesting to others https://github.com/evq/imx28-buildroot

Using this buildroot I cross compiled slsnif and set it up to listen directly to the Lutron radio tty and serve up a fake tty which lutron-core can then interface with. It quickly become apparent when playing with a paired Lutron Pico remote that the radio was forwarding event data to lutron-core, rather then lutron-core polling. I've written a toy golang program that will listen to the data coming off slsnif and make calls to an arbitrary REST interface. I'm currently using it to control a lights API that I've written, but it might also be interesting to hook it into something like openhab.

https://github.com/evq/lutron-spy

This place seems pretty sparse so I've kept things short, but if anyone has more questions I'll try to answer them :)

Jonesie
Posts: 23
Joined: Sat Feb 14, 2015 11:22 am

Re: Sniffing the Lutron radio

Postby Jonesie » Thu Mar 05, 2015 11:24 am

Hey eqv,
Thanks for the excellent write up! I have a quick question for you regarding the slsnif.

I have been working on getting slsnif to compile on a Linux VM using the i.MX28 from Freescale, and I think I've got that working properly. My big problem now is that I don't know what to do to get slsnif to compile for the imx28. All the Googling I've done just leads me to pages about the setup, but not how to actually compile a program.

If you could point me in the right direction, I would be grateful. If you could provide me with a Wink-compiled version of slsnif, that would be even better. :)

Thanks - Jonesie

JustinAiken
Posts: 9
Joined: Sat Mar 21, 2015 3:17 pm

Re: Sniffing the Lutron radio

Postby JustinAiken » Sat Mar 21, 2015 3:28 pm

So if I wanted a remote to control lights, I'd need to:

- Buy a http://www.amazon.com/Lutron-PJ2-WALL-WH-L01-Remote-Control-Mounting/dp/B00JR202JQ/
- Clone https://github.com/evq/imx28-buildroot onto my rooted hub
- Get http://www.freescale.com/webapp/sps/sit ... e=IMX28_SW
- Untar ^^
- Place ^^ in the imx28-buildroot directory created from the git clone in the step above
- Run `docker build -t imx28 .` in that directory
- Install `goxc` (How do I do this? I tend to be lost on linux if I can't do `apt-get install thing`
- Clone https://github.com/evq/lutron-spy to the rooted hub
- Go to that directory and type `goxc`, which complies the .go files into the binthing
- Set up the json config file
- `/etc/init.d/S60lutron-core stop` (Is this something that's from Wink, or created from your programs/steps??)
- `vi /etc/lutron.d/lutron.conf` as shown
- `./slsnif /dev/ttySP2 -x | ./lutron-spy &
- `/etc/init.d/S60lutron-core start`
- `aprontest -a -r lutron`
- ???
- Profit!!

Do I have that about mostly correct? If so, I think I'm going to order a pico or 4 and go for it...

Also, could you share your openHAB bindings/setup around it?

evq
Posts: 4
Joined: Fri Feb 20, 2015 2:27 pm

Re: Sniffing the Lutron radio

Postby evq » Fri Apr 03, 2015 4:52 am

Jonesie wrote:Hey eqv,
Thanks for the excellent write up! I have a quick question for you regarding the slsnif.

I have been working on getting slsnif to compile on a Linux VM using the i.MX28 from Freescale, and I think I've got that working properly. My big problem now is that I don't know what to do to get slsnif to compile for the imx28. All the Googling I've done just leads me to pages about the setup, but not how to actually compile a program.

If you could point me in the right direction, I would be grateful. If you could provide me with a Wink-compiled version of slsnif, that would be even better. :)

Thanks - Jonesie


Hey Jonesie, sounds like you're almost there :) It's been some time since I was messing around with this since my setup has been pretty stable. IIRC once you have the buildroot setup it's simply a matter of entering the buildroot shell (ltib -m shell) then building slsnif as you would normally (make etc). I think it setups up the env variables (CC, etc) properly. I've also attached my compiled version of slsnif, you can give that a try too.

JustinAiken wrote:So if I wanted a remote to control lights, I'd need to:

- Buy a http://www.amazon.com/Lutron-PJ2-WALL-WH-L01-Remote-Control-Mounting/dp/B00JR202JQ/
- Clone https://github.com/evq/imx28-buildroot onto my rooted hub
- Get http://www.freescale.com/webapp/sps/sit ... e=IMX28_SW
- Untar ^^
- Place ^^ in the imx28-buildroot directory created from the git clone in the step above
- Run `docker build -t imx28 .` in that directory
- Install `goxc` (How do I do this? I tend to be lost on linux if I can't do `apt-get install thing`
- Clone https://github.com/evq/lutron-spy to the rooted hub
- Go to that directory and type `goxc`, which complies the .go files into the binthing
- Set up the json config file
- `/etc/init.d/S60lutron-core stop` (Is this something that's from Wink, or created from your programs/steps??)
- `vi /etc/lutron.d/lutron.conf` as shown
- `./slsnif /dev/ttySP2 -x | ./lutron-spy &
- `/etc/init.d/S60lutron-core start`
- `aprontest -a -r lutron`
- ???
- Profit!!

Do I have that about mostly correct? If so, I think I'm going to order a pico or 4 and go for it...

Also, could you share your openHAB bindings/setup around it?


Hey JustinAiken. This is more or less correct. I've uploaded my precompiled verison of slsnif, and will also upload my compiled binary of lutron-spy in a few moments.The cross compiling step (goxc) as well as the clone of the lutron-spy take place on one's workstation, not the hub itself. Only the output linux arm binary is copied there.

With those two binaries in hand the process more or less boils down to your list:

- Buy the remote you linked
- Upload the binaries to the wink hub (make sure permissions allow them to be executed)
- `aprontest -a -r lutron` (Hold down the "on" button to pair IIRC)
- Set up the json config file (The remotes are indexed by serial number e.g. first one in the example is AEB551, so be sure to change these to match your paired remotes)
- `/etc/init.d/S60lutron-core stop` (Shutdown built in daemon on the wink to control lutron radio)
- `vi /etc/lutron.d/lutron.conf` as shown
- `./slsnif /dev/ttySP2 -x | ./lutron-spy &
- `/etc/init.d/S60lutron-core start` (Start up built in daemon, it initializes the radio we just spy on the result :)

I don't run openhab, I tried it some time ago but it just came across as rather over-complicated and bloated to me. A big part of that is the JVM, I just can't abide by it's standard footprint :)

I run all custom made home automation lighting and sensors. The various software glue is modular running in docker containers, a custom golang implementation of the Philips hue API sits in front of the lights, which is what you can see in the config example. I'm afraid that's probably the most transferable example I have, the other two APIs I'm planning on hooking up to it are my automatic window controls and my projector IR bridge which I am in the process of finishing off.

evq
Posts: 4
Joined: Fri Feb 20, 2015 2:27 pm

Re: Sniffing the Lutron radio

Postby evq » Fri Apr 03, 2015 5:00 am

I've uploaded a precompiled binary of lutron-spy here, upload limits on this forum seem to be rather small

http://dropcanvas.com/8qafu

Jonesie
Posts: 23
Joined: Sat Feb 14, 2015 11:22 am

Re: Sniffing the Lutron radio

Postby Jonesie » Mon Apr 06, 2015 7:33 am

Thanks, evq! I'll give this a shot this week.

Jonesie

JustinAiken
Posts: 9
Joined: Sat Mar 21, 2015 3:17 pm

Re: Sniffing the Lutron radio

Postby JustinAiken » Fri Apr 10, 2015 12:39 pm

Ooh awesome, thanks for the bins! Ordering a pico today, I'll report back how it goes.

JustinAiken
Posts: 9
Joined: Sat Mar 21, 2015 3:17 pm

Re: Sniffing the Lutron radio

Postby JustinAiken » Wed Apr 15, 2015 7:44 pm

evq, I'm having troubles getting this to work... could you compile a version with the DEBUG constant set to true? Might help me track it down..

EDIT - N/m, got it!

- The serial number isn't the one on the back of the remote, you have to get the integer serial number from the sqlite3 database (doesn't show up in aprontest), then convert it to hex.
- Also, looks like you have to start the sniffer/spy BEFORE the lutron-core...

timt
Posts: 1
Joined: Sat Sep 12, 2015 9:09 pm

Re: Sniffing the Lutron radio

Postby timt » Sun Sep 13, 2015 3:33 pm

Hi evq,

Sorry to resurrect this old thread.

Can you repost slspy, it has expired at the hosting site? Also I would like to request freescale build of socat.

I'm looking at building a basic binding for openhab to enable lutron support, by using socat to send the raw serial over tcp. I would rather do all the processing on my automation server rather than messing with the wink.

Tim

BotoTheClown
Posts: 6
Joined: Sun Jul 05, 2015 7:58 pm

Re: Sniffing the Lutron radio

Postby BotoTheClown » Mon Oct 05, 2015 6:59 pm

Good day!

First off, thanks for sharing your work. It's awesome! :)

I have Lutron-spy installed on my hub following these instructions: https://www.reddit.com/r/winkhub/commen ... _binaries/

I configured /etc/remote-config.json with the info matching my openhab config.

On Wink hub reboot, the file /etc/remote-config.json gets deleted (or more precisely it's size is set to 0)... I assume that's why this thing isn't working. When I press a button on the Pico remote, I see it in the serial port.

serial: ****** <-- serial # here
button: 4

Any idea what I need to do to have remote-config.json survive reboots?

Thanks!


Return to “How does it work?”

Who is online

Users browsing this forum: No registered users and 1 guest