# Localhost refused to connect

**URL:** <https://discourse.mopidy.com/t/localhost-refused-to-connect/4436>\
**Category:** Misc\
**Created:** [November 4, 2020, 11:52pm UTC](https://discourse.mopidy.com/t/localhost-refused-to-connect/4436 "2020-11-04T23:52:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jd1103](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jd1103/32/1757_2.png) [@jd1103](https://discourse.mopidy.com/u/jd1103)\
**Post date:** [November 4, 2020, 11:52pm UTC](https://discourse.mopidy.com/t/localhost-refused-to-connect/4436/1 "2020-11-04T23:52:16Z")

</div>

I have had success running Mopidy as a service (or so I think, honestly I’ve kept my localhost tab open so it’s open when I restart my computer. Either way, I do not start it through the linux terminal.)

Today I installed a HiFiBerry Amp2, and got sound to play through some old speakers. I couldn’t control the volume so I messed around with the audio config file and downloaded alsamixer. I’m not sure if any of this is relevant but I’m providing it because now when I try to open localhost:6680 it tells me that it refused to connect. Below is my sudo mopidyctl config file.

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 = none  
mixer\_volume =  
output = alsasink device=hw:2,0  
buffer\_time =

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

[spotify]  
enabled = true  
username = userName  
password = \*\*\*\*\*\*\*\*  
client\_id = ClientID  
client\_secret = \*\*\*\*\*\*\*\*  
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 =

[raspberry-gpio]  
enabled = false ; Extension disabled by user config.

[radionet]  
enabled = true  
language = pl  
min\_bitrate = 96

[iris]  
enabled = true  
country = NZ  
locale = en\_NZ  
spotify\_authorization\_url = [https://jamesbarnsley.co.nz/iris/auth\_spotify.php](https://jamesbarnsley.co.nz/iris/auth_spotify.php)  
lastfm\_authorization\_url = [https://jamesbarnsley.co.nz/iris/auth\_lastfm.php](https://jamesbarnsley.co.nz/iris/auth_lastfm.php)  
genius\_authorization\_url = [https://jamesbarnsley.co.nz/iris/auth\_genius.php](https://jamesbarnsley.co.nz/iris/auth_genius.php)  
data\_dir = $XDG\_DATA\_DIR/iris

[gmusic]  
enabled = true  
refresh\_token = \*\*\*\*\*\*\*\*  
bitrate = 160  
deviceid =  
all\_access = false  
refresh\_library = 1440  
refresh\_playlists = 60  
radio\_stations\_in\_browse = true  
radio\_stations\_as\_playlists = false  
radio\_stations\_count =  
radio\_tracks\_count = 25  
top\_tracks\_count = 20

[alsamixer]  
enabled = true  
card = 0  
control = Master  
min\_volume = 0  
max\_volume = 100  
volume\_scale = cubic

[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

[mpd]  
enabled = true  
hostname = 0.0.0.0  
port = 6600  
password =  
max\_connections = 20  
connection\_timeout = 60  
zeroconf = Mopidy MPD server on $hostname  
command\_blacklist =  
listall  
listallinfo  
default\_playlist\_scheme = m3u

This is my sudo aplay -l. Once again not sure if it’s relevant but I did play with this today.

\*\*\*\* List of PLAYBACK Hardware Devices \*\*\*\*  
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]  
Subdevices: 4/4  
Subdevice #0: subdevice #0  
Subdevice #1: subdevice #1  
Subdevice #2: subdevice #2  
Subdevice #3: subdevice #3  
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]  
Subdevices: 4/4  
Subdevice #0: subdevice #0  
Subdevice #1: subdevice #1  
Subdevice #2: subdevice #2  
Subdevice #3: subdevice #3  
card 2: sndrpihifiberry [snd\_rpi\_hifiberry\_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 [HiFiBerry DAC+ HiFi pcm512x-hifi-0]  
Subdevices: 1/1  
Subdevice #0: subdevice #0

---

<div class="post-metadata">

**Author:** ![jd1103](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jd1103/32/1757_2.png) [@jd1103](https://discourse.mopidy.com/u/jd1103)\
**Post date:** [November 5, 2020, 1:00am UTC](https://discourse.mopidy.com/t/localhost-refused-to-connect/4436/2 "2020-11-05T01:00:09Z")

</div>

I seem to have solved my problem but I don’t know why. Here’s what the audio config was:  
[audio]  
mixer = none  
mixer\_volume =  
output = alsasink device=hw:2,0  
buffer\_time =

Here’s what I changed it to:  
[audio]  
mixer = software  
mixer\_volume =  
output = alsasink device=hw:0,0  
buffer\_time =

The line output = alsasink device=hw:0,0 was changed to this from 2,0 because in my root user under /boot/config.txt I changed this:

#Enable audio (loads snd\_bcm2835)  
dtparam=audio=on  
dtoverlay=hifiberry-dacplus

#Enable audio (loads snd\_bcm2835)  
#dtparam=audio=on  
dtoverlay=hifiberry-dacplus

Does anyone have any idea why this fixed my problem? Very confused. Now I’m trying to figure out how to control the volume without modifying these config values…

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [November 5, 2020, 8:48am UTC](https://discourse.mopidy.com/t/localhost-refused-to-connect/4436/3 "2020-11-05T08:48:26Z")

</div>

Without the log file, no. I guess ‘mixer= none’ is unlikely to work as you want but won’t prevent Mopidy from starting.
