Custom FM Radio Station Powered By Shell Scripts

[Trwmato] wanted to spend more time listening to a normal radio to cut back on phone use. But the programming wasn’t quite right so, of course, the solution was to spin up a custom radio station!

The station in question uses a Pi Zero to poll podcasts and news from RSS feeds and automatically mixes them with local content and sends it out via Bluetooth. An FM transmitter allows it to still work on the FM radio, too. Grabbing podcasts isn’t very difficult, thanks to podget. The real logic is in how long to retain things and creating a playlist that both prioritizes fresh content while not repeating things too often. Did we forget to mention the whole thing is a collection of shell scripts?

We could see this as the start of a cool project to have a “radio station” for a school, organization, or company. It is easy to understand and modify.

We often argue that the much-maligned bash script is sometimes the right tool for the job. You can even do things like critical sections in them.

21 thoughts on “Custom FM Radio Station Powered By Shell Scripts

  1. I love a project like this. Back around 2001, It was peak cool to carry around a personal CD player and a couple dozen CDRs filled with MP3s. Then I got a job at an ISP and realized I could do better.

    Back home, we had recently upgraded from dialup to cablemodem so we finally had always-on broadband. I set up my own personal radio station using WinAMP and a “radio station” plugin (I think it was SoundRequester) and streamed from home!

    Believe it or not, the boss still grumbled about “all the bandwidth that used”. :D

    The plugin has a built-in web server and it’s web site showed the playlist history and also let you browse your MP3 library and select them to schedule for play. It also supported random play and insertion of things like regular station identification and PSA recordings. Shoutcast/Oddcast supports track identification so I just made sure the MP3 was named “Artist – Trackname” and everything worked great!

    1. “Believe it or not, the boss still grumbled about “all the bandwidth that used””

      Whatever you were doing probably interrupted his personal office feed of {random American Sports Event}.

  2. I’m sympathetic; I recently bought a desktop FM radio. Having some background music improves my mood. And I find it’s really nice to delegate the playlist to the radio DJ. It exposes me to some content I would never find on my own, and requires zero screen time to maintain.

    I.E. if you are English language person, consider skipping the shell scripts and just tuning into KEXP :)
    90.3 Seattle
    92.7 Bay Area
    Streaming live at http://www.kexp.org/listen/

    1. Be careful with KEXP! Google search first! Its well established that they have supported antisemitic and racist content and views over the years. They are also reported to actively support the NW Bail fund which has been known to provide bail money to pedifiles and rapists – putting them back out into the community. Not a cool organization…

      1. Mm. Different folks have different fu’s. My Perl-fu has historically been much, MUCH stronger than my Python-fu, so for me the answer to many questions was “Perl.”

        My Arduino-fu has gotten very strong, so now I tend to throw an Arduino-IDE ESP32 with MQTT at … well, dang near anything.

        However, occasionally I’ve needed more oomph, so my Pi-fu is gaining.

        Point being that, yes, there is the problem of when everything you have is a hammer everything looks like a nail … but if you’re really talented with that hammer, maybe that’s okay.

        1. Skull.
          ‘When all you have is a hammer everything looks like a skull.’

          One of the best gauges of a coders skill is ‘# of languages proficient’.
          Followed by ‘list them’…

          BSers will claim more languages then they can name, much less code in.
          The question is a trap.
          Forward the skilled bold liars resumes to marketing.

          Skilled coders will sandbag.
          I will never admit to knowing any obsolete language (Fortran, COBOL, vba, DataFlex etc) much less any of the great 21st century greased pig Fs (Javascript and libraries, Python and libraries).

          Nope!
          WTF are you talking about?
          ‘I’ve never heard of JS on the server, sounds like a terrible idea.’

      2. I’ve found that on low-power headless systems that may require a lot of tweaking over time, it’s really convenient to be able to just SSH in, edit one line, and restart the python app.

        The alternative is sitting around while a puny ARM cpu recompiles your code, or having a whole external build and deploy process. If you’re like me and it takes 5+ cycles of experimentation to find the right fix, then this adds up.

        1. ‘We don’t always test, but when we do, it’s in production!’

          That’s the world of Python.

          Python is like VBA.
          It’s not so much that there is something wrong with the language.
          It’s the users that are the problem.

          That’s unfair to VBA.
          They have an adult in the room keeping them from constantly breaking backward compatibility.

          Python is fine for connecting you hobbies.
          People try to use it for real work.

          It’s a big problem if it’s your only language.

          MicroPython is the worst of class.
          It is to Python as Calc for business majors is to real math.

  3. you can get powerful FCC-ignoring FM transmitters from China that you can hear from miles away if you broadcast from a mountain top. such devices, attached to a raspberry pi and a solar panel, could easily be the basis for a great local pirate radio station. given the hollowed-out nature of current federal law enforcement and the fact that only people with dentures listen to the radio, your station would probably operate for years unmolested

    1. Not sure about the US but here in the more civilized part of the world we have fully automatic spectrum monitoring stations operating 24/7. 1990s era of playing cat-and-mouse game with comms authority is long gone.

      1. Uncle Charlie remains as feckless and useless as ever.
        That’s the way we like it here on the good side of the pond.
        The side where the government hasn’t gone murderously out of control in living memory.
        Required the ‘uncivilized’ part of the world to save them from themselves…twice.

        Don’t mess with emergency, aviation and military bands and you should be fine.
        If you don’t mess with actively used commercial frequencies you are absolutely fine.

        Especially if you DON’T have a FCC license in the first place.
        If you are a ham they can pull your license.

        Kind of like people with no FAA papers and a home built airplane/helicopter/quad.
        We just stand back and video.
        Won’t let ’em on an airport, but fields are free game.

        I digress.

        FREEDOM!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.