Fork me on GitHub

openWRT smart home

Turn a cheap TL-WR703n OpenWRT router into a home automation system. This project is a little different then the others out there. This is without an extra micro controller, just a cheap 5$ 433mhz transmitter.

What you need:
1. TL-WR703n
2. 433 mhz transmitter $3,49 on ebay
3. Some 30 awg wire
4. Wireless power switch

There is a lot of projects like this where a openWRT router is connected to an Arduino. I wanted to cut the Arduino and do it directly from the router. The TL-WR703n has some free GPIO's so this should work. This gives you a system that can connect to an access point or be an access point. The way I've set it up it connects to an AP and does a long pull on a web server waiting for it's next command. When it gets the command it sends a signal to the Nexa power controller which turns the lights on or off.

If this is your first time soldering this project is not for you. I will not take responsibility for any damage this might cause. Do it at your own risk, it's easy to brick the router. First remove the pull down resistor R17. Next solder a wire to this point. This is GPIO 29. Next solder the wire to the signal pin on the transmitter. Next turn the board over and solder two wires to the pads as shown bellow. This is GND and 3.3v.

Now ssh in to your router and upload the .ipk (needs to be compiled from source). Next run "opkg install smarthome_1_ar71xx.ipk" Then start the program and it should work. I also use "screen" to keep it running when i log out. That's it you now have a TL-WR703n controlling your home

Since this is not a real time system the processor will get other tasks while it's controlling the GPIO. This leads to some variance in the timing of the signal. But luckely it still works.

The Nexa protocol

There are some other open source projects controlling sockets like this, but non worked withe the Nexa sockets. Therefore i had to reverse engineer the protocol. To do this I used a logic analyzer hooked up to the remote. Then it was just a matter of getting the timing right on the router (this was a pain). You can see the output from the router in the image.