-
Notifications
You must be signed in to change notification settings - Fork 0
Raspberry Pi Blinkt! Code
Now we can add our Blinkt! code to the Raspberry Pi. I use a Pi Zero W for this as I've stuck it to a wall but of course any Pi can be used for this!
There is only one dependency for this Script, the Paho mqtt library. Install via pip with the following command:
pip3 install paho-mqtt
Note I've used pip3 to ensure this is installed for use with Python3.
I'll assume you've already setup this Pi with the Blinkt! package. If not, head over to Pimironi to install that: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-blinkt
I'll also assume you have an MQTT broker running. If not, you'll need install one. I use the Eclipse-mosquitto MQTT broker via docker: https://hub.docker.com/_/eclipse-mosquitto
Ensure the IP address used in the script is the same as the one your MQTT broker is on. If it's the same machine, localhost should work!