-1

I am running a mopidy server on my Raspberry Pi 3B, using the Mopidy-MusicBox Webclient. I got it up and running locally on the pi and if I browse to http://localhost:6680/musicbox_webclient from the pi I can connect to the internally hosted website and everything works fine. However, if I replace localhost with the internal ip address of the pi (i.e. 192.168...) I am unable to connect from any other computer on the network. I tried testing various configurations and found out that using the real ip address even locally on the pi fails to connect. 127.0.0.1 and localhost will work, but the actual ip address fails. I even tried testing this locally on the pi with wifi disabled just to make sure the router wasn't involved in any way and got the same result. I also ran ifconfig to be absolutely sure I was using the correct ip address.

Some background: I'm using a static ip on the pi (configured in /etc/dhcpcd.conf). I'm able to ping the pi from other computers on the network, ssh to it and connect via vnc using the static ip address. My understanding is that there is no firewall installed on the pi out of the box and I haven't installed one so I'm pretty sure there's no firewall running. If I run netstat -tulpn it shows both ports 80 and 6680 are open. I'm thinking that there must be some configuration I need to change on the pi itself, but I'm not sure what it would be.

KKloke
  • 1

1 Answers1

0

Ok I messed around with this a little bit more and figured out the problem. By default mopidy uses the 127.0.0.1 loopback address as the hostname. This effectively restricts any HTTP requests to those originating from the local machine. Adding the following block to /etc/mopidy/mopidy.conf resolved the issue:

[http]
enabled = true
hostname = 0.0.0.0
port = 6680

According to the Mopidy HTTP docs using 0.0.0.0 will allow Mopidy to listen on all IPv4 interfaces. It will also work if you put the actual ip address there.

KKloke
  • 1