Содержание

Raspbian в качестве ОС для удобного дома

Автор: Dmitry Rudenko

Установка Raspbian

cd /boot
sudo nano config.txt
hdmi_group=2
hdmi_mode=39

(подробнее см. http://raspberrypi.stackexchange.com/tags/config.txt/info)

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
sudo shutdown -r now
sudo nano /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
none            /var/log        tmpfs   size=1M,noatime   0       0

Установка Samba

Samba - сервер для сетевых дисков

sudo apt-get install samba samba-common-bin
sudo nano /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
guest ok = yes
netbios name = Raspberry
security = share
browseable = yes

[etc_openhab]
path = /etc/openhab/
writeable = yes
browseable = yes

[usr_share_openhab]
path = /usr/share/openhab/
writeable = yes
browseable = yes

[var_log_openhab]
path = /var/log/openhab/
writeable = yes
browseable = yes

[var_lib_openhab]
path = /var/lib/openhab/
writeable = yes
browseable = yes
sudo /etc/init.d/samba restart 

Установка Mosquitto

Mosquitto - сервер для обмена сообщениями по протоколу MQTT

sudo apt-get install mosquitto
sudo shutdown -r now
sudo service mosquitto status
[ ok ] mosquitto is running.

Установка и настройка Openhab

Openhab - универсальная платформа для объединения всей домашней «умной» техники в единую систему управления

apt-get install oracle-java8-jdk
sudo update-java-alternatives -s jdk-8-oracle-arm-vfp-hflt
sudo java -jar tzupdater.jar -u -v
apt-get install openhab-addon-binding-exec
apt-get install openhab-addon-binding-http
apt-get install openhab-addon-binding-ntp
apt-get install openhab-addon-persistence-rrd4j
apt-get install openhab-addon-persistence-logging
apt-get install openhab-addon-binding-mqtt
apt-get install openhab-addon-binding-samsungtv
apt-get install openhab-addon-binding-networkhealth
apt-get install openhab-addon-action-mail

Настройка NTP

sudo nano /etc/rc.conf
DAEMONS=(!hwclock ntpd)
sudo ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
sudo reboot

Полезные ссылки: