Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 4 made on Monday August 25, 2014 at 19:24
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
You are close but filled with syntax errors and extra spaces. Missed variable declarations, etc... You could have seen this by putting a Try/Catch block around lots of your stuff (I have a thread on debugging tips here in the forum).

Remove the extra spaces and added the Connection and Host Request Headers. You might want to consider playing with the Philips HTTP Library script that is available for PEP2 projects. Makes easier work of what I just did here.

Paste the following as-is into a button script and see if it works without any user authentication.

////////////////////////////////////////////
//
var socket = new TCPSocket (false);
socket.onConnect = function ()
{
socket.write ("GET /api/callAction?deviceID=36&name=turnoff HTTP/1.1\r\nConnection: close\r\nHost: 10.10.10.105\r\n\r\n\r\n");
socket.close ();
};
socket.onClose = function ()
{
};
socket.onIOError = function (e)
{
Diagnostics.log("Error:" + e);
};
// You were never connecting because you had 'S' instead of lowercase 's' in socket.
socket.connect ('10.10.10.105 ', 80);
//
//
/////////////////////////////////////////////

There is a piece of software known as the Burp proxy (google it) which you can configure in IE or other browser that will allow you to see the exact characters being sent by your browser. You will want to emulate that exactly by building and sending the correct strings.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse