Script for temperature reading and WS2812b handling via MQTT in an openHAB2 environment
This is the software running on an RPI 3 Model A+ I am using for a OpenHAB2 Raspberry Pi Touch Display
Here are the steps I did to get this up an running:
-
flashed a new raspbian buster on SD
-
configured WIFI & SSH before the first start like done here: https://learn.adafruit.com/raspberry-pi-zero-creation/text-file-editing
-
pluged in the SD card and powered up the RPI
-
looked up for e.g. the router for the IP of the RPI
-
connected via SSH
-
changed the standard password https://www.raspberrypi.org/documentation/linux/usage/users.md
-
run:
sudo apt-get update sudo apt-get full upgrade
-
installed remote desktop protocol:
sudo apt install xrdp
-
made local settings (timezone etc.) via RDP
-
installed Adafruit blinka like, but with root support (sudo): https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi
-
installed Adafruit BMP280 lib like: https://learn.adafruit.com/adafruit-bmp280-barometric-pressure-plus-temperature-sensor-breakout/circuitpython-test
-
installed Adafruit Neopixels like: https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython
-
Since this library and the onboard Raspberry Pi audio both use the PWM (when using GPIO18), they cannot be used together. You will need to blacklist the Broadcom audio kernel module by creating a file /etc/modprobe.d/snd-blacklist.conf with "blacklist snd_bcm2835"
-
installed paho-mqtt:
sudo pip3 install paho-mqtt
-
enabled script to run with autostart (edit rc.local)