This is a simple MicroPython project to forward a Ring chime from my HomeNode automation system to speakers.
A Pi Pico W listens for MQTT messages and uses a PCM5102A DAC to play the sound via a 3.5mm output.
- Install
python3
- Create a virtualenv using
python -m venv .venv
- Activate the virtualenv using
source .venv/bin/activate
or.venv/Scripts/activate.ps1
- Install the requirements using
pip install -r requirements.txt
You can grab the MicroPython firmware for a Pi Pico W from this page. Drag/drop as per usual.
Create a config file for credentials in src/config.json
...
{ "wifi_ssid": "", "wifi_psk": "", "mqtt_server": "192.168.1.4"}
- Install libs using
mip.install('')
- Copy over the audio file
- Copy config.json and helper files
The easiest way to develop is to use mpremote
to mount the src folder.
To begin clear out the main.py
file and reboot. This allows you to use other commands without interference.
import os
os.remove('main.py')
You can then mount the src folder...
mpremote mount src
From REPL you can start executing code. To "hot reload" a file you can run the following command. This will let you import updated code.
from utils import clear_mod
clear_mod(ringer)