For a comprehensive tutorial about OpneHABian installation please follow the instructions on the official web site
ATTENTION all the installation procedures are really long lasting, please be patient.
Once installed OpenHABian following the instructions, you need to proceed with customizations and add-ons installation.
Many operations are eased using the OpenHABian environment equivalent to raspi-config.
The CM3-Home serial ports must be prepared to be used in OpenHAB, freeing them from standard use:
use menu items according to your needs
In order to verify the configuration you can use the karaf console. Let's take the knx binding as an example.
[12:44:08] openhabian@RasPIguiott:~$ ssh -p 8101 openhab@localhost Password authentication Password: __ _____ ____ ____ ____ ___ ____ / / / / | / __ ) / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __ | / /_/ / /_/ / __/ / / / __ / ___ |/ /_/ / \____/ .___/\___/_/ /_/_/ /_/_/ |_/_____/ /_/ 2.1.0 - release build - Hit '
' for a list of available commands and '[cmd] --help' for help on a specific command. Hit ' ' or type 'system:shutdown' or 'logout' to shutdown openHAB. openhab> config:list "(service.pid=org.openhab.knx)" ---------------------------------------------------------------- Pid: org.openhab.knx BundleLocation: mvn:org.openhab.binding/org.openhab.binding.knx/1.10.0 Properties: localIp = localhost service.pid = org.openhab.knx type = ROUTER openhab>
In case of problems it can be useful to increase debug level to check for possible configuration errors:
openhab> log:set debug tuwien.auto.calimero
or enable the trace
log:set TRACE org.openhab.binding.knx log:set TRACE tuwien.auto.calimero
It is advisable to disable them when the debug is over:
log:set DEFAULT org.openhab.binding.knx log:set DEFAULT tuwien.auto.calimero
All the useful information can be read in:
Or with the console command log:tail
or in the browser: http://cm3home.local:9001/
The configuration is dynamically loaded as soon as the cfg file is saved (/etc/openhab2/services/knx.cfg in the example). It could happen that the previous configurations are cached even at service restart. In that case clean up the cache before restarting the service:
openhab> config:delete org.openhab.knx openhabian@RasPIguiott:~$ sudo systemctl restart openhab2
There are some little differences between CM3-Home and Raspberry PI 3 because of the greater hardware equipment. A comprehensive guide to all the peripherals and how to use them, can be found at CM3-Home main page
To use all of the available hardware you have to:
To do that, the following instructions must be added to the /boot/config.txt file:
#Serial port to GPIO 32 and 33 force_turbo=1 dtoverlay=uart1,txd1_pin=32,rxd1_pin=33 #CM3-Home led definition dtoverlay=cm3-home-leds #Enable PWM on GPIO 40 and 41 for the audio out dtoverlay=pwm-2chan,pin=40,func=4,pin2=41,func2=4 # Enable the 1-wire bus dtoverlay=w1-gpio,gpiopin=16 #Enable the IR Linux driver dtoverlay=lirc-rpi,gpio_in_pin=20 dtparam=spi=on dtoverlay=rpi-display,speed=32000000,rotate=270 #dtoverlay=ads7846,cs=0,penirq=34,speed=10000, swapxy=0, pmax=255, xohms=60, xmin=200, xmax=3900, ymin=200, ymax=3900 #I2C on Grove socket #(https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/README#L783) dtparam=i2c_arm=on dtparam=i2c_arm_baudrate=400000 dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6 #Avoid waiting for HDMI device attached at boot (save more than 10sec at startup) hdmi_ignore_hotplug=1
Take a look also at Create a Raspbian Stretch microSD article.
To assign system functions to RGB LED you must create an overlay Using this tutorial
the already prepared overlays are available:
To redirect the system console to the debug port you must edit also the file /boot/cmdline.txt adding the related instructions:
dwc_otg.lpm_enable=0 enable_uart=1 dtoverlay=pi3-disable-bt console=serial1,115200 root=PARTUUID=75a5cf8a-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
sudo usermod -a -G dialout openhab openhabian
For the details follow the Andrea Montefusco presentation
After hostapd service has been installed, the automatic startup of the service must be disabled and managed through /etc/rc.local so that each service will be launched only when the device is ready. The dhcpcd service as well must be disabled. So, add the following instructions to rc.local:
# WiFi module AP mode, bridge configuration with eth0 and uap0(wlan) # echo 37 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio37/direction echo 1 > /sys/class/gpio/gpio37/value sleep 1 ifup eth0 ifconfig eth0 up ifconfig rfkill list ifup wlan0 ifconfig wlan0 up ifconfig brctl addbr br0 brctl addif br0 eth0 ifconfig br0 up sleep 1 ifup br0 sleep 1 route add -net 0.0.0.0/0 gw 192.168.1.1 iw dev wlan0 interface add uap0 type __ap ifup uap0 hostapd /etc/hostapd/hostapd.conf & exit 0
Add the following instructions to /etc/dhcpcd.conf configuration file if a static IP is needed:
interface eth0 static ip_address=192.168.1.2 static routers=192.168.1.1 static domain_name_servers=192.168.1.1
To use all the CM3-Home OpenHAB features on mobile devices even when not in the same domestic network, it can be used the open cloud service offered by OpenHAB and the corresponding app available for both iOS and Android
After installing the openHAB Cloud Connector
the following files will be available:
The files content is needed to setup the cloud service. A complete tutorial about installation and configuration is available on Youtube.
The same functions available on local UI can be used also on mobile device once connected with the cloud service.
How to use an external, dedicated panel display to interact with CM3-Home through HABpanel UI.
how to launch the HABpanel at startup.
In the display user home directory configuration file:
chromium-browser --kiosk http://192.168.1.2:8080/habpanel/index.html#/
with the CM3-Home IP address.
To disable screen saver and cursor in the browser, in file
un-comment the Xserver line es add the needed parameters:
[SeatDefaults] xserver-command=X -s 0 -dpms -nocursor
add the instruction avoid_warnings=1 at /boot/config.txt
2018 Ⓒ TanzoLab