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.
 
 
 
Daniel Peter Chokola 0e3842f974 add a watchdog to keep pifmadv and ffmpeg alive 4 days ago
README.md Initial commit. Pretty functional, but needs polish, especially the UX. 1 week ago
music-api.py add a watchdog to keep pifmadv and ffmpeg alive 4 days ago
radio.html Initial commit. Pretty functional, but needs polish, especially the UX. 1 week ago
simple.css Initial commit. Pretty functional, but needs polish, especially the UX. 1 week 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

  1. Put radio.html and simple.css into your webroot—I used lighttpd.
  2. Put music-api.py somewhere root can run it. I suggest /usr/local/bin/
  3. 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