GerryDazoo / Slinger

Reuse SlingBox hardware without SlingBox Servers
175 stars 35 forks source link

What Ports Are Needed #511

Closed shawnh7 closed 1 year ago

shawnh7 commented 1 year ago

All, I just got the slinger working on a Le Potato- thanks Gerry! However, it won't work with the ufw firewall enabled, and I'd like to use a firewall for security. Can anyone tell me which ports need to be allowed through the firewall to make slinger functional? I've already allowed the port I set in config.ini? Thank you.

GerryDazoo commented 1 year ago

You may have to open the slingbox ports but I'd be surprised. All you should need to open is the [SERVER] port.

shawnh7 commented 1 year ago

Thanks for replying, Gerry. I opened my [SERVER] port as well as 5001, and 5301 and as soon as I connect with VLC, I get this: **------------------- _Streamer: "Rec Room" Waiting for first stream, flushing any IR requests that arrive while not connected to slingbox 01/27/2023, 20:54:11 Streaming connection from ('192.168.1.9', 60546)

Slinginfo "350/500/M1/M2" [PASSWORD] 12 30 5201 3072 "Rec Room" Starting Stream for 192.168.1.9:60546 Connecting... ('192.168.1.223', 5201) Control Traceback (most recent call last): File "/home/slingbox/slingbox_server.py", line 678, in streamer s_ctl, stream = start_slingbox_session(streams) File "/home/slingbox/slingbox_server.py", line 397, in start_slingbox_session s_ctl = sling_open(sling_net_address, 'Control') # open control connection to SB File "/home/slingbox/slingbox_server.py", line 363, in sling_open s.connect(addr) ConnectionRefusedError: [Errno 111] Connection refused "Rec Room" Badness starting slingbox session [Errno 111] Connection refused None ./sling.sh: line 10: 8553 Killed sudo python3 /home/slingbox/slingboxserver.py ------------------------**

It works fine if ufw is disabled.

swilsonnc commented 1 year ago

Here are the ports I have blocked in/out to my slingbox and it has been working just fine. Everything else is open.

access-list 199 remark Block_Slingbox_Ports_To_Prevent_Bricking access-list 199 deny tcp any eq www any access-list 199 deny udp any eq 80 any access-list 199 deny tcp any eq 443 any access-list 199 deny udp any eq 443 any access-list 199 deny tcp any eq 3074 any access-list 199 deny udp any eq 3074 any access-list 199 deny tcp any eq 3490 any access-list 199 deny udp any eq 3490 any access-list 199 deny tcp any eq 3724 any access-list 199 deny udp any eq 3724 any access-list 199 deny tcp any eq 5678 any access-list 199 deny udp any eq 5678 any access-list 199 deny tcp any eq 5680 any access-list 199 deny udp any eq 5680 any access-list 199 deny tcp any eq 8080 any access-list 199 deny udp any eq 8080 any access-list 199 permit ip any any

GerryDazoo commented 1 year ago

Please post ALL the server output. The server tries to verify the slingbox is accessible when it starts up, so there will be some clues there. I concur. you've got something wrong with your firewall settings.

PS. It has been determined that all you need to block is TCP port 5678 outgoing from your slingbox to prevent bricking.

shawnh7 commented 1 year ago

I was able to get this to work by allowing the slingbox IP through the ufw firewall. In case it helps other though, here's the full server output., with redactions for passwords, global IP, etc. without the firewall mod.

Version : 3.07 Running on Linux-5.19.17-meson64-aarch64-with-glibc2.35 pid= 1178 1 Using config file config.ini Connection Manager Running on port [SERVER PORT] with 10 max streams.... Streamer Running: 10 config.ini [SERVER PORT] starting up on port [SERVER PORT] Checking for slingbox at ('192.168.1.223', 5201) Reading Custom Remote definition from remote.txt Error reading remote definition file, using defaults

Register Successful Error connecting to ('192.168.1.223', 5201) No valid slingbox ip info found in config.ini Finding Slingbox on local network. My IP Info = [IP] Finding Slingbox on local network. My IP Info = 192.168.1.8 Can't find a slingbox on network. Please make sure it's plugged in and connected . Check config.ini Using slingbox at ('192.168.1.223', 5201) Streamer: "Rec Room" Waiting for first stream, flushing any IR requests that ar rive while not connected to slingbox 01/28/2023, 07:43:12 Streaming connection from ('192.168.1.9', 64781)

