You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
4 days ago | |
|---|---|---|
| README.md | 7 days ago | |
| music-api.py | 4 days ago | |
| radio.html | 7 days ago | |
| simple.css | 7 days ago | |
README.md
HushPupPi Pirate Radio
Simple pirate radio interface (yes, actual FM radio) for Raspberry Pi with DJ-style queueing, station ID, RDS transmission, and a decent web interface. This is some code which was mostly hallucinated by Copilot. It did great with a lot of guidance, but don't expect miracles, and especially don't expect it to have great performance or security.
Usage
- Put radio.html and simple.css into your webroot—I used lighttpd.
- Put music-api.py somewhere root can run it. I suggest
/usr/local/bin/ - The python script, music-api.py, will host a Flask daemon on port 5001. Set up your webserver to proxy requests to /api/ to localhost:5001. The python script calls PiFmAdv, which you'll need to compile yourself.
You should be able to figure out Python requirements from the import statements at the top of the file; they are pretty modest. Likewise, there are some constants towards the top which point to the location of music files, a cache location for album art, and for a SQLite database of indexed music.
Autostart
You can create a simple systemd service with the following:
[Unit]
Description=Music API for FM transmitter
After=network.target
[Service]
ExecStart=/usr/local/bin/music-api.py
Restart=always
[Install]
WantedBy=multi-user.target