aferenbach
Posts: 8
Joined: Fri Mar 10, 2017 11:21 am

Headless KODI Internet radio setup

Mon Apr 20, 2020 12:00 pm

Dear All

I have been following the following guide to try and set up an internet radio to automatically start playing my wife's favourite radio station.

https://www.reichelt.com/magazin/en/kod ... net-radio/

I totally skipped the bit about the touchscreen.

I installed the latest Raspbian Buster, taught it to connect to my home WiFi
I updated the thing
I installed Kodi
I installed the Radio addon
I selected the radio station of interest
Went into the log file and snagged the station ID (felt like a total hacker by this point)
I made the thingy inside Kodi to make it automatically start with my chosen station when Kodi is opened....

*here is the bit from the guide below where the wheels came off*

Now that the radio starts automatically when you open KODI, you only need to start KODI automatically when you start the RPi. To do this, open the following file:

nano /home/pi/.config/lxsession/LXDE-pi/autostart <---- This file and directory did not exist?!?
And add the entry @kodi -fs in a new line. <---- so I couldn't do this bit

When you restart your RPi, your KODI internet radio starts automatically on your favorite radio station, no matter where in the world you are!
* here ends his guide*

It is frustrating to be so near yet so far. I just need to make Raspbian automatically start Kodi on start then the Pi can just be hooked up to speakers and power.

If someone can help me out of this pickle I will majorly appreciate it

DarrenHill
Posts: 265
Joined: Fri Oct 03, 2014 3:03 pm

Re: Headless KODI Internet radio setup

Wed Apr 22, 2020 5:57 pm

You might be better using Volumio and one of its auto-play plugins for such a solution.

But if you want to use Kodi, then the LibreElec or OSMC distributions would be a better route than a Raspbian install as they are streamlined OS packages which only have Kodi as their single application, and auto-start that way. You can then install the Rad.io addon onto it in the same way that you have done with the current install and set it up as you have done.

By design Kodi will run automatically on boot in both distro's, as that's what the OS underneath is exclusively designed to do.

derekrv
Posts: 1
Joined: Thu Apr 23, 2020 12:06 am

Re: Headless KODI Internet radio setup

Thu Apr 23, 2020 12:21 am

If you don't want to use the shell and mess about with / learn about how current Raspian distributions boot, follow Darren's advice and use Volumio. I have it running, and except that it doesn't (for some reason) allow me to easily stream CBC Radio 1 Toronto, it works fine.

If you want to stay with Kodi and autostart it, a Google search for "autostart kodi raspian" yields lots of stuff to read. This link:
https://raspberrypi.stackexchange.com/q ... di-at-boot
has lots of good info.

Assuming you're close to "latest & greatest" Raspian release, and the Kodi software you downloaded installs itself as a service, this may work for you:

sudo systemctl enable kodi

sudo systemctl start kodi.service (or just reboot after enabling)

If it doesn't install as a service, there's more Goole searches in your future....

I'll be trying this myself, shortly, so I'll be finding out on my own if it works. I'm using a volumio instance to drive my (old, completely analog) stereo, but want an Internet radio elsewhere in the house (and have lots of old pis lying around).

aferenbach
Posts: 8
Joined: Fri Mar 10, 2017 11:21 am

Re: Headless KODI Internet radio setup

Sat Apr 25, 2020 10:44 am

Thanks so much for the replies. I tried doing Volumio but the snag I hit was that of all the radio stations they had access to it did not include my wife's favourite. This is grounds for immediate disqualification.

I am reverting back to trying to hot wire Kodi inside raspbian.

All things being equal I would just install osmc or something like that to have Kodi start automatically but I have no idea how to access the terminal on that sort of installation.

It looks like there is still much googling in my future.

Anyone who has any lightbulb moments in the meantime please let me know

Rascas
Posts: 704
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: Headless KODI Internet radio setup

Sat Apr 25, 2020 1:40 pm

Here is a good guide to setup Kodi on Raspbian: viewtopic.php?f=66&t=251645

Take a look on the autostart part. If you want to autostart Kodi after the Desktop Environment starts, you should edit the file /etc/xdg/lxsession/LXDE-pi/autostart. This file is a global autostart file for LXDE, for all users. If you just want it for user "pi", copy that file to /home/pi/.config/lxsession/LXDE-pi/autostart and edit it then.

DarrenHill
Posts: 265
Joined: Fri Oct 03, 2014 3:03 pm

Re: Headless KODI Internet radio setup

Sat Apr 25, 2020 2:14 pm

For OSMC or LibreElec, you can enable SSH during their set-up processes (or afterwards) and then from another computer on the same network you can remote connect into the Pi. Then you have your terminal to do what you want.

And for Volumio, you can add your own internet radio stations. Just go to Web Radio and click on the little 3-dot button in the corner of the big "My Web Radios" button. Put the name and URL for the station in there and it will appear in the Web Radio list under the given name.

aferenbach
Posts: 8
Joined: Fri Mar 10, 2017 11:21 am

Re: Headless KODI Internet radio setup

Fri May 01, 2020 12:14 pm

Hey guys

After extended wrestling matches with both Kodi and Volumio I came to a few conclusions

Kodi - it can find my wife's favourite station, but I have no luck setting it to auto play

Volumio - initially it didn't have my wife's favourite station and there are a million and one forum posts of people arguing about how to make it autoplay

However, in a fit of desparation I started on a quest to find how to add new stations to Volumio. It turns out it is easier than I thought. I watched a YouTube video about how to find streaming links inside radio station websites. If you get yourself to the page that lets you play the radio online then inspect the page source then there is a link in among all the code which plain and simple leads you direct to the audio stream itself.

This is where I jumped the tracks and stumbled on an article mentioning PiMusicBox (at pimusicbox.com). This fella is super compact, kinda like a diet version of Volumio. When I was reading how to set it up it was different from Volumio (which creates a wifi hotspot for you to connect to and configure) you instead need to edit the configuration file directly to give it your Wifi name and password. Turns out there are an awful lot more options in the file including..... A PLAY ON STARTUP OPTION!

After feeding in my wifi details I copy pasted the link in and fired up the PI...... nothing.

Then I went back into the document and realised I forgot to specify the Wifi Country (no clue why that is so important)

Plugged it back in and 2 mins later RFM Lisbon burst into life.

Victory dance!

I figured it was a nice thing to share - it was so easy even I could do it (so it must be super straightforward)

Return to “Media centres”