Ceci est une ancienne révision du document !
cd /tmp wget http://downloads.raspberrypi.org/raspbian_latest -O raspbian.zip 7z x raspbian.zip dd bs=4M if=2014-01-07-wheezy-raspbian.img of=/dev/mmcblk0 sync
Se connecter le raspberry PI via l'interfarce reseau, ensuite se connecter via SSH pi@adresse.ip avec le mot de passe raspberry
sudo raspi-config Change User Password (xxxx) Advanced Options Hostname (audiocar) Memory Split (16Mo) Internationalisation Options Change Locale (fr_FR.UTF-8) Change Timezone (Europe/Paris) Expand Filesystem
sudo apt-get update sudo apt-get upgrade sudo apt-get install python-pip supervisor sudo pip install serialkiller-plugins
sudo nano /etc/supervisor/conf.d/check_sensors.conf
[program:check_sensors] command=python /usr/local/bin/check_sensors.py user=root autostart=true autorestart=true
sudo pip install pyserial
sudo nano /usr/local/bin/check_sensors.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import time from skplugins import addValuePlugin, addEventPlugin, addValue, addEvent from skplugins.energy.teleinfo import teleinfo server = '192.168.1.1' while True: # Check teleinfo informations result = teleinfo(dev='/dev/ttyUSB0') if 'HCHC' in result.results: addValue(server, 'washroom:teleinfo:hchc', result.types['HCHC'], result.results['HCHC']) if 'HCHP' in result.results: addValue(server, 'washroom:teleinfo:hchp', result.types['HCHP'], result.results['HCHP']) if 'IINST' in result.results: addValue(server, 'washroom:teleinfo:iinst', result.types['IINST'], result.results['IINST']) if 'IINST' in result.results: addValue(server, 'washroom:teleinfo:test', result.types['IINST'], result.results['IINST']) if 'ISOUSC' in result.results: addValue(server, 'washroom:teleinfo:isousc', result.types['ISOUSC'], result.results['ISOUSC']) if 'PAPP' in result.results: addValue(server, 'washroom:teleinfo:papp', result.types['PAPP'], result.results['PAPP']) #Sleep time.sleep(5)
git clone https://github.com/tomp/python-metar.git cd python-metar python setup.py install
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import time from skplugins import addValuePlugin, addEventPlugin, addValue, addEvent from skplugins.weather.skmetar import skmetar server = '192.168.1.1' while True: # Check metar for LFMT station result = skmetar(cachefile='/tmp/metar_34.cache', station='LFMT') addValue(server, 'city:weather:temp', 'float', result.results['result']) addValue(server, 'city:weather:dewpt', 'float', result.results['dewpt']) addValue(server, 'city:weather:humidity', 'float', result.results['humidity']) addValue(server, 'city:weather:pressure', 'float', result.results['pressure']) addValue(server, 'city:weather:wind_chill', 'float', result.results['wind_chill']) addValue(server, 'city:weather:wind_speed', 'float', result.results['wind_speed']) addValue(server, 'city:weather:visibility', 'ushort', result.results['visibility']) #Sleep time.sleep(5)