Posts mit dem Label Android werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Android werden angezeigt. Alle Posts anzeigen

Samstag, 13. Juni 2015

Howto home automation Raspberry Pi yet another way (The Pi)

We have our home automation set up our way. Here is how. In this post the configuration on the server side (rasperrypi) is described.

(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:


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 
sync
If 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/interfaces
 Change 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 restart
After this we need for ease-of-use and for automation the ssh-server capability.
sudo apt-get install openssh-server
However, 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//piphie/switch . 
To have easy ssh access on the raspberry use authentificaton with keys. In short, you need

 ssh-keygen
ssh-copy-id -i .ssh/.pub @
Now, load FunkySwitch, add your key into "SPECIALS"-"IMPORT RSA KEY", in settings specify and for "User name" and "Server name".


Mittwoch, 18. September 2013

Project Stereo 3 [alarm] (Projekt Hifi Anlage 3)

... and we did it! It is the opposite of a wonderful morning if you have to wake up at 3.30 h. However, the last time it was terrific. At 3.30 h my bedside lamp came on. Ok, this is not that nice. But then we heard from a near distance the sound of boiling water. Two minutes later we stood up and had our first fresh cup of tea. The next time we will have a coffee machine connected to the wireless socket! And in a few months I will get a hot chocolate machine! And then we will have coffee, cacao and music!1!!

Sonntag, 15. September 2013

Project Stereo 2 (Projekt Hifi Anlage 2)

A set-up consisting of a stereo system, Raspberry Pi, a 433 MHz radio transmitter and Elro wireless electrical socket now works. We followed this HowTo (German) and had to look here for connection of the Raspberry pins to the sender module.

Today we wanted to be awakened by a cron job of our raspberry: Well, the pi did not do his job. We used rcswitch-pi. It seems that if you use two send commands at the same time (or too fast in succession), they won't work. Tomorrow we will try again!

Dienstag, 10. September 2013

davical

IT WORKS!!1! I GOT IT1!!

Used this howto ( german (similar) ). Beware of the dead links. This is why the installation is kind of hard. But if one follows the instructions and knows that a new user on the admin page is a new principal ;-), then things are fine.

CalDAV on Android and iCal communicate with my server.

Donnerstag, 17. Januar 2013

Android 4.2.1 - Jelly Bean - screen shots und log-files

So, habe ein neues Spielzeug. Damit möchte ich ein wenig programmieren. Aber was macht man, wenn man von der Umgebung keine Ahnung hat? Man versucht Programmierern zu helfen. Dabei lernt man. Das erste, was ich gelernt habe, ist wie man unter Android Jelly Bean 4.2 log-files erstellt.