Getting raspotify to work with UFW

Reply

Getting raspotify to work with UFW

Twigzz
Visitor

Plan

Premium

 

Device

Raspberry Pi 4

Operating System

Rasbian Buster

 

My Question or Issue

Hey guys, I'm trying to get Spotify to detect my raspberry pi which is using raspotify (https://github.com/dtcooper/raspotify). 
If I were to disable UFW, I'm able to connect to my raspberry pi with no issues.

However, whenever UFW is enabled Spotify can't detect the pi.


Any ideas what UFW rule should I add to make it work? 

 

 

1 Reply

Re: Getting raspotify to work with UFW

Rising Star 12 ArtGravity
Rising Star 12

Check your logs to see what ufw is blocking, and adjust your rules accordingly. I'd recommend creating a ufw app profile. That way if it the port you are opening up keeps changing you just need to edit the app profile and reload it against your active rules.

 

If the port is changing, you will need to either find a way to capture the port and add it to your rules, or set the port via startup options in the app itself.  There is a rough outline to one way of approaching the former in the comments on issue #126 of raspotify. The options page of the librespot wiki lists an setting called 'zeroconf-port' that might solve the problem using the latter method, but you'll need to figure out how to pass that option from rapsotify to librespot.

 

It might be worth popping into the Gitter.im chat room listed on the main page of the librespot Github repo to see if anyone in there has worked through this already, as the topic has come up in the issues pages of both projects on several occasions.

ArtGravityRising Star 12
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.
SUGGESTED POSTS