Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prasha-au/pico-ringer
MicroPython Pico chime player.
https://github.com/prasha-au/pico-ringer
micropython-rpi-pico pcm5102a
Last synced: about 2 months ago
JSON representation
MicroPython Pico chime player.
- Host: GitHub
- URL: https://github.com/prasha-au/pico-ringer
- Owner: prasha-au
- Created: 2024-07-28T23:23:27.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T23:35:34.000Z (5 months ago)
- Last Synced: 2024-07-30T02:37:02.339Z (5 months ago)
- Topics: micropython-rpi-pico, pcm5102a
- Language: Python
- Homepage:
- Size: 154 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pico Ringer
This is a simple MicroPython project to forward a Ring chime from my [HomeNode](https://prasha.au/project/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.
## Setup development environment
### Python venv
1. Install `python3`
2. Create a virtualenv using `python -m venv .venv`
3. Activate the virtualenv using `source .venv/bin/activate` or `.venv/Scripts/activate.ps1`
4. Install the requirements using `pip install -r requirements.txt`### Flash Micropython
You can grab the MicroPython firmware for a Pi Pico W from [this page](https://micropython.org/download/RPI_PICO_W/).
Drag/drop as per usual.### Config file
Create a config file for credentials in `src/config.json`...
```json
{ "wifi_ssid": "", "wifi_psk": "", "mqtt_server": "192.168.1.4"}
```### Setup Files
- Install libs using `mip.install('')`
- Copy over the audio file
- Copy config.json and helper files## Developing
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.
```python
import os
os.remove('main.py')
```You can then mount the src folder...
```bash
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.
```python
from utils import clear_mod
clear_mod(ringer)
```