GithubHelp home page GithubHelp logo

pifm's Introduction

PiFM

A complete radio station for the Raspberry Pi

Features

  • Web interface for management
  • Get music from FTP
  • Automated news reports
  • Play MP3 files with no extra hassle

Installation

  1. Install the latest version of Raspbian on your Raspberry Pi
  2. Close the repo: sudo apt install git && git clone https://github.com/Sid220/PiFM.git
  3. Run the installation script: cd PiFM && python3 install.py
  4. In the music directory you choose, put your music files (preferably MP3 or WAV, but other formats likely work)

You can then start the radio with python3 start.py. The Web UI is accessible from http://<your-pi-ip>:8000. Click songs to add them to the queue, and click songs in the queue to remove them.

Screenshots

Web Interface

Customise News Reports

By default, PiFM runs an automated news report every other hour. It begins with a musical intro, then an automated reading of latest headlines from the BBC RSS feed, and finally the latest video on the BBC's YouTube channel.

Using conf.json you can customise which parts you wish to include, and change the RSS feeds and YouTube channel. For example if you want to read from the CNN RSS feed instead of the BBC's and to not include the YouTube or intro portions, change the config like this:

...
  "news": {
    "enabled": true,
    "bbc": false,
    "intro": {
      "enabled": false,
      "file": "assets/News Theme Headline.mp3"
    },
    "rss": {
      "enabled": true,
      "url": "http://rss.cnn.com/rss/edition.rss",
      "max_headlines": 5
    },
    "youtube": {
      "enabled": false,
      "channel": "UC16niRr50-MSBwiO3YDb3RA"
    },
    "interval": 2
  }
...

It is a good idea to disable bbc in conf.json like above if you do this, which impacts some dialogue to make it more generic.

For more advanced customisation, you should edit the news.py file.

Config documentation

Key Type Description
freq float The frequency to broadcast at
ui object The UI configuration
ui.enabled bool Whether to enable the UI
ui.port int The port to run the UI on, default 8000
music_dir string The directory to look for music in, locally unless FTP enabled
slogan object The slogan configuration
slogan.enabled bool Whether to enable the slogan after each song
slogan.files array[string] The audio files to play as slogans
ftp object The FTP configuration
ftp.enabled bool Whether to enable FTP
ftp.host string The FTP host
ftp.port int The FTP port
ftp.user string The FTP username
ftp.pass string The FTP password
news object The news configuration
news.enabled bool Whether to enable news reports
news.bbc bool Whether to use the BBC preset (impacts some dialogue)
news.interval int The interval between news reports in hours
news.intro object The intro configuration
news.intro.enabled bool Whether to enable the intro
news.intro.file string The audio file to play as the intro
news.rss object The RSS configuration
news.rss.enabled bool Whether to enable the RSS feed
news.rss.url string The URL of the RSS feed
news.rss.max_headlines int The maximum number of headlines to read
news.youtube object The YouTube configuration
news.youtube.enabled bool Whether to enable the YouTube portion
news.youtube.channel string The YouTube channel id to read from. THIS IS NOT THE SAME AS THE HANDLE!

Notes

  • On the Raspberry Pi 4, GPIO21 is used for broadcasting (PIN 40 on GPIO header)
  • On other boards, GPIO4 is used for broadcasting (PIN 7 on GPIO header)
  • Frequencies above 93 MHz are known to be problomatic on the Raspberry Pi 4
  • Leaving the Web UI open for a long time can decrease audio quality
  • Other ALSA loopback devices may interfere with PiFM, so it is recommended to remove them

Disclaimer

In most countries, transmitting radio waves without a state-issued licence specific to the transmission modalities (frequency, power, bandwidth, etc.) is illegal.

Therefore, always connect a shielded transmission line from the Raspberry Pi directly to a radio receiver, so as not to emit radio waves. Never use an antenna.

Even if you are a licensed amateur radio operator, using PiFM to transmit radio waves on ham frequencies without any filtering between the Raspberry Pi and an antenna is probably illegal as bandwidth requirements are likely not met.

I could not be held liable for any misuse of your own Raspberry Pi. Any experiment is made under your own responsibility.

From fm_transmitter (the backend of this project):

Legal note

Please keep in mind that transmitting on certain frequencies without special permissions may be illegal in your country.

pifm's People

Contributors

sid220 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.