(This Howto only works at the moment with elro switches. The codes used for the switches can be changed in the switch command you find in home/piphie/switch (see *).
We are at our home able to switch on a video screen, Google Chromecast, and our HiFi stereo by the App FunkySwitch. Then we start the Netflix App on a Phone, connect it with Chromecast and watch whatever we find on Netflix. If we'd like to switch off some light in the room, we turn its current off by using FunkySwitch. To accomplish that one can follow the following howto. We do this on Ubuntu 14.04 LTS. However, the steps can be found for Windows and Mac, too.
First hardware needs:
- Raspberry Pi (Raspberry Pi model A+ here)
- a 433 MHz sender
- e.g. a raspbian image (here I used 2015-05-05-raspbian-wheezy)
- a SD-Card (I used for the A+ Pi a micro SDHC card)
- (a SD-Card reader)
- (a wireless USB adapter)
- (an USB Hub with over 2 USB ports)
- some micro USB cable with power adapter
- some HDMI cable
The software we used are
After downloading Raspbian we follow the official documented steps to install the image on the SD-Card. We did this by using (sdb is the sd-card in my case. If unsure, look here for explanations):
unzip 2015-05-05-raspbian-wheezy.zip
unmount /dev/sdb1 # this was only in our case. Use the sd* that fits your SD-card.
sudo dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sdb
syncIf the card was remounted, unmount it again. Put it now into the Raspberry Pi, plug in Hub, keyboard, and network. We here use the wireless adapter. Therefore this has to be configured in /etc/network/interfaces. After changing the file, the service is restarted.
sudo nano /etc/network/interfacesChange this file to
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ap-scan 1
wpa-scan-ssid 1
wpa-ssid "WLAN-NAME"
wpa-psk "WLAN-KEY"And do the restart.
sudo service networking restartAfter this we need for ease-of-use and for automation the ssh-server capability.
sudo apt-get install openssh-serverHowever, this was not necessary for us. It seems to be pre-configured in raspbian.
The software
wiringPi
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core # was already newest version...
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
rcswitch-pi
git clone https://github.com/r10r/rcswitch-pi.git
cd rcswitch-pi
make
piphie commands
These scripts are small and at the moment very easy. However, have a look at it and you can change them to your needs.
git clone https://github.com/Boltzmann/piphie.git
some minor things...*
cd
mkdir bin
ln -s /home//rcswitch-pi/send .
ln -s /home/To have easy ssh access on the raspberry use authentificaton with keys. In short, you need/ piphie/switch .
ssh-keygen
ssh-copy-id -i .ssh/Now, load FunkySwitch, add your key into "SPECIALS"-"IMPORT RSA KEY", in settings specify.pub @