Pas Home - Index
This week, like many, I made a little prototype with openHAB and sensors. Here's my recipe and a video
Cette semaine comme beaucoup, j'ai fait un petit proto avec openHAB et les capteurs. Voici ma recette et une video
Here is my installation procedure on my two raspberrypi
Voici ma procédure d'installation sur mes deux raspberrypi
For my first raspberrypi with owfs and node.js
Pour mon premier raspberrypi avec OWFS et node.js
# Step 1 Prepare - Download RASPBIAN Debian Wheezy http://www.raspberrypi.org/downloads/ - Format SD Card with SDFormatter.exe https://www.sdcard.org/downloads/formatter_4/eula_windows/ - Write Raspbian with win32diskimager-v0.9-binary http://sourceforge.net/projects/win32diskimager/ - Boot raspberrypi and configure setting timezone, password, keyboard and internet - Update raspberrypi sudo apt-get update sudo apt-get upgrade sudo reboot - Activation de l’I2C (http://innovelectronique.fr/2013/03/02/utilisation-du-bus-i2c-sur-raspberrypi/) # Replace 'blacklist i2c-bcm2708' with '#blacklist i2c-bcm2708' in /etc/modprobe.d/raspi-blacklist.conf sudo sed -i 's/blacklist i2c-bcm2708/#blacklist i2c-bcm2708/g' /etc/modprobe.d/raspi-blacklist.conf # Add 'i2c-dev' in /etc/modules sudo sed -i '$ a\i2c-dev' /etc/modules sudo reboot # Test i2c # dmesg | grep i2c # ls /dev/i2c* # Step 2 Install OWFS (http://www.gaggl.com/2013/01/accessing-1-wire-devices-on-raspberry-pi-using-owfs/) sudo apt-get install owfs ow-shell # Change config # Remove fake device sudo sed -i 's/server: FAKE/#server: FAKE/g' /etc/owfs.conf # Add i2c device sudo sed -i '$ a\--i2c=ALL:ALL' /etc/owfs.conf # Allow access from a remote device sudo sed -i 's/server: port = localhost:4304/server: port = 4304/g' /etc/owfs.conf # Restart service sudo /etc/init.d/owserver restart sudo /etc/init.d/owhttpd restart sudo /etc/init.d/owftpd restart # Step 3 Install nodejs (http://joshondesign.com/2013/10/23/noderpi) cd ~ wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-arm-pi.tar.gz tar -xvzf node-v0.10.28-linux-arm-pi.tar.gz echo NODE_JS_HOME=/home/pi/node-v0.10.28-linux-arm-pi >> /home/pi/.bash_profile sudo sed -i '$ a\PATH=$PATH:$NODE_JS_HOME/bin' /home/pi/.bash_profile # reboot or logout login user for bash_profile reload sudo reboot # Test # node --version # Step 4 Install small web app for led control usint http call from openhab # Copier le zip pascalhome_ledcontrol.zip dans /home/pi/pascalhome_ledcontrol.zip cd ~ sudo /home/pi/pascalhome_ledcontrol.zip cd /home/pi/ledcontrol npm install sudo /home/pi/node-v0.10.28-linux-arm-pi/bin/node app.js # Test led # http://192.168.0.194:3000/ledcontrol?status=ON # http://192.168.0.194:3000/ledcontrol?status=OFF
For my second raspberrypi with OpenHAB
Pour mon second raspberrypi avec OpenHAB
# Step 1 Prepare - Download RASPBIAN Debian Wheezy http://www.raspberrypi.org/downloads/ - Format SD Card with SDFormatter.exe https://www.sdcard.org/downloads/formatter_4/eula_windows/ - Write Raspbian with win32diskimager-v0.9-binary http://sourceforge.net/projects/win32diskimager/ - Boot raspberrypi and configure setting timezone, password, keyboard and internet - Update raspberrypi sudo apt-get update sudo apt-get upgrade sudo reboot - Make EnOceanPi Ready #Download and extract rpi-serial-console script sudo wget https://raw.github.com/lurch/rpi-serial-console/master/rpi-serial-console -O /usr/bin/rpi-serial-console && sudo chmod +x /usr/bin/rpi-serial-console sudo rpi-serial-console disable sudo reboot - For gpio addon work () sudo apt-get install libjna-java # Step 2 Install OpenHab and my demo app - Install openHAB Core sudo wget https://github.com/openhab/openhab/releases/download/v1.5.0/distribution-1.5.0-runtime.zip -O /home/pi/distribution-1.5.0-runtime.zip sudo mkdir /opt/openhab cd /opt/openhab/ sudo unzip /home/pi/distribution-1.5.0-runtime.zip - Installing my demo openHab config # Transferer le zip pascalhome_openhab_proto1.zip dans /home/pi/pascalhome_openhab_proto1.zip sudo unzip /home/pi/pascalhome_openhab_proto1.zip - Change openHAB start.sh # for encoean append -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0 right after java sudo sed -i 's/java /java -Dgnu.io.rxtx.SerialPorts=\/dev\/ttyAMA0 /g' /opt/openhab/start.sh # for gpio addon "start.sh" and append -Djna.boot.library.path=/usr/lib/jni right after java sudo sed -i 's/java /java -Djna.boot.library.path=\/usr\/lib\/jni /g' /opt/openhab/start.sh - Start openHAB sudo chmod +x start.sh sudo ./start.sh # Test openhab # http://192.168.0.192:8080/openhab.app?sitemap=demo #Troubleshooting with gpio after restart openhab #If the message Device or resource busy is printed unexport your gpio with next command echo 21 > /sys/class/gpio/unexport echo 20 > /sys/class/gpio/unexport #https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio