Problem installing/using RadioNet on Mopidy on Raspberry pi 4

On raspberry pi 4 , raspbian OS, using IRIS

Trying to install and run RadioNet

install it by :
sudo pip3 install Mopidy-RadioNet
sudo systemctl restart Mopidy

When I do

sudo service mopidy status, see the following :

pi@raspberrypi:~ $ sudo service mopidy status
● mopidy.service - Mopidy music server
Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-09-14 13:59:29 EDT; 23s ago
Process: 3003 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
Process: 3004 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
Main PID: 3005 (mopidy)
Tasks: 15 (limit: 4915)
CGroup: /system.slice/mopidy.service
└─3005 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Sep 14 13:59:30 raspberrypi mopidy[3005]: self.radionet.set_lang(str(config[‘radionet’][‘language’]))
Sep 14 13:59:30 raspberrypi mopidy[3005]: File “/usr/local/lib/python3.7/dist-packages/mopidy_radionet/radionet.py”, l
Sep 14 13:59:30 raspberrypi mopidy[3005]: logging.error("Radio.net not supported language: " - str(lang))
Sep 14 13:59:30 raspberrypi mopidy[3005]: TypeError: unsupported operand type(s) for -: ‘str’ and 'str’
Sep 14 13:59:30 raspberrypi mopidy[3005]: INFO [Audio-2] mopidy.audio.actor Audio output set to “alsasink”
Sep 14 13:59:30 raspberrypi mopidy[3005]: INFO [MainThread] mopidy.commands Starting Mopidy core
Sep 14 13:59:30 raspberrypi mopidy[3005]: INFO [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend,
Sep 14 13:59:30 raspberrypi mopidy[3005]: INFO [IrisFrontend-9] mopidy_iris.core Starting Iris 3.52.4
Sep 14 13:59:30 raspberrypi mopidy[3005]: INFO [HttpFrontend-11] mopidy.http.actor HTTP server running at [::ffff:0.
Sep 14 13:59:30 raspberrypi mopidy[3005]: INFO [MainThread] mopidy.commands Starting GLib mainloop
pi@raspberrypi:~ $

Beyond this, I have further questions in how to actually use the RadioNet extension- do you access from the IRIS ?

Code looks bugged to me, raise an issue at https://github.com/plintx/mopidy-radionet/issues

All backends are controlled through a frontend such as iris.

I had the same issue. You need to pick a language by adding to mopidy.conf (for English):

[radionet]
language = net

The documentation gives some other possibilities.

I haven’t tried Iris yet, but in Web Client and Muse, it appears under Browse alongside Files and Spotify if you have those.

For me, it doesn’t work at the moment. I think this is because RadioNet recently stopped using user accounts and the extension needs to be updated to reflect this.

I modified the config file as suggested.

Still see errors when enable and run “mopidy” command , as shown here :

pi@raspberrypi:~ $ mopidy
INFO Starting Mopidy 2.3.1
INFO Loading config from builtin defaults
INFO Loading config from /home/pi/.config/mopidy/mopidy.conf
INFO Loading config from command line options
INFO Enabled extensions: mpd, http, stream, m3u, softwaremixer, file, local, radionet
INFO Disabled extensions: none
INFO Starting Mopidy mixer: SoftwareMixer
INFO Starting Mopidy audio
INFO Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend, RadioNetBackend
INFO Audio output set to “autoaudiosink”
INFO No local library metadata cache found at /home/pi/.local/share/mopidy/local/library.json.gz. Please run mopidy local scan to index your local music library. If you do not have a local music collection, you can disable the local backend to hide this message.
INFO Loaded 0 local tracks using json
ERROR Got un-handled exception from RadioNetBackend
Traceback (most recent call last):
** File “/home/pi/.local/lib/python2.7/site-packages/mopidy/commands.py”, line 237, in _actor_error_handling**
** yield**
** File “/home/pi/.local/lib/python2.7/site-packages/mopidy/commands.py”, line 386, in start_backends**
** config=config, audio=audio).proxy()**
** File “/home/pi/.local/lib/python2.7/site-packages/pykka/_actor.py”, line 91, in start**
** obj = cls(args, kwargs)
** File “/home/pi/.local/lib/python2.7/site-packages/mopidy_radionet/backend.py”, line 33, in init
*
** self.radionet.set_lang(str(config[‘radionet’][‘language’]))**
** File “/home/pi/.local/lib/python2.7/site-packages/mopidy_radionet/radionet.py”, line 67, in set_lang**
** logging.error("Radio.net not supported language: " - str(lang))**
TypeError: unsupported operand type(s) for -: ‘unicode’ and 'str’
INFO Starting Mopidy core
INFO Starting Mopidy frontends: MpdFrontend, HttpFrontend
INFO MPD server running at [::ffff:127.0.0.1]:6600
ERROR Frontend (HttpFrontend) initialization error: HTTP server startup failed: [Errno 98] Address already in use
INFO Starting GLib mainloop

INFO Interrupted. Exiting…
INFO Stopping Mopidy frontends
^CINFO Stopping Mopidy core
INFO Stopping Mopidy backends
INFO Stopping Mopidy audio
INFO Stopping Mopidy mixer
pi@raspberrypi:~ pi@raspberrypi:~ sudo mopidyctl config
Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config” as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume =
output = alsasink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[radionet]
enabled = true
username = alice666.9
password = ********
language = net
min_bitrate = 96

[local]
enabled = true
media_dir = /home/pi/Music
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
included_file_extensions =
excluded_file_extensions =
.cue
.directory
.html
.jpeg
.jpg
.log
.nfo
.pdf
.png
.txt
.zip
directories =
Albums local:directory?type=album
Artists local:directory?type=artist
Composers local:directory?type=artist&role=composer
Genres local:directory?type=genre
Performers local:directory?type=artist&role=performer
Release Years local:directory?type=date&format=%25Y
Tracks local:directory?type=track
Last Week’s Updates local:directory?max-age=604800
Last Month’s Updates local:directory?max-age=2592000
timeout = 10
use_artist_sortname = false
album_art_files =
*.jpg
*.jpeg
*.png

[iris]
enabled = true
country = NZ
locale = en_NZ
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
data_dir = $XDG_DATA_DIR/iris

[internetarchive]
enabled = true
base_url = http://archive.org
collections =
audio
etree
librivoxaudio
audio_bookspoetry
audio_tech
audio_music
audio_news
audio_foreign
audio_podcast
audio_religion
audio_formats =
VBR MP3
64Kbps MP3
image_formats =
JPEG
JPEG Thumb
browse_limit = 100
browse_views =
downloads desc|Views
titleSorter asc|Title
publicdate desc|Date Archived
date desc|Date Published
creatorSorter asc|Creator
search_limit = 20
search_order =
cache_size = 128
cache_ttl = 86400
retries = 3
timeout = 10

[file]
enabled = true
media_dirs =
$XDG_MUSIC_DIR|Music
~/|Home
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.pdf
.png
.txt
.zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
http
https
mms
rtmp
rtmps
rtsp
metadata_blacklist =
timeout = 5000
pi@raspberrypi:~ $

You probably want to be running the Mopidy service. See https://docs.mopidy.com/en/latest/running/

In the first post you used sudo service mopidy status, that is the status of the Mopidy service. The config for that lives in /etc/mopidy/mopidy.conf. You have installed and are/were running the Mopidy v3 service (good).

You then used pi@raspberrypi:~ $ mopidy, to run Mopidy “in a terminal” as your local user. The config for that lives in your home directory at /home/pi/.config/mopidy/mopidy.conf. I assume you did not change that file. You can also see in the log that was running a different, old version of Mopidy that you have also installed (probably by accident when using pip). We no longer support Mopidy v2.

You then did sudo mopidyctl config which is for the service again. Which is why it shows the config you expected.

Basically, your config change looks fine. But use sudo service mopidy restart to restart Mopidy and pick up that change. Do not run just mopidy (unless that’s really what you want to do, in which case we’ll leave you to that).

I hope someone does report that TypeError bug, backends shouldn’t throw unhandled exceptions.

Thanks SO much for the help , and also thank you for your patience with my questions and inexperience with linux/raspbian.

I power cycled/rebooted, did :
‘sudo service mopidy status’
‘sudo service mopidy restart’
‘sudo service mopidy status’

RESULT - now when I open the IRIS web service in the browser, under the BROWSE button, now I see the Radionet button for selection.

More dumb questions :

  1. how did you determine the version of mopidy that was running ?
  2. how do you add radio stations to the Radionet service ?

here is the output of what I did :

pi@raspberrypi:~ $ sudo service mopidy status
● mopidy.service - Mopidy music server
Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: e
Active: active (running) since Tue 2020-09-15 11:11:53 EDT; 3min 28s ago
Process: 468 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status
Process: 483 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exit
Main PID: 490 (mopidy)
Tasks: 14 (limit: 4915)
CGroup: /system.slice/mopidy.service
└─490 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/con

Sep 15 11:11:56 raspberrypi mopidy[490]: INFO [MainThread] mopidy.main D
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [MainThread] mopidy.commands S
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [MainThread] mopidy.commands S
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [MainThread] mopidy.commands S
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [MainThread] mopidy.commands S
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [Audio-2] mopidy.audio.actor A
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [MainThread] mopidy.commands S
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [IrisFrontend-10] mopidy_iris.
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [HttpFrontend-12] mopidy.http.
Sep 15 11:11:57 raspberrypi mopidy[490]: INFO [MainThread] mopidy.commands S
pi@raspberrypi:~ pi@raspberrypi:~ sudo service mopidy restart
pi@raspberrypi:~ pi@raspberrypi:~
pi@raspberrypi:~ $ sudo service mopidy status
● mopidy.service - Mopidy music server
Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: e
Active: active (running) since Tue 2020-09-15 11:15:44 EDT; 12s ago
Process: 999 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status
Process: 1000 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exi
Main PID: 1001 (mopidy)
Tasks: 14 (limit: 4915)
CGroup: /system.slice/mopidy.service
└─1001 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/co

Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.main
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.commands
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.commands
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.commands
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [Audio-2] mopidy.audio.actor
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.commands
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.commands
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [IrisFrontend-10] mopidy_iris
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [HttpFrontend-12] mopidy.http
Sep 15 11:15:46 raspberrypi mopidy[1001]: INFO [MainThread] mopidy.commands
pi@raspberrypi:~ $

Excellent!

Normally you would use sudo mopidyctl deps to show versions of everything when debugging. You can also see the version displayed in the log when Mopidy starts:

INFO Starting Mopidy 2.3.1

I think the log lines you have provided from the service in your last post have been truncated, I would guess one of them displayed the version.

Or, if you happen to know that Mopidy 3 only runs under Python 3 then you can see references to that dotted around:

CGroup: /system.slice/mopidy.service
└─3005 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

and similarly, when there are unhandled exceptions (ideally never) you can see it in the tracebacks:

Sep 14 13:59:30 raspberrypi mopidy[3005]: File “/usr/local/lib/python3.7/dist-packages/mopidy_radionet/radionet.py”,

I don’t know, I’ve never used that extension. Maybe @mjh-source can help there? If it’s anything like TuneIn then you can’t add your own stations to their service.

  1. how do you add radio stations to the Radionet service ?

I think the idea is you create a Radionet account, then favourite stations on there for them to appear on the Mopidy extension. Except you can no longer create a Radionet account.

See more here.

Alternatively, if you do find out how to get it to show some radio stations, let me know!

1 Like

The easiest way I found to play webradios on mopidy is just to save them in a m3u playlist, e.g.

  • Put the following in radios.m3u
#EXTM3U
#EXTINF:-1,Canal B 94.0 - Rennes
http://stream.levillage.org/canalb

#EXTINF:-1,fip-midfi.mp3
http://direct.fipradio.fr/live/fip-midfi.mp3
  • Put the radios.m3u file in the mopidy playlists folder (see the extension), and then you’re done.

Of course you need to find the right url for the stream, but that is usually not much of a problem.