Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    3,016

    Problems getting squeezeplay to work remotely over ssh

    I have used my mobile to connect remotely to LMS using ssh (using a public key exchange for security). I use Squeeze Commander and Squeeze Player for this, and it works well. Apart from the security and router set-up all I have to do is set up local ports 9000 and 3483 in ssh (using the -L parameter) on the mobile to route requests to those ports to my remote server's address.

    I also managed to get this working using squeezelite and a web browser on my laptop using the same technique. Both are connected using (local) address 127.0.0.1 which is intercepted by ssh and forwarded to LMS. The full ssh syntax is:
    Code:
    ssh -L localhost:9000:LMS-local-IP-address:9000 -L localhost:3483:LMS-local-IP-address:3483  LMS-dns-address
    I then tried to do this with squeezeplay on the same laptop. When I try to connect to 127.0.0.1 the playing side works OK (and can be controlled by a web browser on the laptop connected to port 9000). However, the squeezeplay control side fails to complete the connection and cannot be used. The 127.0.0.1 address reamins in the settings configuration, but cannot be used to control LMS.

    I have tried to determine the reason for this but (so far) failed. I have tried using firewall logging to work out what is happening but sorting the wood from the trees has proved beyond me thus far. I have tried with both laptop and LMS firewalls off, just in case, and also with my LMS IP-based security switched off. Neither of these helped. LMS on the server see the requests as local (from 127.0.0.1) which is what the ssh server is using.

    I have wondered whether an additional information exchange is needed with squeezeplay on one or more different ports for the control side which are not specified in my ssh command. This would explain why the playing side (on 3483) works but the control side fails to complete. However, I haven't been able to find out what this might be.

    Has anyone else ever managed to get squeezeplay to work in a similar way?
    LMS 7.9.3 on PC, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  2. #2
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,345
    The ssh -L feature only forwards TCP ports, so it works fine for squeezelite as long as you specify your lms server using -s lmshost as UDP is only used in the server discovery code. Squeezeplay expects UDP ports to be available (ie. forwarded) as well. Squeezeplay does work when using a vpn solution like openvpn.

    You may be able to get squeezeplay working with ssh by editing a couple of setting files as discussed in the thread. I've had mixed success with this method.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  3. #3
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    3,016
    Quote Originally Posted by ralphy View Post
    The ssh -L feature only forwards TCP ports, so it works fine for squeezelite as long as you specify your lms server using -s lmshost as UDP is only used in the server discovery code. Squeezeplay expects UDP ports to be available (ie. forwarded) as well. Squeezeplay does work when using a vpn solution like openvpn.

    You may be able to get squeezeplay working with ssh by editing a couple of setting files as discussed in the thread. I've had mixed success with this method.
    Thanks. I don't see any specific recommendation for ...lua file settings in that thread, but the explanation of why it doesn't work is most helpful. On doing a little googling I believe there are ways of using UDP over ssh, so I'll have a crack at that, presumably with port 3483.
    LMS 7.9.3 on PC, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  4. #4
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    3,016
    Quote Originally Posted by ralphy View Post
    The ssh -L feature only forwards TCP ports, so it works fine for squeezelite as long as you specify your lms server using -s lmshost as UDP is only used in the server discovery code. Squeezeplay expects UDP ports to be available (ie. forwarded) as well. Squeezeplay does work when using a vpn solution like openvpn.

    You may be able to get squeezeplay working with ssh by editing a couple of setting files as discussed in the thread. I've had mixed success with this method.
    I didn't find a solution in the lua settings files (I did try setting ChooseMusicSource.lua to settings = {poll={["127.0.0.1"]="127.0.0.1",},}) but I did find socat (via http://zarb.org/~gc/html/udp-in-ssh-tunneling.html).

    I added another -L for new port 34831 to my ssh command:
    Code:
    ssh -L localhost:9000:LMS-local-IP-address:9000 -L localhost:3483:LMS-local-IP-address:3483  -L localhost:34831:LMS-local-IP-address:34831  LMS-dns-address
    On the laptop I run this to send udp for 3483 to tcp port 34831:
    Code:
    socat -T15 udp4-recvfrom:3483,reuseaddr,fork tcp:localhost:34831
    On the server:
    Code:
    socat tcp4-listen:34831,reuseaddr,fork UDP:localhost:3483
    Thanks very much for your help. I have still singularly failed to solve the tolua++ make file issue on my laptop (on thread http://forums.slimdevices.com/showth...ad-Squeezeplay), which is very puzzling, but I do now have a working solution.
    LMS 7.9.3 on PC, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  5. #5
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    3,016
    To summarise my solution I'd just like to note that it can all be streamlined by combining the socat and ssh commands on the client side into one script, and by adding the name of the server's socat script to the end of the ssh command. I also added 'killall socat' to the two socat scripts before the socat command.

    So on the client side I have:

    Code:
    killall socat
    socat -T3600 upd4-.... & ssh -L ... user@LMS-dns-address name-of-server-socat-script
    And on the server, the "name-of-server-socat-script" contains:

    Code:
    killall socat
    socat tcp4-....
    This seems to work reliably thus far.
    LMS 7.9.3 on PC, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  6. #6
    Member nico's Avatar
    Join Date
    May 2005
    Location
    Tokyo, Japan
    Posts
    75
    I've followed your instructions but SqueezePlay still can't connect to my remote LMS via the assorted ssh & udp plumbing.

    I am running ssh and the 2 socats with verbose logging and I certainly see a lot of activity from all 3 programs. When launched, SqueezePlay displays "Connecting to 127.0.0.1" and spins for about 30 seconds, then gives up with the message "We couldn't connect to 127.0.0.1". As mentioned, during this time there is a lot of activity logging visible from ssh and socat.

    Doesn't the player/server discovery protocol use UDP broadcast packets? If so, are the socats correctly relaying those? They seem to only be relaying unicast UDP data on 3483 in one direction from the player to the server side. Does LMS reply back using UDP 3483, or with UDP broadcasts? If so, we might need another 2 instances of socat to provide the UDP backchannel... ?

    The only slight difference I can see in my configuration is that I am running LMS on TCP port 9500 instead of 9000. Accordingly, my ssh local forward argument for that port is
    Code:
    localhost:9000:LMS-local-IP-address:9500
    Would that break anything? In any case I am not seeing any activity on either ports 9500 or 9000...

    Thanks.

  7. #7
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    3,016
    Quote Originally Posted by nico View Post
    I've followed your instructions but SqueezePlay still can't connect to my remote LMS via the assorted ssh & udp plumbing.

    I am running ssh and the 2 socats with verbose logging and I certainly see a lot of activity from all 3 programs. When launched, SqueezePlay displays "Connecting to 127.0.0.1" and spins for about 30 seconds, then gives up with the message "We couldn't connect to 127.0.0.1". As mentioned, during this time there is a lot of activity logging visible from ssh and socat.

    Doesn't the player/server discovery protocol use UDP broadcast packets? If so, are the socats correctly relaying those? They seem to only be relaying unicast UDP data on 3483 in one direction from the player to the server side. Does LMS reply back using UDP 3483, or with UDP broadcasts? If so, we might need another 2 instances of socat to provide the UDP backchannel... ?

    The only slight difference I can see in my configuration is that I am running LMS on TCP port 9500 instead of 9000. Accordingly, my ssh local forward argument for that port is
    Code:
    localhost:9000:LMS-local-IP-address:9500
    Would that break anything? In any case I am not seeing any activity on either ports 9500 or 9000...

    Thanks.
    Hi,

    I'm no expert at this stuff, just a slightly persistent bodger. I also haven't tried this again since earlier this year. So I've only a few comments/suggestions.
    1. Can you log in to your LMS server with ssh remotely?
    2. Is it possible to try running LMS on port 9000 instead, however briefly?
    3. Are you able to get Squeezeplay to play music even if the control side isn't working (eg using a separate laptop connected as suggested in post #1)?
    4. Can you run squeezelite instead as in post #1?

    To clarify my somewhat broken up scripts, the client one is:
    Code:
    # To connect via ssh, socat maps 127.0.0.1 (localhost) 3483 to 34831.  Then ssh using 9000 and 3483 and 34831 to LMS.  
    # 34831 is used to map 3483 udp to tcp and back since ssh doesn't support udp.
    # So run this, then connect browser or squeezeplay (etc) to localhost:9000 (or 127.0.0.1 for squeezeplay)
    killall socat
    socat -T3600 udp4-recvfrom:3483,reuseaddr,fork tcp:localhost:34831 & ssh -L 9000:LMS-ip:9000 -L 3483:LMS-ip:3483 -L 34831:lms-ip:34831 LMS-DNS /home/me/sshsocat.sh
    Where LMS-ip is the LMS ip address on the LMS network (eg like 192.168.1.5, or whatever), LMS-DNS is my dynamic DNS address (via mynetgear in my case), and "/home/me/sshsocat.sh" is the file location on the LMS server of sshsocat.sh, which contains:
    Code:
    killall socat
    socat tcp4-listen:34831,reuseaddr,fork UDP:localhost:3483 &
    I hope that helps.
    LMS 7.9.3 on PC, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  8. #8
    Member nico's Avatar
    Join Date
    May 2005
    Location
    Tokyo, Japan
    Posts
    75
    Hi, thanks for those tips.

    Quote Originally Posted by PasTim View Post
    Hi,

    I'm no expert at this stuff, just a slightly persistent bodger.
    Aren't we all.

    1. Can you log in to your LMS server with ssh remotely?
    Yes, this is set up and works.

    2. Is it possible to try running LMS on port 9000 instead, however briefly?
    Yes, I did this, I am running LMS on port 9000 now.

    3. Are you able to get Squeezeplay to play music even if the control side isn't working (eg using a separate laptop connected as suggested in post #1)?
    Yes, this part is working. LMS can see SqueezePlay, and plays music if I control it exclusively through the LMS browser UI. SqueezePlay though, just gets stuck in a cycle of "connecting" and "try again" (see below).

    4. Can you run squeezelite instead as in post #1?
    I will look at that solution later.

    To clarify my somewhat broken up scripts [...]
    Thanks. I double checked and mine are the same. It's interesting this is working for you. As I mentioned, I wonder how the UDP broadcast part of the protocol is working... I'll have to read up a bit more on how the Slim UDP protocols are supposed to work.

    Also... wonder if having password protection enabled on LMS is an issue for SqueezePlay?

    Thanks.

    Name:  Screen Shot 2018-10-16 at 11.58.54.png
Views: 158
Size:  32.9 KB
    Name:  Screen Shot 2018-10-16 at 11.59.23.png
Views: 159
Size:  102.2 KB

  9. #9
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    3,016
    Quote Originally Posted by nico View Post
    Hi, thanks for those tips....
    Also... wonder if having password protection enabled on LMS is an issue for SqueezePlay?

    Thanks.
    I found an old report saying squeezeplay didn't like LMS with a password. Can you run squeezeplay locally rather than remotely, just to test it?
    LMS 7.9.3 on PC, Xubuntu 18.04, FLACs 16->24 bit, 44.1->192kbps. 2 Touchs & EDO.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Also Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 18.04 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  10. #10
    Member nico's Avatar
    Join Date
    May 2005
    Location
    Tokyo, Japan
    Posts
    75
    Quote Originally Posted by PasTim View Post
    I found an old report saying squeezeplay didn't like LMS with a password. Can you run squeezeplay locally rather than remotely, just to test it?
    Just tried that, and SqueezePlay doesn't have a problem with LMS password. It connected to my local LMS immediately and prompted me to enter a username/password, after which I had full access to my library. OK, so we can rule that one out.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •