Bark Back Interactive Pet Monitor
Step 1: Check & Install Updates
Check for and install updates:
sudo apt-get update sudo apt-get upgrade sudo reboot
Step 2: Set up SPI Interface for MEMS Microphone + MCP3002
Install the Python Dev package :
sudo apt-get install python-dev
Create a subfolder and install the Serial Port Interface ("SPI"):
mkdir py-spidev git clone git://github.com/doceme/py-spidev sudo python setup.py install
Here's the SPI-Dev Documentation if you run into any issues.
Step 3: Playing Sounds with OMXPlayer
The OMXPlayer is an audio and video player pre-loaded on Raspbian OS (woo!). It works with most sound file types, including: .wav, .mp3 and .m4a. We'll use this to play our "bark back" sounds.
In the terminal, test the OMXPlayer using the following command:
If that doesn't work, try forcing it over the local audio-out device:
omxplayer -o local /home/pi/.../SongFilePath/SongFileName.mp3
Step 4: Configure CloudMQTT Server
Now we set up an MQTT server! To do this using CloudMQTT, do the following:
- Set up a CloudMQTT account (the "Cute Cat" plan is free).
- Create a new MyCloud instance.
- In the Console, create a new ACL rule.
- You can monitor published messages in the "Websocket UI" of your CloudMQTT console.
Finally, install the MQTT Paho Client Python library:
pip install paho-mqtt