McKael / samtv

samtvcli -- Network CLI remote for Samsung TVs (models 2014-2015)
https://lilotux.net/~mikael/pub/samtv/
MIT License
38 stars 4 forks source link

Pairing works but cant send any keys #7

Closed cgarz closed 4 years ago

cgarz commented 4 years ago

TV is a K series (UE49K5500AKXXU).

samtvcli version is v1.0.1.

Debug reads as follows:

INFO[0000] Using config file: /home/cgar/.config/samtvcli/samtvcli.yaml 
DEBU[0000] Fetch URL: http://192.168.1.101:8000/socket.io/1/?t=1573533303580 
DEBU[0000] Reading WS message...                        
DEBU[0000] Read message (type 1): `1::`                 
DEBU[0000] Got greetings from TV                        
DEBU[0000] Sending SmartView handshake...               
DEBU[0000] Sending WS message: `1::/com.samsung.companion` ... 
DEBU[0000] Reading WS message...                        
DEBU[0000] Read message (type 1): `1::/com.samsung.companion` 
DEBU[0000] SmartView handshake completed                
DEBU[0000] Reading WS message...                        
DEBU[0000] sendMessage('KEY_MUTE')                      
DEBU[0000] Sending WS message: `5::/com.samsung.companion:{"name":"callCommon","args":[{"Session_Id":1,"body":"[51, 227, 27, 153, 230, 186, 142, 253, 138, 35, 155, 147, 91, 112, 35, 205, 40, 164, 155, 63, 52, 39, 247, 108, 194, 145, 45, 190, 244, 206, 75, 234, 37, 81, 126, 23, 88, 63, 115, 156, 22, 245, 192, 215, 38, 105, 85, 160, 25, 10, 218, 165, 181, 174, 165, 84, 58, 135, 76, 235, 240, 20, 13, 83, 52, 3, 153, 202, 146, 167, 127, 21, 25, 163, 56, 182, 243, 5, 74, 104, 187, 250, 19, 36, 139, 227, 225, 171, 112, 222, 48, 236, 114, 116, 83, 198, 3, 185, 2, 16, 76, 209, 18, 241, 154, 188, 95, 159, 152, 97, 221, 189, 162, 64, 202, 28, 41, 143, 76, 82, 192, 210, 34, 7, 165, 169, 88, 83, 161, 139, 171, 20, 2, 157, 120, 127, 62, 40, 252, 155, 212, 41, 82, 224, 63, 191, 10, 124, 9, 6, 108, 34, 165, 11, 224, 18, 72, 73, 118, 51, 250, 112, 197, 218, 212, 175, 24, 121, 211, 31, 31, 213, 15, 135, 152, 121]"}]}` ... 
DEBU[0000] Read message (type 1): `5::/com.samsung.companion:{"name":"receiveCommon","args":"{\"type\":\"Buffer\",\"data\":[161,68,134,81,213,12,158,20,48,53,211,65,200,103,198,84,32,52,60,225,226,101,21,17,251,200,223,155,116,167,231,208,103,241,105,190,132,91,253,169,237,95,30,37,84,44,109,159,204,71,240,95,81,7,250,162,20,136,74,252,213,67,60,114]}"}` 
DEBU[0000] SmartView message received                   
ERRO[0000] Could not parse message: cannot parse encrypted response: json: cannot unmarshal object into Go value of type []uint8 
DEBU[0000] Reading WS message...                        
ERRO[0005] Cannot send key 'KEY_MUTE': no reply from TV
McKael commented 4 years ago

I don't think your TV uses the same protocol, it is nor a H nor a J model.

cgarz commented 4 years ago

Ah that's a pity. I missed that it was H/J specific. Would have been nice to have that lovely interface. I managed to slap something together with inspiration from: https://github.com/krzynio/python-samsung-smarttv-2016/blob/master/sstv2016.py

So now I can switch to Wii/HDMI and turn on/off by sending keys or sending a WoL packet. I'll close this. Thanks anyway :smiley: