Samsung Wireless Remote Control/iPhone Protocol Decoded

Ideas and dreaming about C series TV will go this forum.

pjnewman
Posts: 9
Joined: Tue May 10, 2011 5:45 pm

Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby pjnewman » Tue May 10, 2011 6:14 pm

I've got a UE32C6500 and with a lot of luck, and some help from Wireshark, an old 10MB hub and my very patient housemate and his iPhone, I've managed to reverse engineer the "Wireless Remote Control" protocol used by the Samsung iPhone, and I assume Android remote controls. Thankfully it seems fairly resilient to me sending bad requests, the whole TV just appeared to reboot after a few tens of seconds, with a loudish bang, I assume as the amp input restarted. But obviously I make no guarantees, its your responsibility, etc. I'd also be interested if anyone can find any more key codes from inspecting the Samsung code; I stumbled across a "KEY_TV" which jumps to the TV source, and doesn't seem to exist on the IR or iPhone remotes, but couldn't find equivalents for the HDMI inputs etc.

Anyway what follows is some example Perl with a bit of documentation, and a sample AJAX style webpage to let you control it. It's not big or pretty, but it does the job rather effectively, and is very responsive.

I'm aware of the UPNP/SOAP stuff, although this didn't cover all buttons from what I could tell, and seemed to confuse the TV if you used some things in the wrong modes.

Enjoy...

Perl:

Code: Select all

#!/usr/bin/perl

use CGI qw(:standard);
use IO::Socket;
use MIME::Base64;

#IP Address of TV
my $tvip = "192.168.100.1";

print "Content-type: text/html\n\n";

my $sock = new IO::Socket::INET (
 PeerAddr => $tvip,
 PeerPort => '55000',
 Proto => 'tcp',
);
die "Could not create socket: $!\n" unless $sock;

#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

my $myip = "192.168.100.2"; #Doesn't seem to be really used
my $mymac = "01-23-45-67-89-ab"; #Used for the access control/validation, but not after that AFAIK
my $appstring = "iphone..iapp.samsung"; #What the iPhone app reports
my $tvappstring = "iphone.UE32C6500.iapp.samsung"; #Might need changing to match your TV type
my $remotename = "Perl Samsung Remote"; #What gets reported when it asks for permission/also shows in General->Wireless Remote Control menu

my $messagepart1 = chr(0x64) . chr(0x00) . chr(length(encode_base64($myip, ""))) . chr(0x00) . encode_base64($myip, "") . chr(length(encode_base64($mymac, ""))) . chr(0x00) . encode_base64($mymac, "") . chr(length(encode_base64($remotename, ""))) . chr(0x00) . encode_base64($remotename, "");
my $part1 = chr(0x00) . chr(length($appstring)) . chr(0x00) . $appstring . chr(length($messagepart1)) . chr(0x00) . $messagepart1;

print $sock $part1;
print $part1;
print "\n";

my $messagepart2 = chr(0xc8) . chr(0x00);
my $part2 = chr(0x00) . chr(length($appstring)) . chr(0x00) . $appstring . chr(length($messagepart2)) . chr(0x00) . $messagepart2;
print $sock $part2;
print $part2;
print "\n";

#Preceding sections all first time only

if (defined(param("key"))) {
   #Send remote key
   my $key = "KEY_" . param("key");
   my $messagepart3 = chr(0x00) . chr(0x00) . chr(0x00) . chr(length(encode_base64($key, ""))) . chr(0x00) . encode_base64($key, "");
   my $part3 = chr(0x00) . chr(length($tvappstring)) . chr(0x00) . $tvappstring . chr(length($messagepart3)) . chr(0x00) . $messagepart3;
   print $sock $part3;
   print $part3;
   print "\n";
} elsif (defined(param("text"))) {
   #Send text, e.g. in YouTube app's search, N.B. NOT BBC iPlayer app.
   my $text = param("text");
   my $messagepart3 = chr(0x01) . chr(0x00) . chr(length(encode_base64($text, ""))) . chr(0x00) . encode_base64($text, "");
   my $part3 = chr(0x01) . chr(length($appstring)) . chr(0x00) . $appstring . chr(length($messagepart3)) . chr(0x00) . $messagepart3;
   print $sock $part3;
   print $part3;
   print "\n";   
}

close($sock);

print "\n\n";


HTML:

Code: Select all

<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0">
<title>Samsung Remote</title>
</head>
<body>
<script type="text/javascript" language="javascript">
   //AJAX source from http://www.captain.at/howto-ajax-form-post-get.php
  var http_request = false;
   function makeRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            // set type accordingly to anticipated content type
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('GET', url + parameters, true);
      http_request.send(null);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            result = http_request.responseText;
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
</script>

<h1>Samsung Remote</h1>
<h3>Currently in Beta!</h3>
<br>

<table border="0" cellpadding="0" cellspacing="1" style="text-align: center;">
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=POWEROFF');">Power</a></td>
      <td>&nbsp;</td>
      <td>Backlight</td>
   </tr>
   <tr>
      <td>&nbsp;</td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=SOURCE');">Source</a></td>
      <td>&nbsp;</td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=1');">1</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=2');">2</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=3');">3</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=4');">4</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=5');">5</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=6');">6</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=7');">7</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=8');">8</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=9');">9</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=TTX_MIX');">TTX/Mix</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=0');">0</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=PRECH');">Pre-Ch</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=VOLUP');">Vol +</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=MUTE');">Mute</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=CHUP');">Prog +</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=VOLDOWN');">Vol -</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=CH_LIST');">Ch List</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=CHDOWN');">Prog -</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=CONTENTS');">Content</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=MENU');">Menu</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=GUIDE');">Guide</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=TOOLS');">Tools<a/></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=UP');">Up</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=INFO');">Info</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=LEFT');">Left</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=ENTER');">Enter</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=RIGHT');">Right</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=RETURN');">Return</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=DOWN');">Down</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=EXIT');">Exit</a></td>
   </tr>
   <tr>
      <td colspan=3>
      <table width="100%" style="text-align: center;">
      <td bgcolor="red"><a href="#" style="color: white;" onclick="javascript:makeRequest('samsungremote.cgi', '?key=RED');">A</a></td>
      <td bgcolor="green"><a href="#" style="color: white;" onclick="javascript:makeRequest('samsungremote.cgi', '?key=GREEN');">B</a></td>
      <td bgcolor="gold"><a href="#" style="color: white;" onclick="javascript:makeRequest('samsungremote.cgi', '?key=YELLOW');">C</a></td>
      <td bgcolor="darkblue"><a href="#" style="color: white;" onclick="javascript:makeRequest('samsungremote.cgi', '?key=CYAN');">D</a></td>
      </table>
      </td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=W_LINK');">Media P</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=RSS');">Internet</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=MTS');">Dual</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=AD');">AD<a/></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=PICTURE_SIZE');">P Size</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=CAPTION');">Subt</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=REWIND');">Rew</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=PAUSE');">Pause<a/></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=FF');">FF</a></td>
   </tr>
   <tr>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=REC');">Rec</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=PLAY');">Play</a></td>
      <td><a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=STOP');">Stop</a></td>
   </tr>
</table>
<br />
<input type="text" name="string" id="string" onKeyUp="javascript:makeRequest('samsungremote.cgi', '?text=' + encodeURIComponent(document.getElementById('string').value));" />&nbsp;<a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?text=' + encodeURIComponent(document.getElementById('string').value));">Send</a><br />
<a href="#" onclick="javascript:makeRequest('samsungremote.cgi', '?key=TV');">Switch to TV</a>
</body></html>
Last edited by pjnewman on Wed May 18, 2011 6:07 pm, edited 1 time in total.

User avatar
moras86
Official SamyGO Developer
Posts: 178
Joined: Sun Feb 21, 2010 3:18 pm
Location: Poland
Contact:

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby moras86 » Tue May 10, 2011 7:05 pm

There is very nice GUI port from iPhone work on PC created by xda-developers forum user. Check wiki - http://wiki.samygo.tv/?ti ... ung_Remote

After hex open file iRemote.dll you can see more key name:

Code: Select all

KEY_ZOOM1   KEY_ANTENA  KEY_ESAVING KEY_SLEEP   KEY_HDMI    KEY_AD  KEY_APP_LIST    KEY_TTX_MIX KEY_PANNEL_CHDOWN   KEY_SRS KEY_W_LINK  KEY_CAPTION KEY_MTS KEY_PICTURE_SIZE    KEY_PMODE   KEY_SOUND_MODE  KEY_TV  KEY_GUIDE   KEY_CONTENTS    KEY_INFO    KEY_STOP    KEY_POWEROFF    KEY_REC KEY_PAUSE   KEY_PLAY    KEY_FF  KEY_REWIND  KEY_FAVCH   KEY_CH_LIST KEY_SOURCE  KEY_YELLOW  KEY_CYAN    KEY_GREEN   KEY_RED KEY_EXIT    KEY_RSS KEY_LEFT    KEY_RIGHT   KEY_DOWN    KEY_UP  KEY_MENU    KEY_TOOLS   KEY_MUTE    KEY_RETURN  KEY_ENTER   KEY_PRECH   KEY_VOLDOWN KEY_VOLUP   KEY_CHDOWN  KEY_CHUP    KEY_PLUS100 KEY_0   KEY_9   KEY_8   KEY_7   KEY_6   KEY_5   KEY_4   KEY_3   KEY_2   KEY_1


___

Maybe Samsung use same names for keys in Samsung Apps (Internet@TV). In file from decrypted Widget Manager - path Common\API\TVKeyValue.js

Code: Select all

    this.KEY_TOOLS = 75;
    this.KEY_MUTE = 27;
    this.KEY_RETURN = 88;
    this.KEY_UP = 29460;
    this.KEY_DOWN = 29461;
    this.KEY_LEFT = 4;
    this.KEY_RIGHT = 5;
    this.KEY_WHEELDOWN = 29469;
    this.KEY_WHEELUP = 29468;
    this.KEY_ENTER = 29443;
    this.KEY_INFO = 31;
    this.KEY_EXIT = 45;
    this.KEY_RED = 108;
    this.KEY_GREEN = 20;
    this.KEY_YELLOW = 21;
    this.KEY_BLUE = 22;
    this.KEY_INFOLINK = 147;
    this.KEY_RW = 69;
    this.KEY_PAUSE = 74;
    this.KEY_FF = 72;
    this.KEY_PLAY = 71;
    this.KEY_STOP = 70;
    this.KEY_1 = 101;
    this.KEY_2 = 98;
    this.KEY_3 = 6;
    this.KEY_4 = 8;
    this.KEY_5 = 9;
    this.KEY_6 = 10;
    this.KEY_7 = 12;
    this.KEY_8 = 13;
    this.KEY_9 = 14;
    this.KEY_0 = 17;
    this.KEY_EMPTY = 0;
   
    this.KEY_PRECH = 259;
    this.KEY_SOURCE = 222;
    this.KEY_CHLIST = 84;
    this.KEY_MENU = 262;
    this.KEY_WLINK = 115;
    this.KEY_CC = 118;
    this.KEY_CONTENT = 261;
    this.KEY_FAVCH = 256;
    this.KEY_REC = 192;
    this.KEY_EMODE = 148;
    this.KEY_DMA = 260;
   
    this.KEY_PANEL_CH_UP= 105;
    this.KEY_PANEL_CH_DOWN = 106;
    this.KEY_PANEL_VOL_UP = 203;
    this.KEY_PANEL_VOL_DOWN = 204;
    this.KEY_PANEL_ENTER = 309;
    this.KEY_PANEL_SOURCE = 612;
    this.KEY_PANEL_MENU = 613;
    this.KEY_PANEL_POWER = 614;
   
   // Added by ck1.seo@samsung.com
   // For all key regist
   // 3 April 2009
   this.KEY_POWER = 76;
   this.KEY_TV = 77;
   this.KEY_VOL_UP = 7;
   this.KEY_VOL_DOWN = 11;
   this.KEY_CH_UP = 68;
   this.KEY_CH_DOWN = 65;
   this.KEY_TTX_MIX = 650;
   this.KEY_GUIDE = 651;
   this.KEY_SUBTITLE = 652;
   this.KEY_ASPECT = 653;
   this.KEY_DOLBY_SRR = 654;
   this.KEY_MTS = 655;
   this.KEY_12 = 1057;
   this.KEY_DISC_MENU = 1086;
   this.KEY_3D = 1219;   
   this.KEY_PIP_ONOFF = 1032;
   this.KEY_AD = 1039;
   this.KEY_PMODE = 1040;
   this.KEY_SMODE = 1043;
   this.KEY_PIP_CHUP = 1050;
   this.KEY_PIP_CHDOWN = 1051;   
   this.KEY_FF_ = 1078;
   this.KEY_REWIND_ = 1080;
   this.KEY_SUB_TITLE = 1089;
   this.KEY_SLEEP = 1097;
   this.KEY_D_AUDIO = 1236;
   this.KEY_D_FRONT_PLAY = 1243;   // for BD
   this.KEY_D_VIEW_MODE = 1249;
   this.KEY_STEP = 1023;         // REC PAUSE(BD)
   this.KEY_CALLER_ID = 1128;      // FULL SCREEN (BD)
   this.KEY_ZOOM1 = 1083;
   this.KEY_ANTENA = 1054;         // for CN
