2015-11-09, 05:10
just tried this with a UN65JS8500 sf it failed, is it safe to say I'm SOL?
#! /usr/bin/python
# Title: samsungremote.py
# Author: Asif Iqbal
# Date: 05APR2012
# Info: To send remote control commands to the Samsung tv over LAN
# TODO:
import socket
import base64
import time, datetime
import sys
cmdargs = str(sys.argv)
#IP Address of TV
tvip = "192.168.178.28"
#IP Address of TV
myip = "192.168.178.28"
#Used for the access control/validation, but not after that AFAIK
mymac = "5c:xxxxxxxxb"
#What the iPhone app reports
appstring = "iphone..iapp.samsung"
#Might need changing to match your TV type
tvappstring = "iphone.UE40D6500.iapp.samsung"
#What gets reported when it asks for permission
remotename = "Python Samsung Remote"
# Function to send keys
def sendKey(skey, dataSock, appstring):
messagepart3 = chr(0x00) + chr(0x00) + chr(0x00) + chr(len(
base64.b64encode(skey))) + chr(0x00) + base64.b64encode(skey);
part3 = chr(0x00) + chr(len(appstring)) + chr(0x00) \
+ appstring + chr(len(messagepart3)) + chr(0x00) + messagepart3
dataSock.send(part3);
# Open Socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((tvip, 55000))
# Key Reference
# Normal remote keys
#KEY_0
#KEY_1
#KEY_2
#KEY_3
#KEY_4
#KEY_5
#KEY_6
#KEY_7
#KEY_8
#KEY_9
#KEY_UP
#KEY_DOWN
#KEY_LEFT
#KEY_RIGHT
#KEY_MENU
#KEY_PRECH
#KEY_GUIDE
#KEY_INFO
#KEY_RETURN
#KEY_CH_LIST
#KEY_EXIT
#KEY_ENTER
#KEY_SOURCE
#KEY_AD #KEY_PLAY
#KEY_PAUSE
#KEY_MUTE
#KEY_PICTURE_SIZE
#KEY_VOLUP
#KEY_VOLDOWN
#KEY_TOOLS
#KEY_POWEROFF
#KEY_CHUP
#KEY_CHDOWN
#KEY_CONTENTS
#KEY_W_LINK #Media P
#KEY_RSS #Internet
#KEY_MTS #Dual
#KEY_CAPTION #Subt
#KEY_REWIND
#KEY_FF
#KEY_REC
#KEY_STOP
# Bonus buttons not on the normal remote:
#KEY_TV
#Don't work/wrong codes:
#KEY_CONTENT
#KEY_INTERNET
#KEY_PC
#KEY_HDMI1
#KEY_OFF
#KEY_POWER
#KEY_STANDBY
#KEY_DUAL
#KEY_SUBT
#KEY_CHANUP
#KEY_CHAN_UP
#KEY_PROGUP
#KEY_PROG_UP
# First configure the connection
ipencoded = base64.b64encode(myip)
macencoded = base64.b64encode(mymac)
messagepart1 = chr(0x64) + chr(0x00) + chr(len(ipencoded)) \
+ chr(0x00) + ipencoded + chr(len(macencoded)) + chr(0x00) \
+ macencoded + chr(len(base64.b64encode(remotename))) + chr(0x00) \
+ base64.b64encode(remotename)
part1 = chr(0x00) + chr(len(appstring)) + chr(0x00) + appstring \
+ chr(len(messagepart1)) + chr(0x00) + messagepart1
sock.send(part1)
messagepart2 = chr(0xc8) + chr(0x00)
part2 = chr(0x00) + chr(len(appstring)) + chr(0x00) + appstring \
+ chr(len(messagepart2)) + chr(0x00) + messagepart2
sock.send(part2)
# Now send the keys as you like, e.g.,
#sendKey("KEY_CHDOWN",sock,tvappstring)
sendKey(str(sys.argv[1]),sock,tvappstring)
print str(sys.argv[1])
# Close the socket when done
sock.close()
(2016-01-15, 21:48)OrbS82User Wrote: I tested this with my Samsung TV UE50H6470 but it will not work.
He is able to find my TV under the correct IP adress but then i get error message "connection failed":
(2016-01-26, 07:25)Glyde62 Wrote:(2016-01-15, 21:48)OrbS82User Wrote: I tested this with my Samsung TV UE50H6470 but it will not work.
He is able to find my TV under the correct IP adress but then i get error message "connection failed":
I just upgraded my TV to a UA55JU7000 and have the same problem, Was working perfectly on my older TV
(2016-02-06, 23:57)OrbS82User Wrote:Have had no luck here, Maybe someone will get it working on the newer Samsung's(2016-01-26, 07:25)Glyde62 Wrote:(2016-01-15, 21:48)OrbS82User Wrote: I tested this with my Samsung TV UE50H6470 but it will not work.
He is able to find my TV under the correct IP adress but then i get error message "connection failed":
I just upgraded my TV to a UA55JU7000 and have the same problem, Was working perfectly on my older TV
And now? No solution on this great feature? No one can fix this?