<solved> How to persist radio stations?

Hi,
when I enter a radio station on the Radio page of Pi MusicBox, it is played, but on a restart this radio station is gone.

Also, the newly added station only is listed in the browser that I used to add it. Opening the Pi MusicBox pages on a different computer shows the radio station in Now Playing, but not in Radio.

This is somehow expected behavior, because of this statement that you can read on the Radio page:

The last 25 stations are saved locally (not on the server yet).

There are 8 pre-configured radio stations listed on Radio. These must be defined somewhere. So, I searched my Pi MusicBox for a file that contains the URL of a radio station that is pre-configured. My search (find / ! -type d -exec grep -H vprbbc24 {} \; 2> /dev/null, “vprbbc24” is a token of the URL of the “BBC WorldService” streaming URL) listed /boot/config/radiostations.js and /opt/webclient/js/radiostations.js. The latter is a symlink to the first one, which perfectly makes sense.

I edited /boot/config/radiostations.js using nano directly on the RaspBerry Pi. I put // in front of all existing all existing stations and added new lines for my own. But it makes no difference to page Radio. I even rebooted the Raspberry Pi – to no avail: Page Radio still looks I didn’t change anything… File radiostations.js is not resetted by a reboot. I still see the radio stations listed that I entered before.

Content of /boot/config/radiostations.js on my system:

root@MusicBox:~# cat /boot/config/radiostations.js
/**

  • Default Radiostations which appear in the webinterface. Edit if you like.
  • Take care when editting. Only edit the stuff between ‘’
  • And don’t use the default Windows Notepad for this (use Notepad++ on Windows)
    */

var radioStations = ;
//fill with defaults
// radioStations.push([‘NPR 24’, ‘http://nprdmp.ic.llnwd.net/stream/nprdmp_live01_mp3’]);
// radioStations.push([‘3FM Dutch’, ‘http://icecast.omroep.nl/3fm-bb-mp3’]);
// radioStations.push([‘BBC WorldService’, ‘http://vprbbc.streamguys.net:8000/vprbbc24.mp3’]);
// radioStations.push([‘Arrow Jazz’, ‘http://81.173.3.132:8082’]);
// radioStations.push([‘PBS Australia’, ‘http://eno.emit.com:8000/pbsfm_live_64.mp3’]);
// radioStations.push([‘Groove Salad - Soma FM’, ‘http://somafm.com/groovesalad.pls’]);
// radioStations.push([‘Kiss FM Berlin’, ‘http://stream.kissfm.de/kissfm/mp3-128/internetradio/’]);
// radioStations.push([‘Pinguin Radio’, ‘http://pr320.pinguinradio.com/listen.pls’]);
radioStations.push([‘FRITZ! vom rbb’, ‘http://rbb-mp3-fritz-m.akacast.akamaistream.net/7/799/292093/v1/gnl.akacast.akamaistream.net/rbb_mp3_fritz_m’]);
radioStations.push([‘FRITZ! vom rbb (Alternative)’, ‘http://rbb.ic.llnwd.net/stream/rbb_fritz_mp3_m_a’]);
radioStations.push([‘Deutschlandfunk’, ‘http://www.dradio.de/streaming/dlf_hq_ogg.m3u’]);
radioStations.push([‘Deutschlandradio Kultur’, ‘http://www.dradio.de/streaming/dkultur_hq_ogg.m3u’]);
radioStations.push([‘Deutschlandradio Wissen’, ‘http://www.dradio.de/streaming/dradiowissen_hq_ogg.m3u’]);
radioStations.push([‘SWR3’, ‘http://mp3-live.swr3.de/swr3_m.m3u’]);
radioStations.push([‘SWR2’, ‘http://mp3-live.swr.de/swr2_m.m3u’]);
radioStations.push([‘SWR Info’, ‘http://mp3-live.swr.de/swrinfo_m.m3u’]);

It is quite tedious to enter the streaming URLs each time I want to listen to my favorite radio station.
Advices are greatly appreciated!

Thanks in advance,

slowjoe

This should work indeed. Did you clear the cache of the browser? I created the symlink to make it easy to edit the radiostations.js on the SD-card, for non-Linux-users.

Oh, indeed, cleaning out all historic information in Firefox did the trick.
Thanks a ton, Wouter!

Hi slowjoe,

I also wanted to edit the default radiostations. I found the file in

/usr/local/lib/python2.7/dist-packages/mopidy_musicbox_webclient/static/js/streamuris.js

But if i changed the file, in the webinterface nothing changed. I deleted all browserdata and restarted the service … but nothing happens. Do you have any idea?

According to the file that you are referring to, I assume that you are not using Pi Musicbox, are you?
At least, I modified a different file. Is there no ‘radiostations.js’ on your system?

Usually a browser allows to force reloads of all data, e.g. by pressing Ctrl + F5. This should help as well.

Hi slowjoe,

Thx for your input.
Now it works!

thx

When redoing the system starting with a plain MusicBox 0.5.3 image I noticed the following:

  • radiostations.js is called streamuris.js in version 0.5.3. @sunni2002yout already referred to this new filename.
  • Firefox stores a cookie named streamuris (or similar), which needs to be cleared. For some reason in the MusicBox web UI key handlers seem to interfere with common keyboard strokes like ‘Ctrl + F5’. I cannot trigger a full refresh of the page by pressing ‘Ctrl + F5’!

I think I merged a fix from someone for key handling in Firefox so that
should be fixed in the next version of musicbox-webclient.

Has the file been moved in the past 2 years? Because it’s not there :frowning:
I would love to edit the list as well, but can’t seem to find the file.
The command to find the string stated by TS is running for 3 hours now without any result.

Yes, see the release notes for details https://github.com/pimusicbox/pimusicbox/releases/tag/v0.7.0RC3

You can also edit the list from the streams menu in the webclient. If you have further problems please start a new thread.

guys to edit first you should get the putty on pc (win 10)/search on the phone with an app called network scanner your pimusicbox ip /enter in putty /login with name-root password musicbox /in the console type sudo mc /search in music a file at the bottom called playlist/enter in that/than you have radio streams /f4 on that/edit and save with ctrl+x and y
have fun ,ryks