Image . Image
TV LCD: Samsung LE40B651T3W (CI) | Internet@TV | fw: 2005 (patched: SamyGO v0.24 + GMT2, ArFIX2, ADFIX) | matrix: SQ04
BluRay: Samsung BD-D5300-ZF | SamsungApps | fw: 1013
Raspberry Pi | rev: v1 (256 MB) | sd card: Toshiba 8 GB class 10 | os: OSMC (Kodi 14.1)
my projects:
Remote LAN Control - Desktop app (v0.8) | Signal checker for DVB-T (v0.3)

pjnewman
Posts: 9
Joined: Tue May 10, 2011 5:45 pm

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby pjnewman » Wed May 18, 2011 6:59 pm

Firstly, a user PMed me to point out a minor bug in the code, as I'd tidied it up from what I was testing with, I've updated the original post, but line 115 of the Perl had an errant equals sign at the end of it.

Thanks moras86, very interesting, particularly the text contents of iRemote.dll, at least some of the keys in that work, and others return not available or something, presumably because I'm not in the right mode. From the code in that, it looks like it might use some sort of HTTP based access to send keys, which is interesting and different to what I've seen before. Having just had a play, the Windows Samsung Remote software someone has written seems quite neat and does all the detection too.

The Widget Manager stuff doesn't seem to match, given e.g. CONTENT rather than CONTENTS.

Anyway hopefully someone will find the code or discoveries useful, either as it is, or for writing something themselves for a different platform.

zibri2
Posts: 134
Joined: Fri Apr 29, 2011 12:02 am

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby zibri2 » Fri May 20, 2011 11:23 pm

All possible remote keys are:

Code: Select all

