This project will allow you to switch outlets/lights from your iPhone, or any browser.
You will also be able to send out serial commands remotely.
This project is based on SmartLinc.
http://www.smarthome.com/2412N/SmartLinc-INSTEON-Central-Controller/p.aspx
http://wiki.smarthome.com/index.php?title=2412_Manual_rev_2.0
Components
• OpenWRT compatible router, with serial header
• AVR microcontroller Development Board (like Arduino)
• Actuators like: RF switched outlets (433.92Mhz) with a remote
Remove these ads by
Signing UpStep 1: Overview
The Router runs a web server, you access it via browser.
After you push a button on the web page the router sends out a serial command,
we process this with a microcontroller, the AVR converts it to RF protocol, injects it into the RF remote, which controls the RF outlets.








































Visit Our Store »
Go Pro Today »




http://mrx23dot.blogspot.com/2012/01/cloning-upb-home-automation-system.html
Check for warnings. Also check your serial port address.
Command 'cd "/etc/config"'
failed with return code 0 and error message
-ash: groups: not found.
thank you
instead of using ipod 192.168.200
The protocol has addressing in it so you can control a lot of devices.
How aboute the software code for the arduino? Can you upload it?
http://thenewtech.tv/community/arduinox10-home-automation-over-wifi
i am stucked in this
more detail about
First start with a simple html file, then move on to the cgis.
Also the debug the serial connection by SSHing into the router and manually give out commands.
your help will be appreciated! thankx
Great project!
I am doing it, but I have a problem that hex data is not received correctly.
First I tried to send from the router to my PC via:
echo -e "\x9B\x11\x08\x22\xC5\x0D" > /dev/ttyS0
I received: 0x9B 0x11 0x08 0x22 0xC5 0x0D 0x0D 0x0A
I receive 2 bytes in excess and I don't know why!
Then I tried to send from the router to pic, then from pic to my PC to check the received data, I get only 6 bytes but all wrong, not the data I sent.
I am using pic18f452 as I didn't use avr before..
I think the problem is the interface circuit..I used shmitt trigger, res, cap as you did but it doesn't work. Is this circuit need to be modified to be suitable for PIC?
Thanks
I also had some hard time with the router's serial port, because it uses weird voltage levels like ~1.8V in idle.
I pulled up the TX line (from the router) to 3V3 (from Vdivider+Cap), you should fed this into two inverters (powered from 3v3). Measure this output in idle state, it should read 3-3,3V.
3V3 TX line should be enough for any kind of 5V MCUs.
For proper communication with the PC you need 3V3 TTL - RS232 converter,
for 5V converters you could use a second voltage shifter on the TX line.
And always use pull ups on the inputs. I'm guessing you got those extra bytes because of noise (generated by weak or omitted pull ups or low voltage levels on the converter). An oscilloscope would be very handy in these situations.
You can debug your PIC's FW by sending out the data from the PC to PIC. The baud is 115200 8N1
I can recommend this adapter, it works on 3V3 and 5V at any speed:
http://tinyurl.com/7nltcz6
I used the same cct in your schematic, but replaced smhitt trigger with 2 inverters
For excess bytes, it was CR & LF characters. echo -n solved this.
But when I send data from the PIC to the Router, How can I receive the data in index page for example?
echo -e -n "\x9B\x21\x01\x21\xBD\x0D" > /dev/ttyS0
I haven't done any two way communications yet.
But it should work like on a desktop PC:
http://www.linuxquestions.org/questions/linux-hardware-18/how-to-read-serial-port-dev-ttys0-494454
Check out the Cron scheduling service on the router, it can run commands on timely bases. Or run scripts like this:
run every 4min:
if ping google fails -> reset modem's switchable socket.
Or turn on sprinkler/Christmas lights at a given time.
I have inquiry about ADSL Modem and the Router connection. I have modem & router in one device TD-W8901G with default ip 10.0.0.1 and router wr741nd default ip 192.168.1.1
I must connect cable from router to my PC to be able to acess 192.168.1.1
Can I access this page without the need for the cable? My PC is connected to the internet via wireless from TD-W8901G, in another words,, when I type 192.168.1.1 in my browser, the ADSL modem forward to the port where the router is connected to.
Also I want the web page 192.168.1.1:81 be public over the internet.
Same manner,The ADSL has real ip, for example 41.20.30.50. I want when some one enter 41.20.30.50:81 in his browser, my ADSL modem forward this to the port where the router is connected to, then the router forward to port 81, web page.
Is there a tutorial about how to do that?
Hope my question is clear enough! :)
For network setup refer to the image.
I am still confused with this setup. May you clear the steps please?
How to enable DHCP client?
How to get router's mac address?
Thanks
http://wiki.openwrt.org/doc/start
This is what I did for serial reception
First, I used voltage supply 3.3v to my PIC18F452 instead of 5v, and then connected the PIC and the Router directly without the need for inverters, shmitt trigger, ... etc
For reception to the router:
The firmware needs to be upgraded to add packages: coreutils, setserial, using commands opkg install/update
Then to receive data I used:
stty -F /dev/ttyS0 115200 cs8 -parenb ....
#there are many parmaeters to be set according devices specs
cat /dev/ttyS0 >> a.txt
#read data and save it a.txt file
setserial -a /dev/ttyS0 >> is used to check that the device is configured properly
For serial reception, I used only voltage divider at Rx of the router to make 5v --> 3.3v
And used command cat for reception, default baud rate 115200. I tried to send ASCII characters and received successfully. When I finish reception of HEX Data, I will attach the full program.
" Download WinSCP, to simply do this through SSH.
http://winscp.net/download/winscp429.zip
Set up a new connection:
Host name: normally 192.168.1.1 (by default)
Port: 22
User name: root
Password: what you gave after installation
File protocol: SCP "
but what do you mean by " Password: what you gave after installation " ?
do u mean the installation of OpenWRT firmware on the router?
http://wiki.openwrt.org/doc/howto/firstlogin
After the first login, I changed my password then I login again using:
ssh root@192.168.1.1
I tried to install the web UI using Luci due to I'm using MacOS,
but when I tried to update opkg with the command :
opkg update
It failed(as shown in the image attached), it seems like it has no internet connection,
but in fact, I'm able to browse websites on my browser.
Hope you could help me with this and sorry for my ignorance.
instead of the bleeding edge, download the latest: Backfire 10.03.1 final firmware which already has web GUI in it.
This will save you a lot of time.
https://openwrt.org/
you can do it with PUTTY:
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
but you need to know linux command line, because it doesn't have any GUI.
WINSCP should work easily on any PC
http://tinyurl.com/3ft8u62
maybe try older versions, or ask for support.
cheers,
Can you elaborate in more detail how to set up and configure the 741 so it allowed to remote control from outside wifi network (from internet)?
- 1st 2 arrows: Schmitt trigger inverters, in one package you get 6 of them, the last 2 of them are unused (so they had to be terminated properly)
- the PSU nets are only connected logically, in the schematic
- the last one is an LED
I wouldn't recommend this project for beginners, first you should learn the basics on an Arduino.
Cheers,
Greets max