piVCCU is a project to install the original Homematic CCU2 firmware inside a virtualized container (lxc) on a Raspberry Pi running Raspbian Jessie or Stretch, Armbian 5.x (Asus TinkerBoard) or Tinker OS 2.x
- Raspberry Pi 2 or 3 or Asus TinkerBoard
- HM-MOD-RPI-PCB
- Raspbian Stretch or Jessie
-
Create full backup of your SD card
-
Add the public key of the repository
wget -q -O - http:https://alexreinert.github.io/piVCCU/public.key | sudo apt-key add -
-
Add the package repository
sudo bash -c 'echo "deb http:https://alexreinert.github.io/piVCCU stable main" >> /etc/apt/sources.list' sudo apt update
Instead of
stable
you can also use thetesting
tree, but be aware testing sometimes means not that stable. -
Install the neccessary kernel modules for the low level communication with the HM-MOD-RPI-PCB
sudo apt install pivccu-modules-raspberrypi
-
Enable UART GPIO pins (only on Raspberry Pi 3)
-
Option 1: Disabled bluetooth (prefered)
sudo bash -c 'cat << EOT >> /boot/config.txt dtoverlay=pi3-disable-bt EOT' sudo systemctl disable hciuart.service
-
Option 2: Bluetooth attached to mini uart
sudo bash -c 'cat << EOT >> /boot/config.txt dtoverlay=pi3-miniuart-bt enable_uart=1 force_turbo=1 EOT'
-
-
Disable serial console in command line
sudo sed -i /boot/cmdline.txt -e "s/console=serial0,[0-9]\+ //" sudo sed -i /boot/cmdline.txt -e "s/console=ttyAMA0,[0-9]\+ //"
-
Add network bridge (if you are using wifi please refer to the debian documentation how to configure the network and the bridge)
- Verify, that eth0 is the name of your primary network interface:
sudo ifconfig
- Update your config. (Replace eth0 if necessary)
sudo apt remove dhcpcd5 sudo apt install bridge-utils sudo bash -c 'cat << EOT > /etc/network/interfaces source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual auto br0 iface br0 inet dhcp bridge_ports eth0 EOT'
- You can use an static IP address, too. In that case use instead:
sudo apt remove dhcpcd5 sudo apt install bridge-utils sudo bash -c 'cat << EOT > /etc/network/interfaces source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual auto br0 iface br0 inet static bridge_ports eth0 address <address> netmask <netmask> gateway <gateway> dns-nameservers <dns1> <dns2> EOT'
- Verify, that eth0 is the name of your primary network interface:
-
Reboot the system
sudo reboot
-
Install CCU2 container
sudo apt install pivccu
-
Start using your new virtualized CCU2, you can get the IP of the container using
sudo pivccu-info
Migrating from custom kernel to original Raspbian kernel with custom modules and device tree overlay
- Create full backup of your SD card
- Upgrade to latest pivccu package
sudo apt update sudo apt upgrade
- Verify, that at least Version 2.29.23-12 is installed
sudo dpkg -s pivccu | grep 'Version'
- Install original Raspbian kernel and additional custom kernel modules
(In this step, the two packages should be get installed and the package raspberrypi-kernel-pivccu should be get removed)
sudo apt install pivccu-modules-raspberrypi raspberrypi-kernel
- Reboot the system
sudo reboot
-
Original CCU2
Just restore a normal system backup using the CCU web interface
-
RaspberryMatic
- Restore a normal system backup using the CCU web interface
- Reinstall all addons using the CCU web interface
-
YAHM 0. Create full backup of your SD card
- Create system backup using CCU web interface
- Remove YAHM
sudo lxc-stop -n yahm sudo rm -f /etc/bash_completion.d/yahm_completion sudo rm -f /etc/init.d/hm-mod-rpi-pcb sudo rm -rf /opt/YAHM sudo rm -rf /var/lib/lxc/yahm sudo sed -i /boot/config.txt -e '/dtoverlay=pi3-miniuart-bt/d' sudo sed -i /boot/config.txt -e '/dtoverlay=pi3-miniuart-bt-overlay/d' sudo sed -i /boot/config.txt -e '/enable_uart=1/d' sudo sed -i /boot/config.txt -e '/force_turbo=1/d' sudo sed -i /etc/modules -e '/#*eq3_char_loop/d' sudo sed -i /etc/modules -e '/#*bcm2835_raw_uart/d'
- Install piVCCU as described above
- Restore the system backup using the CCU web interface
- Remove YAHM specific configuration stuff
sudo systemctl stop pivccu.service sudo rm -f /var/lib/piVCCU/userfs/etc/config/no-coprocessor-update sudo sed -i /var/lib/piVCCU/userfs/etc/config/rfd.conf -e 's/Improved Coprocessor Initialization = false/Improved Coprocessor Initialization = true/' sudo sed -i /var/lib/piVCCU/userfs/etc/config/multimacd.conf -e 's/bcm2835-raw-uart/mxs_auart_raw.0/' sudo systemctl start pivccu.service
- Create a hook script
echo '#!/bin/bash' | sudo tee -a /etc/piVCCU/post-start.sh sudo chmod +x /etc/piVCCU/post-start.sh
- For each device add an entry to this hook file, e.g. here for
/dev/ttyUSB0
echo 'pivccu-device add /dev/ttyUSB0' | sudo tee -a /etc/piVCCU/post-start.sh
- The devices will now be available inside the container, just use them like it is described in the CUxD documentation
If you like to build the .deb package by yourself
- Use Ubuntu 16.04 as build system
- Install prequisites tbd
- Clone source
- create_kernel.sh builds the custom kernel package
- create_pivccu.sh builds the container package
- Deploy the .deb files to an apt repository e.g. using reprepro
Please consider sending me a donation to not only help me to compensate for expenses regarding piVCCU, but also to keep my general development motivation on a high level. So if you want to donate some money please feel free to send me money via PayPal.
piVCCU itself – the source files found in this git repository – are licensed under the conditions of the Apache License 2.0. The kernel module source files (folder kernel) and the generated kernel .deb files (raspberrypi-kernel-pivccu) licensed under the GPLv2 license instead. The generated CCU container .deb files (pivccu) are containing the original CCU2 firmware, containing multiple different licenses. Please refer to eQ-3 for more information.