Slinginfo "350/500/M1/M2" [SLINGBOX PASSWORD] 12 30 5201 3072 "Rec Room" Starting Stream for 192.168.1.9:64781 Connecting... ('192.168.1.223', 5201) Control Traceback (most recent call last): File "/home/slingbox/slingbox_server.py", line 678, in streamer s_ctl, stream = start_slingbox_session(streams) File "/home/slingbox/slingbox_server.py", line 397, in start_slingbox_session s_ctl = sling_open(sling_net_address, 'Control') # open control connection t o SB File "/home/slingbox/slingbox_server.py", line 363, in sling_open s.connect(addr) OSError: [Errno 113] No route to host "Rec Room" Badness starting slingbox session [Errno 113] No route to host None ./sling.sh: line 10: 11779 Killed sudo python3 /home/slingbox/s lingbox_server.py

GerryDazoo commented 1 year ago

Error connecting to ('192.168.1.223', 5201) No valid slingbox ip info found in config.ini. This is your first clue.
Can't find a slingbox on network. Please make sure it's plugged in and connected . Check config.ini This is your second clue. There are no slingboxes on your LAN. [Errno 113] No route to host This is your third clue. Your slingbox IP is not on the same subnet as your server and there is no route to get packets from the server to the slingbox.

I though you got this working?

PS. You can unconfigure your FinderID, support for this is going away in the next release.

PPS. Using slingbox at ('192.168.1.223', 5201) Hmm, the code should have given up when it couldn't find any slingboxes and the initial connectivity check failed. Probably a bug in my code. I'll take a look.

shawnh7 commented 1 year ago

Thanks, Gerry. The snippet I posted is from before I set the IP allow on the firewall. With the firewall configured, I still get the "No valid slingbox" but then it searches and finds it and it works. This is what it looks like working:


Version : 3.07 Running on Linux-5.19.17-meson64-aarch64-with-glibc2.35 pid= 1242 5 Using config file config.ini Connection Manager Running on port [SERVER PORT] with 10 max streams.... Streamer Running: 10 config.ini [SERVER PORT] starting up on port [SERVER PORT] Checking for slingbox at ('192.168.1.223', 5201) Reading Custom Remote definition from remote.txt Error reading remote definition file, using defaults

Error connecting to ('192.168.1.223', 5201) Register Successful No valid slingbox ip info found in config.ini Finding Slingbox on local network. My IP Info = [IP] Finding Slingbox on local network. My IP Info = 192.168.1.8 Slingbox Found 192.168.1.10 5315 " Rec Room " Using slingbox at ('192.168.1.10', 5315) Streamer: "Rec Room" Waiting for first stream, flushing any IR requests that ar rive while not connected to slingbox 01/28/2023, 11:03:45 Streaming connection from ('192.168.1.9', 60573)

Slinginfo "350/500/M1/M2" [PASSWORD] 12 30 192.168.1.10 5315 3072 "Rec Room" Starting Stream for 192.168.1.9:60573 Connecting... ('192.168.1.10', 5315) Control "Rec Room" Selecting Video Source 0 Keycodes= [1, 4, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 38, 39, 40, 41, 42, 45, 46, 53, 62, 63, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81] VideoParameters: Resolution= 12 FrameRate= 30 VideoBandwidth= 4000 VideoSmoothness= 63 IframeRate= 5 AudioBitRate= 32 Connecting... ('192.168.1.10', 5315) Stream "Rec Room" Stream started at 01/28/2023, 11:03:47 744 0


I'm OK now running it like this with the IP exception in the UFW firewall. Just posting in case this helps others.

glennybob commented 1 year ago

Since RPi's are scarce and costly, this is a good addition. I just ordered one. Could you give some rough steps to get it going? Thanks!

GerryDazoo commented 1 year ago

You should fix your config.ini to use the correct IP address and port for your slingbox Slingbox Found 192.168.1.10 5315

GerryDazoo commented 1 year ago

glennybob : Read the ReadMe.

swilsonnc commented 1 year ago

Since RPi's are scarce and costly, this is a good addition. I just ordered one. Could you give some rough steps to get it going? Thanks!

You can use a raspbian-stretch image for it or use (my preference) an Ubuntu image such as Here . Just make sure it is for the s905x and use an image writer to write it to sdcard. Then it runs off sdcard. You can then ssh into it like any server or use a display and keyboard.

shawnh7 commented 1 year ago

For Le Potato setup, I used the Armbian image here: https://libre.computer/downloads/aml-s905x-cc/ and the youtube tutorial:https://www.youtube.com/watch?v=-d2zoc-UAuA

From there, Gerry's directions in the readme for linux worked fine.

shawnh7 commented 1 year ago

You should fix your config.ini to use the correct IP address and port for your slingbox Slingbox Found 192.168.1.10 5315

Will do- thanks.