Jellyfin Forum
SOLVED: Jellyfin and Mopidy no Connection - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: Jellyfin and Mopidy no Connection (/t-solved-jellyfin-and-mopidy-no-connection)



Jellyfin and Mopidy no Connection - Computerboss - 2023-11-19

Good evening everyone,

I have been trying to establish a connection between my Mopidy instance on my Raspberry Pi and the Jellyfin server for several hours, unfortunately without success.

I use Jellyfin in Docker on my Synology NAS.
I establish the connection from the PC via a domain, which is resolved via the reverse proxy of the NAS and points to the Docker application.

Alternatively, I have already tested that I release the Jellyfin port 8096 on the NAS directly and you can access the Jellyfin instance with HTTP.

I have configured Mopidy exactly according to the Jellyfin instructions:

https://jellyfin.org/docs/general/clients/mopidy/

From the section:
Raspberry Pi (Remote Controlled Speakers)

I have tried both the FQDN and the IP address of the Jellyfin server. Even with port :8096 it didn't work...

Here are three example configurations:

[jellyfin]
enabled = true
hostname = sub.domain.synology.me
username = mopidy
password = Test4543
libraries = Musik


[jellyfin]
hostname = 192.168.1.122
username = mopidy
password = Test4543



[jellyfin]
hostname = sub.domain.synology.me
user_id = mopidy
token = 34234234234234324234234234


nothing worked Slightly-frowning-face
Mopidy works though, I installed the TuneIn application and it worked straight away!

I would be very happy if someone has an idea?

Are the instructions at Jellyfin still up to date?

Best regards


RE: Jellyfin and Mopidy no Connection - TheDreadPirate - 2023-11-19

Have you tried the local IP address? If your router doesn't support NAT hairpin, using the domain name probably won't work.


RE: Jellyfin and Mopidy no Connection - mcarlton00 - 2023-11-19

Without more information than "it doesn't work" this might be hard to narrow down. Is there any output from the mopidy service indicating a problem? How are you testing? Comparing your examples to my working configs, you may need to include 'http://' or 'https://' in the hostname field. But log output would be more helpful than blind guesses.


RE: Jellyfin and Mopidy no Connection - Computerboss - 2023-11-20

@TheDreadPirate

Yes, i have been entered the Local IP Address like:

jellyfin]
hostname = 192.168.1.122
username = mopidy
password = Test4543

@mcarlton00
Unfortunately, I am not very familiar with Linux and Rasperry Pi. I have searched for logs but have not found any. Then I tried to save the log with the command mopidy -vvvvv 2>&1 | tee mopidy.log, unfortunately there were also errors.

Mopidy works very well with TuneIn but unfortunately not with Jellyfin.
I also tried HTTP and HTTPs, unfortunately without success.

Too bad there is no example.

What other information do you need?
I did it exactly according to the instructions linked above.
As I said, I'm not very familiar with Linux

i testet with access mopidy webpage and there is no shown jellyfin. Also Jellyfin does not display the Speaker as playback destination

playback destination is the only thing i need and it is so complicated Confused-face
Greetings and thank you


RE: Jellyfin and Mopidy no Connection - mcarlton00 - 2023-11-20

I use mopidy on my workstation daily.  For example, when I launch it I get a output about what plugins are installed and if any of them encounter an error.  In this you can see that I have a config for 'muse' but it's not installed, and further down you can see that i have JellyfinBackend enabled.

Code:
% mopidy
INFO    2023-11-20 10:02:49,003 [2628357:MainThread] mopidy.__main__
  Starting Mopidy 3.4.1
INFO    2023-11-20 10:02:49,020 [2628357:MainThread] mopidy.config
  Loading config from builtin defaults
INFO    2023-11-20 10:02:49,021 [2628357:MainThread] mopidy.config
  Loading config from file:///home/matt/.config/mopidy/mopidy.conf
INFO    2023-11-20 10:02:49,022 [2628357:MainThread] mopidy.config
  Loading config from command line options
WARNING  2023-11-20 10:02:49,024 [2628357:MainThread] mopidy.config
  Ignoring config section 'muse' because no matching extension was found
INFO    2023-11-20 10:02:49,090 [2628357:MainThread] mopidy.__main__
  Enabled extensions: file, stream, mpd, m3u, softwaremixer, jellyfin, http
INFO    2023-11-20 10:02:49,090 [2628357:MainThread] mopidy.__main__
  Disabled extensions: none
INFO    2023-11-20 10:02:49,175 [2628357:MainThread] mopidy.commands
  Starting Mopidy mixer: SoftwareMixer
INFO    2023-11-20 10:02:49,176 [2628357:MainThread] mopidy.commands
  Starting Mopidy audio
INFO    2023-11-20 10:02:49,176 [2628357:MainThread] mopidy.commands
  Starting Mopidy backends: JellyfinBackend, FileBackend, M3UBackend, StreamBackend
INFO    2023-11-20 10:02:49,180 [2628357:Audio-2 (_actor_loop)] mopidy.audio.actor
  Audio output set to "autoaudiosink"
INFO    2023-11-20 10:03:18,096 [2628357:MainThread] mopidy.commands
  Starting Mopidy core
INFO    2023-11-20 10:03:18,098 [2628357:MainThread] mopidy.commands
  Starting Mopidy frontends: EventMonitorFrontend, HttpFrontend, MpdFrontend
INFO    2023-11-20 10:03:18,114 [2628357:HttpFrontend-12 (_actor_loop)] mopidy.http.actor
  HTTP server running at [::ffff:127.0.0.1]:6680
WARNING  2023-11-20 10:03:18,116 [2628357:HttpServer] mopidy.http.handlers
  HTTP Cross-Site Request Forgery protection is disabled
INFO    2023-11-20 10:03:18,116 [2628357:MainThread] mopidy_mpd.actor
  MPD server running at [::ffff:0.0.0.0]:6600
INFO    2023-11-20 10:03:18,116 [2628357:MainThread] mopidy.commands
  Starting GLib mainloop
INFO    2023-11-20 10:03:18,674 [2628357:MpdSession-15 (_actor_loop)] mopidy_mpd.session
  New MPD connection from [::ffff:127.0.0.1]:42078

It doesn't really output anything more than that on it's own unless there are errors.

For example, if I purposely input an invalid hostname entry, I get output like this

Code:
INFO    2023-11-20 10:06:09,222 [2633026:MainThread] mopidy_jellyfin.http
  Jellyfin connection on try 0 with problem: Expecting value: line 1 column 1 (char 0)
INFO    2023-11-20 10:06:09,228 [2633026:MainThread] mopidy_jellyfin.http
  Jellyfin connection on try 1 with problem: Expecting value: line 1 column 1 (char 0)
INFO    2023-11-20 10:06:09,231 [2633026:MainThread] mopidy_jellyfin.http
  Jellyfin connection on try 2 with problem: Expecting value: line 1 column 1 (char 0)
INFO    2023-11-20 10:06:09,234 [2633026:MainThread] mopidy_jellyfin.http
  Jellyfin connection on try 3 with problem: Expecting value: line 1 column 1 (char 0)
INFO    2023-11-20 10:06:09,237 [2633026:MainThread] mopidy_jellyfin.http
  Jellyfin connection on try 4 with problem: Expecting value: line 1 column 1 (char 0)
INFO    2023-11-20 10:06:09,240 [2633026:MainThread] mopidy_jellyfin.http
  Jellyfin connection on try 5 with problem: Expecting value: line 1 column 1 (char 0)
ERROR    2023-11-20 10:06:09,240 [2633026:MainThread] mopidy.commands
  Got un-handled exception from JellyfinBackend
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mopidy/commands.py", line 248, in _actor_error_handling
    yield
  File "/usr/lib/python3.11/site-packages/mopidy/commands.py", line 412, in start_backends
    backend = backend_class.start(
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pykka/_actor.py", line 86, in start
    obj = cls(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^
  File "/home/matt/.local/lib/python3.11/site-packages/mopidy_jellyfin/backend.py", line 26, in __init__
    self.remote = JellyfinHandler(config)
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matt/.local/lib/python3.11/site-packages/mopidy_jellyfin/remote.py", line 75, in __init__
    self._login()
  File "/home/matt/.local/lib/python3.11/site-packages/mopidy_jellyfin/remote.py", line 91, in _login
    auth_details = self.http.post(
                  ^^^^^^^^^^^^^^^
  File "/home/matt/.local/lib/python3.11/site-packages/mopidy_jellyfin/http.py", line 83, in post
    raise Exception('Cant connect to Jellyfin API')
Exception: Cant connect to Jellyfin API

As you're running this on a Pi, I suspect you're running it under a systemd service.  In this case, you should be able to check on it with systemctl status mopidy and journalctl -u mopidy

This is my current config that's been working for the last ~2 years or so.

Code:
[jellyfin]
hostname = https://streaming.nerdyredneck.net
username = Matt
password = mysupersecretpassword
libraries = Music
album_format = {ProductionYear} - {Name}



RE: Jellyfin and Mopidy no Connection - Computerboss - 2023-11-20

Thank you very much for your detailed answer!
I have installed all new and now it worked Smiling-face

I have made few changes and restartet the rasperry but i think the changes will not be confirmed. So i have tryied
sudo systemctl restart mopidy
after that the config reloads correctly and i can access to my jellyfin its very great Smiling-face

Is it possible to play music synchron on two or three rasperrys like apple airplay or only individual control each rasperry?

Greetings and thank you Smiling-face


RE: Jellyfin and Mopidy no Connection - mcarlton00 - 2023-11-20

Basically you want to send one music stream to multiple client devices?  Not directly through Jellyfin, no.  However there's another project that you should be able to plug into relatively painlessly.  I don't have any first hand experience with it, but I know somebody else was trying to do something similar a few years ago and afaik they got it to work.

https://github.com/badaix/snapcast