The following steps describe the prerequisites for the actual raspbee setup (deCONZ/phoscon and node-RED):
-
Flash (e.g., using Etcher) raspbian-buster-lite onto SD card (e.g., 16GB).
-
Create an empty
sshfile on the SD card's boot partition. -
Create a
wpa_supplicant.conffile (see template provided with this gist) on the SD card's boot partition (link). -
Eject SD card properly and start raspi with it (just provide power).
-
Use a shell/terminal and connect to the raspi with
ssh pi@rasperrypi(usernamepi, hostnameraspberrypi, and default password israspberry).
If your raspi is not found, check (1) whether your WPA config was correct (note that the file gets deleted whenever the raspi boots), (2) that your router allowed your raspi to enter your WAN/LAN, and (3) that you remove your raspi from previous known hosts (.ssh/known_hosts).
-
Update the raspi:
sudo apt-get -y update && sudo apt-get -y full-upgrade
-
Change
piuser password:sudo raspi-config
-
Install Docker:
curl -sSL https://get.docker.com | shsudo usermod -aG docker pi- optional: test docker
docker run hello-world
-
Install docker-compose:
sudo apt-get -y install libffi-dev libssl-devsudo apt-get -y install python python-pipsudo apt-get -y remove python-configparser(some fix I had to apply for correct pip-based install)sudo pip install docker-compose
-
Configure raspi:
sudo raspi-config- Set hostname to, e.g.,
raspbee(needs to be consistent with all upcomming hostnames). Note that for subsequent ssh connects the new hostname needs to be used: e.g.,ssh pi@raspbee... - Goto
Interfacing Options→Serialand adjust as follows:Would you like a login shell accessible over serial?→NoWould you like the serial port hardware to be enabled?→Yes
- optional: set timezone, WiFi locale, expand filesystem etc. and reboot
sudo reboot.
-
Create folder structure for deCONZ and node red configs:
cd /opt/sudo mkdir dockercd docker/
-
Create deconz and nodered config, environment, and adjust user access:
sudo usermod -aG dialout pisudo nano /boot/config.txtand add the following lines to the end:enable_uart=1dtoverlay=pi3-disable-bt
sudo nano raspbee.yml(and pasteraspbee.ymlcontents)sudo nano raspbee.env(and pasteraspbee.envcontents)
-
Add
node-red-contrib-deconzpackage to node-red container:- install using the
Palette→Installtab within the node-red user settings
- install using the
-
optional: Make a backup of your SD card.
-
If permission issues occur for
~/.local/share/node-red/datause:sudo chown -R 1000:1000 ~/.local/share/node-red
- start:
docker-compose -f deconz.yml up -d - stop:
docker-compose -f deconz.yml stop - recreate:
docker-compose -f deconz.yml up -d --force-recreate - clean all:
docker system prune - show log while running:
docker container ls(copyCONTAINER ID)docker container logs -f deconz
from How to save Power on your Raspberry Pi, i disabled USB and HDMI (bluetooth beeing already disabled). If the raspi is connected via LAN, also might disable the PI's WiFi:
- Turn OFF USB chip:
echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind - Turn ON USB chip:
echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind - Turn OFF HDMI output:
sudo /opt/vc/bin/tvservice -o - Turn ON HDMI output:
sudo /opt/vc/bin/tvservice -p - Disable Wi-Fi & Bluetooth:
dtoverlay=pi3-disable-wifianddtoverlay=pi3-disable-bt - Disable on-board LEDs:
dtparam=act_led_trigger=noneanddtparam=act_led_activelow=on
I bought a Raspbee Premium, but no firmware was installed.
The green LED of the Raspbee was continuously blinking and no configuration, be it /dev/ttyAMA0, /dev/ttyS0, or /dev/serial0 has worked.
I got the following deconz logs:
...
20:29:26:700 dev /dev/ttyAMA0
20:29:26:700 COM: /dev/ttyAMA0 / serialno:
20:29:26:700 COM: --dev: /dev/ttyAMA0 (RaspBee)
20:29:26:845 Error: invalid command
20:29:27:221 device state timeout ignored in state 2
...
Furthermore, neither the within deconz container firmware update worked as described nor running the gcfflasher directly worked for me, due to missing dependencies.
GLIBC_2.28, libgglib-2.0.so, libtQt5Serial, and others where not found for running GCFlasher ...
With the following steps i got the latest firmware installed on a blank Raspbee:
sudo apt-get install libc6 libglib2.0-0 libgtk2.0-0 libsm6docker run -it --rm --entrypoint "/firmware-update.sh" --privileged --cap-add=ALL -v /dev:/dev -v /lib/modules:/lib/modules -v /sys:/sys -v /lib:/lib -v /usr/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf marthoc/deconz- follow the instructions of the flash script ...