LaFonera Hardware Controlling AC-Loads via webinterface
From DD-WRT Wiki
Revision as of 22:23, 22 November 2011 (edit) Sboger (Talk | contribs) (→A Different Method) ← Previous diff |
Revision as of 22:24, 22 November 2011 (edit) (undo) Sboger (Talk | contribs) (→GPIO matrix list) Next diff → |
||
Line 118: | Line 118: | ||
/proc/GPIO Pin on LaFonera | /proc/GPIO Pin on LaFonera | ||
0_dir TP3 | 0_dir TP3 | ||
- | + | ''' 1_dir pin 5 of SW1''' | |
2_dir WLAN LED | 2_dir WLAN LED | ||
- | + | ''' 3_dir pin 1 of SW1''' | |
- | + | ''' 4_dir pin 2 of SW1''' | |
5_dir RESET (!) | 5_dir RESET (!) | ||
6_dir RESET button | 6_dir RESET button | ||
- | + | ''' 7_dir pin 6 of SW1''' | |
Line 134: | Line 134: | ||
# echo 1 > /proc/gpio/3_dir #on | # echo 1 > /proc/gpio/3_dir #on | ||
# echo 0 > /proc/gpio/3_dir #off | # echo 0 > /proc/gpio/3_dir #off | ||
- | |||
===Fonera SW1 pinout=== | ===Fonera SW1 pinout=== |
Revision as of 22:24, 22 November 2011
You are here: DD-WRT wiki mainpage / LaFonera / Hardware / Controlling AC-loads via web-interface
Contents |
Turn a switch on/off using the web-interface
! Attention !
You will destroy the original Web-interface with this startup-script!
Do this only if you are familar with some rescue commands on the linux command-line on ssh!
Uses
- Hook it up to your car's door switch and open your car with your wifi enabled cellphone.
- If you have Remote Start System installed on your car you can hook up the remote control of the system to your f.i.c.s. (fonera internet controlled switch) and turn ON/OFF your car from the internet
- Open your house/garage door.
- Turn ON/OFF your POOL PUMP.
- Restart additional routers with f.i.c.s.
Parts needed
- New/Safer circuit will be posted soon.
Schematics
Router configuration
- Log on to your router (192.168.1.1)
- Go to Administration > Management
- enable jffs2
- Go to Administration > Services
- enable ssh
- Go to Administration > Commands
- type:
echo 1 > /proc/gpio/3_dir rmdir /tmp/www; ln -s /jffs/www /tmp
- Click Save Startup
- Now log on to your router using ssh
ssh root@192.168.1.1
- type:
cd /jffs mkdir www cd www mkdir cgi-bin cd cgi-bin wget http://wildblue.de/fonera/controlling_ac-loads/index wget http://wildblue.de/fonera/controlling_ac-loads/on wget http://wildblue.de/fonera/controlling_ac-loads/off wget http://wildblue.de/fonera/controlling_ac-loads/blink chmod +x on off index blink
- Now you can control the switch simply by clickin ON or OFF from your favorite browser (i use my cell phone to activate the switch thru the web interface). Since my linux kung-fu skills are not developed yet, it took me some time to get familiar with .sh scripts.
Original Idea
- http://www.cryptonoid.blogspot.com (f.i.c.s. Fonera Internet Controlled Switch)
- http://www.youtube.com/watch?v=wKPsH34InMo (Watch the f.i.s.c in action - video)
Development
since im not very good in programming shell scripts can someone write a Shell script where the user will be able to schedule the f.i.c.s. to go ON/OFF at certain times thru the web interface.
this page was made by wildblue!
A Different Method
The original author was on the right track. The easiest way to do this is with a solid state relay (SSR). Please note, relaying DC is VERY DIFFERENT from relaying AC.
Note, there are mechanical relays that can do DC or (BE CAREFUL, ONLY IF YOU KNOW WHAT YOU ARE DOING) AC. SSR's can only do AC, and will not switch DC current.
The diagram below shows how to connect an AC load, a AC LAMP to a solid state relay, and the relay to your FON. Substitute the FONs i/o pins (1,2,5,6) for "pin 12" in the picture.
Here is an example of a solid state relay. It can be purchased directly from Parallax[1].
GPIO matrix list
/proc/GPIO Pin on LaFonera 0_dir TP3
1_dir pin 5 of SW1
2_dir WLAN LED
3_dir pin 1 of SW1 4_dir pin 2 of SW1
5_dir RESET (!) 6_dir RESET button
7_dir pin 6 of SW1
So, if you connected your relay to pin 1 (the 'pin' with the arrow above it in the picture below) on the Fonera, you could run this command in DD-WRT to turn it on and off.:
[assuming you have telneted into your DD-WRT running Fonera]
- echo 1 > /proc/gpio/3_dir #on
- echo 0 > /proc/gpio/3_dir #off
Fonera SW1 pinout
--Sboger