Skip to content

Latest commit

 

History

History
150 lines (124 loc) · 4.63 KB

raspberrypi.md

File metadata and controls

150 lines (124 loc) · 4.63 KB

Prequisites

  • Raspberry Pi 2B/3B/3B+/4B
  • Raspbian Stretch or Raspbian Buster

Installation

  1. Create full backup of your SD card

  2. Add the public key of the repository

    wget -q -O - https://www.pivccu.de/piVCCU/public.key | sudo apt-key add -
  3. Add the package repository

    sudo bash -c 'echo "deb https://www.pivccu.de/piVCCU stable main" > /etc/apt/sources.list.d/pivccu.list'
    sudo apt update

    Instead of stable you can also use the testing tree, but be aware testing sometimes means not that stable.

  4. Install the neccessary kernel modules

    sudo apt install build-essential bison flex libssl-dev
    sudo apt install raspberrypi-kernel-headers pivccu-modules-dkms
  5. Install the neccessary device tree patches (You can skip this step, if you do not use the HM-MOD-RPI-PCB or RPI-RF-MOD on GPIO header, for the HB-RF-USB this step is not neccessary)

    sudo apt install pivccu-modules-raspberrypi
  6. Enable UART GPIO pins (not required on Raspberry Pi 2) (You can skip this step, if you do not use the HM-MOD-RPI-PCB or RPI-RF-MOD on GPIO header, for the HB-RF-USB this step is not neccessary)

    • 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
      core_freq=250
      EOT'
  7. Disable serial console in command line (You can skip this step, if you do not use the HM-MOD-RPI-PCB or RPI-RF-MOD on GPIO header, for the HB-RF-USB this step is not neccessary)

    sudo sed -i /boot/cmdline.txt -e "s/console=serial0,[0-9]\+ //"
    sudo sed -i /boot/cmdline.txt -e "s/console=ttyAMA0,[0-9]\+ //"
  8. 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 ip link show | cut -d' ' -f2 | cut -d: -f1 | grep -e '^e.*'
    • 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'
    • To use Wireless LAN, please take a look here

  9. Reboot the system

    sudo reboot
  10. Install CCU container

    • To use CCC2 firmware
      sudo apt install pivccu
    • To use CCU3 firmware
      sudo apt install pivccu3
  11. Start using your new virtualized CCU, you can get the IP of the container using

    sudo pivccu-info

Using rpi-update

The stable kernel for the Raspberry Pi is distributed via apt. Normally you should use this kernel. But still there are some reasons to use rpi-update to install the latest (unstable) kernel. Since version 2.0.7 the pivccu-modules-raspberrypi does support kernels installed by rpi-update. Be aware, that piVCCU start after the reboot with a new kernel will take approx. 15 minutes.

Migrating from custom kernel to original Raspbian kernel with custom modules and device tree overlay

  1. Create full backup of your SD card

  2. Upgrade to latest pivccu package

    sudo apt update
    sudo apt upgrade
  3. Verify, that at least Version 2.29.23-12 is installed

    sudo dpkg -s pivccu | grep 'Version'
  4. Install original Raspbian kernel and additional custom kernel modules

    sudo apt install pivccu-modules-raspberrypi raspberrypi-kernel

    (In this step, the two packages should be get installed and the package raspberrypi-kernel-pivccu should be get removed)

  5. Reboot the system

    sudo reboot