KEY_MENU
KEY_UP
KEY_DOWN
KEY_LEFT
KEY_RIGHT
KEY_3
KEY_VOLUP
KEY_4
KEY_5
KEY_6
KEY_VOLDOWN
KEY_7
KEY_8
KEY_9
KEY_MUTE
KEY_CHDOWN
KEY_0
K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CESS
KEY_AUTO_ARC_AUTOCOLOR_FAIL
KEY_AUTO_ARC_C_FORCE_AGING
KEY_AUTO_ARC_USBJACK_INSPECT
KEY_AUTO_ARC_JACK_IDENT
KEY_NINE_SEPERATE
KEY_ZOOM_IN
KEY_ZOOM_OUT
KEY_MIC
KEY_HDMI2
KEY_HDMI3
KEY_AUTO_ARC_CAPTION_KOR
KEY_AUTO_ARC_CAPTION_ENG
KEY_AUTO_ARC_PIP_SOURCE_CHANGE
KEY_HDMI4
KEY_AUTO_ARC_ANTENNA_AIR
KEY_AUTO_ARC_ANTENNA_CABLE
KEY_AUTO_ARC_ANTENNA_SATELLITE
KEY_EXT1
KEY_EXT2
KEY_EXT3
KEY_EXT4
KEY_EXT5
KEY_EXT6
KEY_EXT7
KEY_EXT8
KEY_EXT9
KEY_EXT10
KEY_EXT11
KEY_EXT12
KEY_EXT13
KEY_EXT14
KEY_EXT15
KEY_EXT16
KEY_EXT17
KEY_EXT18
KEY_EXT19
KEY_EXT20
KEY_EXT21
KEY_EXT22
KEY_EXT23
KEY_EXT24
KEY_EXT25
KEY_EXT26
KEY_EXT27
KEY_EXT28
KEY_EXT29
KEY_EXT30
KEY_EXT31
KEY_EXT32
KEY_EXT33
KEY_EXT34
KEY_EXT35
KEY_EXT36
KEY_EXT37
KEY_EXT38
KEY_EXT39
KEY_EXT40
KEY_EXT41


Interesting is KEY_FACTORY and KEY_RESERVED1

Feel free to try all of them :)

skyteddy
Posts: 6
Joined: Sun Apr 24, 2011 10:40 pm

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby skyteddy » Sat May 21, 2011 8:09 am

nice list :) really all possible keys? I miss in your list KEY_ENTER and KEY_EXIT

pjnewman
Posts: 9
Joined: Tue May 10, 2011 5:45 pm

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby pjnewman » Sun May 29, 2011 8:09 pm

zibri2 wrote:All possible remote keys are:

Interesting is KEY_FACTORY and KEY_RESERVED1

Feel free to try all of them :)

Hi zibri2, thanks for those. Out of interest where did you get them from, and for what model of TV? I found a few more to add to my list from there, and some that gave a "Not Available" message, like you see if you press e.g. Fastforward/Rewind while watching live TV; so I assume I was just using them at the wrong time. But it also didn't respond to others at all, making me think they don't exist on my model of TV.

I don't know if there would be any benefit to a table on the wiki listing key compatibility against models, and what the function does, for some of the more obscurely named ones?

skyteddy
Posts: 6
Joined: Sun Apr 24, 2011 10:40 pm

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby skyteddy » Mon May 30, 2011 9:44 am

pjnewman wrote:I found a few more to add to my list from there, and some that gave a "Not Available" message,

You mean on the tv or as responds from the tv on port 55000?

pjnewman wrote:like you see if you press e.g. Fastforward/Rewind while watching live TV; so I assume I was just using them at the wrong time. But it also didn't respond to others at all, making me think they don't exist on my model of TV.

I got allays the the same response from the tv, independent which key I send and if its available on tv (or selected mode) or not:

Code: Select all

      <Byte - unknown byte>
            0x00 = ???
      <Byte - Length of string1>
      0x00
      <x-Bytes - string1>
           "iapp.samsung"
      <Byte - Length of resultbytes>
      0x00
      <resultbytes>
           0x00 0x00 0x00 0x00


happy computing!
R@iner

