MQTT Publish for Raspberry Pi AIY Projects

I have a lot of things in my house connected using a Raspberry Pi mosquitto broker and Node-RED so I wanted to add simple publish commands to my AIY Project.

The code is hosted at Github here:

For this you will just need to copy the file to your ~voice-recognizer-raspi/src/ folder.

For it to work you need to install paho-mqtt:
sudo pip install paho-mqtt

I’ve set this up as an example to swich lights on and off so you will need to tweak it to suit your own setup.

If you are using the new version of the AIY Projects kit (from version aiyprojects-2017-09-11.img) and don’t have an file then you need to use the from my updated version (voicekit branch) copy the file as well and fill it in with your MQTT config details.


Add a Comment

Your email address will not be published. Required fields are marked *