Ape / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
713 stars 191 forks source link

Websocket timeout exception #27

Closed fbjerggaard closed 7 years ago

fbjerggaard commented 7 years ago

Hi, I am getting a websocket timeout exception when trying to run this against my Samsung UE40KU6405 TV.

The command run is: samsungctl --host 10.10.0.191 --method websocket -i -v --timeout 10 POWER

The relevant network packages sent/received are:

T 10.10.20.248:49904 -> 10.10.0.191:8001 [AP]
GET /api/v2/channels/samsung.remote.control?name=c2Ftc3VuZ2N0bA== HTTP/1.1.
Upgrade: websocket.
Connection: Upgrade.
Host: 10.10.0.191:8001.
Origin: http://10.10.0.191:8001.
Sec-WebSocket-Key: rQzS/gChQASWksDDbnq7+A==.
Sec-WebSocket-Version: 13.
.

##
T 10.10.0.191:8001 -> 10.10.20.248:49904 [AP]
HTTP/1.1 101 Switching Protocols.
Upgrade: websocket.
Connection: Upgrade.
Sec-WebSocket-Accept: StzHg6opiZEMJIg4pld3vv3rnSI=.
.
##
T 10.10.0.191:8001 -> 10.10.20.248:49904 [AP]
..{"event":"ms.channel.timeOut"}

Any idea what I might be doing wrong?

fbjerggaard commented 7 years ago

Seems like I fixed it myself.. Tried from a PC on the same LAN as the TV's and that worked so I guess the TV doesn't like communicating across subnets

Phyks commented 6 years ago

Found a similar issue here. I have a router between the TV and my laptop running samsungctl and it does not work with port forwarding by the router. On the same subnet, there is no issue.

Looks like the TV really does not want to send packets to an IP on a different subnet. :/