Mopidy AAS and Login

Hi,

it’s me again. Just wondering 2 things. I already saw the older posts, but even that doesnt help me. As in the documentation described, I activate Mopidy as a service, already copied all the config from my local user to the /etc/mopidy/mopidy.conf. Restart my Pi but my browser doesnt connect to Mopidy, it works only if I connect me to the pi via ssh and run the command mopify.

[http]
hostname = ::

Everything was installed as root(sudo), the command I used was: sudo dpkg-reconfigure mopidy and the next command sudo service mopidy status show everything is running.

I’m using the last version of Mopidy, the last version of PiOS(i thnk is running devian?).

And a second question is, is there a posibility to activate some sort of login? I mean, if I go to another PC or device and with the browser go to the Mopidy server, I want to keep using Mopidy as if I’m sitting in my PC. I’m using mopidy with Iris plugin, and if I try to connect me from any other device, the configuration menu will show.

I don’t totally understand some of what you describe but either way, we have a page at Troubleshooting — Mopidy 3.4.2 documentation where we explain what sort of debug information you need to provide to give someone a chance to help. Specifically

  • sudo mopidyctl config
  • sudo mopidyctl deps.

already copied all the config from my local user to the /etc/mopidy/mopidy.conf

Don’t do that. Our documentation states you should just set the config options you require. Normally the defaults for most options are fine so the contents of your /etc/mopidy/mopidy.conf can be kept minimal and clear.

And a second question is, is there a posibility to activate some sort of login?

There is nothing built into Mopidy to provide a login but you can setup a reverse proxy such as apache or nginx to provide authentication. The below is just a hint for apache, I don’t know exactly what you need to include for it to work but I am sure google can help, I think there might also be nginx examples on this forum somewhere.

server {
        proxy_http_version 1.1;
        proxy_read_timeout 600s;

        location / {
                resolver 127.0.0.11 valid=30s;
                set $upstream mopidy;
                proxy_pass http://$upstream:6680;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $http_connection;

                # Authentication
                auth_basic "Mopidy";
                auth_basic_user_file /etc/apache2/mopidy;
        }
}

the configuration menu will show.

No idea what this mean. An iris configuration menu?

Sorry for my bad english. I will try to explain it a little better.

Of Course I didnt copy all the files from a to b, I just copy the necesary parameters like [http].

The reason I ask about the login session, is because when I call the Mopidy from another Pc/Laptop, the Iris plug in show me this:

Wich is a little anoying if I’m not sitting on my PC. And maybe if a login session is created, then I will no be ask to make the "“get started” window.

About the AaS:

sudo mopidyctl config

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.co                                      nf config" as user mopidy
/usr/lib/python2.7/dist-packages/mopidy/ext.py:202: PkgResourcesDeprecationWarni                                      ng: Parameters to load are deprecated.  Call .resolve and .require separately.
  extension_class = entry_point.load(require=False)
[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 =

[spotify_web]
enabled = false  ; Extension disabled due to config errors.
client_id = f0510eec-840e-4663-8b42-bf19c84d837e
client_secret = ********
mopidy_token_url = https://auth.mopidy.com/spotify/token
spotify_token_url = https://accounts.spotify.com/api/token
use_mopidy_oauth_bridge = true
refresh_token = please configure if you want to use spotify auth instead of mopi                                      dy swap service

[mpd]
enabled = true
hostname = ::
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 = ::
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true

[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 =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[local]
enabled = true
library = json
media_dir = /var/lib/mopidy/media
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip

[spotify]
enabled = true
username = r224nwo149a4poy8e7a3te9ww
password = ********
client_id = f0510eec-840e-4663-8b42-bf19c84d837e
client_secret = ********
bitrate = 320
volume_normalization = true
private_session = false
timeout = 10
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 40
search_artist_count = 30
search_track_count = 70
toplist_countries =

sudo mopidyctl deps

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
/usr/lib/python2.7/dist-packages/mopidy/ext.py:202: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
  extension_class = entry_point.load(require=False)
Executable: /usr/bin/mopidy
Platform: Linux-4.19.118-v7+-armv7l-with-debian-10.4
Python: CPython 2.7.16 from /usr/lib/python2.7
Mopidy: 2.2.3 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify-Web: 0.3.0 from /usr/local/lib/python2.7/dist-packages
  setuptools: 40.8.0 from /usr/lib/python2.7/dist-packages
  Mopidy-Spotify>=1.2.0: 3.1.0 from /usr/lib/python2.7/dist-packages
    Mopidy>=2.0: 2.2.3 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    pyspotify>=2.0.5: 2.0.5 from /usr/lib/python2.7/dist-packages
      cffi>=1.0.0: 1.12.2 from /usr/lib/python2.7/dist-packages
    requests>=2.0: 2.21.0 from /usr/lib/python2.7/dist-packages
  spotipy: 2.13.0 from /usr/local/lib/python2.7/dist-packages
    requests>=2.20.0: 2.21.0 from /usr/lib/python2.7/dist-packages
    six>=1.10.0: 1.12.0 from /usr/lib/python2.7/dist-packages
  Mopidy>=0.19.0: 2.2.3 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  requests: 2.21.0 from /usr/lib/python2.7/dist-packages
Mopidy-Spotify: 3.1.0 from /usr/lib/python2.7/dist-packages
  Mopidy>=2.0: 2.2.3 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  pyspotify>=2.0.5: 2.0.5 from /usr/lib/python2.7/dist-packages
    cffi>=1.0.0: 1.12.2 from /usr/lib/python2.7/dist-packages
  requests>=2.0: 2.21.0 from /usr/lib/python2.7/dist-packages
GStreamer: 1.14.4.0 from /usr/lib/python2.7/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.30.4
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad

I am pretty sure that needs to be setup once per browser/client (after which it’s saved as a browser cookie?) so a login system won’t help. But you should ask about that specifically at Issues · jaedb/Iris · GitHub as I think there is some method to pre-fill those values using a special link.

There is part of your problem. This is not the latest version of Mopidy, this is an old version. By far the easiest way to install the latest version of Mopidy on Raspbian (or whatever it’s now called) is to install from apt.mopidy.com by following the installation instructions at Debian/Ubuntu — Mopidy 3.4.2 documentation

Once you have installed Mopidy correctly it will report something like:

Mopidy: 3.0.2 from /usr/lib/python3/dist-packages

You will then also need to re-install all your extensions using the Python 3 installation method. For example, for Mopidy-Iris that would be:

sudo python3 -m pip install Mopidy-Iris

I updatet as you requested, now I’m running the newest version. But Mopidy doenst start as a service. I have to start the programm manually via ssh and if I close the ssh connection the sound is out…

Please provide the log file for the service saying why it won’t start.

Hi, well let me explain it.

You can reach the site:

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 Wed 2020-07-15 23:25:17 CEST; 9h ago
Process: 466 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
Process: 471 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
Main PID: 473 (mopidy)
Tasks: 16 (limit: 2077)
Memory: 60.2M
CGroup: /system.slice/mopidy.service
└─473 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Jul 15 23:25:30 raspberrypi mopidy[473]: INFO     [MainThread] mopidy.commands Starting Mopidy backends: FileBackend, M3UBackend, StreamBackend, SpotifyBackend
Jul 15 23:25:30 raspberrypi mopidy[473]: INFO     [Audio-2] mopidy.audio.actor Audio output set to "autoaudiosink"
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [SpotifyBackend-6] mopidy_spotify.web Logged into Spotify Web API as r224nwo149a4poy8e7a3te9ww
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [SpotifyEventLoop] mopidy_spotify.backend Logged in to Spotify in online mode
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [SpotifyBackend-6] mopidy_spotify.playlists Refreshed 0 Spotify playlists
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [MainThread] mopidy.commands Starting Mopidy core
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [MainThread] mopidy.commands Starting Mopidy frontends: HttpFrontend, QueueManagerFrontend, IrisFrontend
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [HttpFrontend-11] mopidy.http.actor HTTP server running at [::]:6680
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [IrisFrontend-13] mopidy_iris.core Starting Iris 3.50.0
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO     [MainThread] mopidy.commands Starting GLib mainloop

But at the moment that I hit the play buttom from any playlist:

pi@raspberrypi:~ $ sudo service mopidy status
● mopidy.service - Mopidy music server
Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-07-16 08:46:41 CEST; 1min 1s ago
Process: 466 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
Process: 471 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
Process: 473 ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf (code=exited, status=255/EXCEPTION)
Main PID: 473 (code=exited, status=255/EXCEPTION)

Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [SpotifyEventLoop] mopidy_spotify.backend Logged in to Spotify in online mode
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [SpotifyBackend-6] mopidy_spotify.playlists Refreshed 0 Spotify playlists
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [MainThread] mopidy.commands Starting Mopidy core
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [MainThread] mopidy.commands Starting Mopidy frontends: HttpFrontend, QueueManagerFrontend, IrisFrontend
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [HttpFrontend-11] mopidy.http.actor HTTP server running at [::]:6680
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [IrisFrontend-13] mopidy_iris.core Starting Iris 3.50.0
Jul 15 23:25:31 raspberrypi mopidy[473]: INFO [MainThread] mopidy.commands Starting GLib mainloop
Jul 16 08:46:41 raspberrypi mopidy[473]: * failed to open vchiq instance
Jul 16 08:46:41 raspberrypi systemd[1]: mopidy.service: Main process exited, code=exited, status=255/EXCEPTION
Jul 16 08:46:41 raspberrypi systemd[1]: mopidy.service: Failed with result ‘exit-code’.

But if I type in the terminal mopidy averything works as expected…

This is usually caused by not being in the video group,
This from the Docs
"If you used the Raspbian Desktop image you will need to add the mopidy user to the video group:

sudo adduser mopidy video"