PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Using Raspberry Pi To Create Home Automation! and access from anywhere online!

Go down

Using Raspberry Pi To Create Home Automation! and access from anywhere online! Empty Using Raspberry Pi To Create Home Automation! and access from anywhere online!

Post by jamied_uk 25th January 2014, 16:24

The basics!

First you will need
1 x raspberry pi (model b)
1 x 2 module relay switch board for aduino or raspberry pi (1 minimum) 5v look on ebay!
1 x 8 gb sd / micro sd card (8gb minimum)
1 x power source for rpi
4 x wires for gpio pins (4 wire minimum) found on ebay
1 x weakened to get to grips with experimenting with this project!

I recommend looking on google and youtube and searching as much as you can with raspberry pi or aduino or if you want to just buy 1 of these from me see my information below!

Download raspbian (linux) os.

http://www.raspbian.org/RaspbianImages

To allow the user to control the gpio pins using python software accessible with also php and javascript languages you may need to install this gpio library (see below).

To install gpio library for python and raspberry pi

Code:
sudo apt-get update
sudo apt-get -y install python-rpi.gpio


Code:
For other methods and resources google search or visit the link below


Code:
http://www.openhomeautomation.net/control-a-relay-from-anywhere-using-the-raspberry-pi/


On my own I am using JavaScript, python, css, php, database, ftp, ssh, phpmyadmin , webserver and pages to remotely access this automation system from potentially anywhere!
I also set my rpi to auto login, and have a static ip on my local home network, then use port forwarding to set a remote access port, I use php security scripts to protect and secure pages that can change switch states, I use database to store each switch change and other useful tracking information like ip etc,

Also I have ftp so i can remotely update this stup, ssh so i can connect securely to this setup!
crontabs (cronjobs) so that i can automate the whole system.


Other useful rpi related links for this forum

https://jnet.forumotion.com/search?search_keywords=raspberry+pi


Last edited by jamied_uk on 2nd August 2014, 11:39; edited 14 times in total
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Using Raspberry Pi To Create Home Automation! and access from anywhere online! Empty Re: Using Raspberry Pi To Create Home Automation! and access from anywhere online!

Post by jamied_uk 2nd August 2014, 10:10

Creating php functions



Creating a php function (after gpio library is installed)


Code:
exec("gpio -g mode 4 out");

$state = $_GET["total"];


Code:
if ($state == "on"){

   exec("gpio -g write 4 1")

sleep(1);

  exec("gpio -g write 4 1")

}

As you can see you can make the above examples into a specific function

Code:
function Switch01Toggle {
if ($state == "on"){
exec("gpio -g write 4 1")
} else {
exec("gpio -g write 4 0")
}

Code:
1 = on and 0 = off


More on this can be found on github

https://github.com/openhomeautomation/Raspberry-Pi-Remote-Relay/blob/master/command.php



There are different or better ways to do all this and if you wish feel free to share your methods or links to them here!


Last edited by jamied_uk on 2nd August 2014, 11:04; edited 1 time in total
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Using Raspberry Pi To Create Home Automation! and access from anywhere online! Empty Re: Using Raspberry Pi To Create Home Automation! and access from anywhere online!

Post by jamied_uk 2nd August 2014, 10:21

I have wrote 3 projects 1 for 2 module switch, and 1 project for 8 module switch! and also 10 switch module.

Please let me know if you want a custom built raspberry pi already setup and ready to go! i will provide 2 switch automation for £60 and 8 switch for £100, also 10 switch for £150. get in touch with me for more details!


You will have a custom made secure remote accessible for use with upto 10 amp per 1 module in either ac or dc current, you could even combine these to get higher amps for example 2 x 10 amps is 20 amps.

you could even switch data with this to redirect or cut of telephone or network routes!


It will be fully working with its own ip will have 8 gb (at least)
Will be accessible though http, ftp, ssh with a password (you can edit or ask for specific password to be used).
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Using Raspberry Pi To Create Home Automation! and access from anywhere online! Empty Re: Using Raspberry Pi To Create Home Automation! and access from anywhere online!

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum