Mopidy server running, but unable to connect

Hi all,

I’ve set up Mopidy to run as a service on a raspberry pi. I’m mostly using this as a spotify server for now. The problem is everything seems to check out, but when I connect with a MPD client it is empty (as if not connected), and I am unable to resolve http://localhost:6680/moped.

I’ve set up the config file as follows to enable my spotify pro account and spotify tunigo to browse using the MPoD MPD client, as well as moped–a web client:

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]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging.conf

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

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

[moped]
enabled = true

[spotify_tunigo]
enabled = true
region = 
sub_genres = true
cache_time = 3600

[spotify]
enabled = true
username = torpedoes_away
password = ********
bitrate = 160
volume_normalization = true
private_session = false
timeout = 10
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 20
search_artist_count = 10
search_track_count = 50
toplist_countries = 

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password = 
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist = 
  listall
  listallinfo
default_playlist_scheme = m3u

[http]
enabled = true
hostname = 127.0.0.1
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir = /var/lib/mopidy/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs = 
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions = 
  .jpg
  .jpeg
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = false  ; Extension disabled by user config.

Checking the status of the server shows everything is ok:

pi@raspberrypi:~ $ sudo systemctl status mopidy
● mopidy.service - Mopidy music server
Loaded: loaded (/lib/systemd/system/mopidy.service; enabled)
Active: active (running) since Thu 2017-01-12 00:49:28 HST; 8min ago
Process: 527 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
Process: 498 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
Main PID: 531 (mopidy)
CGroup: /system.slice/mopidy.service
└─531 /usr/bin/python /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Jan 12 00:51:41 raspberrypi mopidy[531]: INFO Starting Mopidy audio
Jan 12 00:51:41 raspberrypi mopidy[531]: INFO Starting Mopidy backends: SpotifyTunigoBackend, SpotifyBackend, StreamBack…Backend
Jan 12 00:51:46 raspberrypi mopidy[531]: INFO Audio output set to “autoaudiosink”
Jan 12 00:51:46 raspberrypi mopidy[531]: INFO Starting Mopidy core
Jan 12 00:51:47 raspberrypi mopidy[531]: INFO Logged in to Spotify in offline mode
Jan 12 00:51:47 raspberrypi mopidy[531]: INFO Starting Mopidy frontends: MpdFrontend, HttpFrontend
Jan 12 00:51:47 raspberrypi mopidy[531]: INFO MPD server running at [::ffff:127.0.0.1]:6600
Jan 12 00:51:47 raspberrypi mopidy[531]: INFO Starting GLib mainloop
Jan 12 00:51:47 raspberrypi mopidy[531]: INFO HTTP server running at [::ffff:127.0.0.1]:6680
Jan 12 00:51:47 raspberrypi mopidy[531]: INFO Logged in to Spotify in online mode
Hint: Some lines were ellipsized, use -l to show in full.

Any help would be appreciated.

Thanks.

If we assume your web browser / mpd client is not running on your raspberry pi then you need to change http/hostname and mpd/hostname as per the warning at https://docs.mopidy.com/en/latest/ext/http/ and the suggest at the top of https://docs.mopidy.com/en/latest/config/#configuration.

1 Like

That worked!

I set http/hostname to :: and both MDP and HTTP players are working.

So, as far as I understand, anyone on the LAN can access these services, right? Which is fine because it is a secured home network. I then would only need a proxy if I’d like to authenticate users and/or access from off the LAN?

Thanks again for your help!

Really only if you want to authenticate users. Access into your lan from outside is usually a firewall adjustment on your router (rarely a good idea, don’t do this).

1 Like

Hi, where exactly did you change the settings for hostname? I cannot seem to figure out how to change the config file for the mopidyctl user. Seems I am only able to change the config settings for the root user.

Explained at https://docs.mopidy.com/en/latest/service/#configuration

Ok, so what I’m trying to do is set up a service to run at reboot which I have done. When I do that, I am unable to reach the server(raspberry pi) from my laptop on the same network. It only works when I manually run mopidy when I ssh into it from my laptop. In https://docs.mopidy.com/en/latest/service/#configuration, it says " All configuration is in /etc/mopidy/mopidy.conf" but when I nano into that file it does not display the config variable hostname. Where can I modify the hostname for the service if it is not in /etc/mopidy/mopidy.conf?

Just add it. Only settings that you want to deviate from the default need to be added to mopidy.conf files. The docs configuration page states this.

Thanks. I added the settings to /etc/mopidy/mopidy.conf file and it works.