dredkin
Posts: 19
Joined: Thu Oct 28, 2010 9:46 am

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby dredkin » Mon May 30, 2011 4:04 pm

pjnewman wrote:Enjoy...

Hi pjnewman!
I've checked your script on my LE46C650 and it works well! I only translated perl part ot php (can publish sources if anybody wants, but changes are minimal).

Right now I'm working on Autohotkey script which would give me possibility to control my tv from wireless keyboard connected to my HTPC.
I've almost finished it, and the only drawback of this approach is we can turn tv off but cannot turn it on (though It's expected).
Are there network professionals who can check availability of Wake-On-Lan feature for TV?

pjnewman
Posts: 9
Joined: Tue May 10, 2011 5:45 pm

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby pjnewman » Mon May 30, 2011 10:17 pm

skyteddy wrote:
pjnewman wrote:I found a few more to add to my list from there, and some that gave a "Not Available" message,

You mean on the tv or as responds from the tv on port 55000?
I just meant directly visible on the TV, a message type thing appears in the middle of the screen.

skyteddy wrote:I got allays the the same response from the tv, independent which key I send and if its available on tv (or selected mode) or not:
I must admit I'd not bothered looking at return stuff at all, particularly given my intended usage. Interesting to know though; I guess you've not tried the text entry like you get with YouTube, I wonder if that might return the current text entered or something? What do you get in result bytes, more base 64?

dredkin wrote:Hi pjnewman!
I've checked your script on my LE46C650 and it works well! I only translated perl part ot php (can publish sources if anybody wants, but changes are minimal).

Right now I'm working on Autohotkey script which would give me possibility to control my tv from wireless keyboard connected to my HTPC.
I've almost finished it, and the only drawback of this approach is we can turn tv off but cannot turn it on (though It's expected).
Are there network professionals who can check availability of Wake-On-Lan feature for TV?
Glad to hear its working for you, in a new language.

I think skyteddy has a little program with a command line option to send remote keys, which might help in your automation.

I've just tried my TV and WOL didn't work unfortunately; I assume if it did then the iPhone app would have that function too.

skyteddy
Posts: 6
Joined: Sun Apr 24, 2011 10:40 pm

Re: Samsung Wireless Remote Control/iPhone Protocol Decoded

Postby skyteddy » Mon May 30, 2011 10:24 pm

pjnewman wrote:
skyteddy wrote:I got allays the the same response from the tv, independent which key I send and if its available on tv (or selected mode) or not:
I must admit I'd not bothered looking at return stuff at all, particularly given my intended usage. Interesting to know though; I guess you've not tried the text entry like you get with YouTube, I wonder if that might return the current text entered or something? What do you get in result bytes, more base 64?

Sure, I tried it: This is the responds for text. 3 "parts" in one responds:

Code: Select all

    ---
      <Byte - unknown byte>
            0x02 = ???
      <Byte - Length of string1>
      0x00
      <x-Bytes - string1>
           "iapp.samsung"
      <Byte - Length of resultbytes>
      0x00
      <resultbytes>
           0xC8 0x00 0x02 0x00 0x31 0x00  =  ??
    ---
      <Byte - unknown byte>
            0x02 = ???
      <Byte - Length of string1>
      0x00
      <x-Bytes - string1>
           "iapp.samsung"
      <Byte - length of resultbytes>
      0x00
      <resultbytes>
            0x03 0x00 0x04 0x00 0x41 0x41 0x3D 0x3D  =  ??
    ---
      <Byte - unknown byte>
            0x02 = ???
      <Byte - Length of string1>
      0x00
      <x-Bytes - string1>
           "iapp.samsung"
      <Byte - Length of resultbytes>
      0x00
      <resultbytes>
            0x03 0x00 0x04 0x00 0x41 0x41 0x3D 0x3D  =  ??
    ---

I have no idea about what is what.

happy computing!
R@iner


Return to “[C] Brainstorm”

Who is online

Users browsing this forum: No registered users and 0 guests