{"id":20433012,"url":"https://github.com/cdzombak/pi-fm-player","last_synced_at":"2025-04-12T20:53:06.317Z","repository":{"id":66912912,"uuid":"121896911","full_name":"cdzombak/pi-fm-player","owner":"cdzombak","description":"Raspberry Pi FM transmitter that plays music forever from the local filesystem.","archived":false,"fork":false,"pushed_at":"2023-11-14T14:16:29.000Z","size":54,"stargazers_count":49,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T20:53:01.939Z","etag":null,"topics":["fm-transmitter","mp3","music-player","radio","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdzombak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-02-17T22:11:23.000Z","updated_at":"2024-09-17T20:58:26.000Z","dependencies_parsed_at":"2023-05-13T21:45:24.431Z","dependency_job_id":"5b29b82b-2d94-423e-a584-8c85f108558b","html_url":"https://github.com/cdzombak/pi-fm-player","commit_stats":null,"previous_names":["cdzombak/pi-fm-player"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fpi-fm-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fpi-fm-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fpi-fm-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fpi-fm-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdzombak","download_url":"https://codeload.github.com/cdzombak/pi-fm-player/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631725,"owners_count":21136560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fm-transmitter","mp3","music-player","radio","raspberry-pi"],"created_at":"2024-11-15T08:17:24.863Z","updated_at":"2025-04-12T20:53:06.295Z","avatar_url":"https://github.com/cdzombak.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-fm-player\n\nA Raspberry Pi-based music player + FM transmitter, originally created for my home alarm clock. `pi-fm-player` continuously transmits MP3s stored locally, in a random order, on the FM frequency of your choice.\n\n## Hardware Setup\n\nConnect a ~20cm/8in single-conductor wire to GPIO 4 (which is pin 7 on [header P1](http://elinux.org/RPi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29)) to act as an antenna.\n\n## Install \u0026 Configure\n\nOn the Raspberry Pi:\n\n- Place the `pifm` directory from this repo at a location of your choosing.\n  - I placed it in `/opt` on my Raspberry Pi.\n  - You may wish to adjust file permissions if installing it in `/opt` or similar. I did this by running `sudo chown -R root:root /opt/pifm`.\n- Put MP3 files in a directory of your choice.\n  - I'm using [Syncthing](https://syncthing.net) to sync music to `~/Music` on my Pi.\n- Setup `pifm-player.service`, the systemd service which runs the transmitter.\n  - First, customize `pifm-player.service`.\n  - Set the environment variables `MUSIC_DIR` and `PIFM_BIN` to point to the music directory and the `pifm` binary on your system.\n  - Set the variable `PIFM_FREQ` to change to a different FM frequency.\n  - `sudo mv pifm-player.service /etc/systemd/system/`\n  - `sudo chmod 0644 /etc/systemd/system/pifm-player.service`\n- Finally, enable and run the transmitter service:\n  - `sudo systemctl enable pifm-player.service`\n  - `sudo systemctl start pifm-player.service`\n\n## Logs\n\n\u003e Is it working?\n\n```shell\nsudo journalctl -f -u pifm-player.service\n```\n\n\u003e What was playing at some point in the past?\n\n```shell\nsudo journalctl -u pialarm-transmit.service --since \"2019-10-21 07:30:00\" --until \"2019-10-21 07:50:00\"\n```\n\n## Monitoring\n\nYou can use [`runner`](https://github.com/cdzombak/runner) and an [Uptime Kuma](https://github.com/louislam/uptime-kuma) push monitor to get alerted if/when the pi-fm service fails. After installing `runner`, put the following in `/etc/cron.d/pifm-check`:\n```text\n*  *  *  *  *  root  runner -job-name pifm-check -retries 2 -retry-delay 15 -success-notify \"https://my-uptime-kuma-host.example.com:9001/api/push/1234abcd?status=up\u0026msg=OK\u0026ping=\" -- systemctl is-active --quiet service pifm-player.service\n```\n\n## License\n\nReleased under the [Unlicense](https://choosealicense.com/licenses/unlicense/) (see `LICENSE` in this repo).\n\n## Author\n\nChris Dzombak\n\n- [github.com/cdzombak](https://www.github.com/cdzombak)\n- [dzombak.com](https://www.dzombak.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdzombak%2Fpi-fm-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdzombak%2Fpi-fm-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdzombak%2Fpi-fm-player/lists"}