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

Login:
Pass:
 
 

Topic:
HTTP command via TCP/IP possible?
This thread has 8 replies. Displaying all posts.
Post 1 made on Tuesday September 23, 2008 at 17:28
Fishbones
Long Time Member
Joined:
Posts:
August 2008
14
Hi,

My sat receiver has no discrete IR codes for power but it is possible to control via a browser with the following command:

[Link: receiver_IP]{powerstate_number}

* 0 = Standby
* 1 = Deepstandby
* 2 = Reboot
* 3 = Restart Enigma2
* 116 = Wake-up

Would it be possible through a ProntoScript to send this HTTP line to the Sat receiver ?

Thank you.
Post 2 made on Tuesday September 23, 2008 at 17:49
MVis
Long Time Member
Joined:
Posts:
July 2007
94
Yes as long as it doesn't need an encrypted password (it's more complicated than that, but I don't grok it enough to explain it)

See the http example in the developer guide. Or search forum for tcpsocket
OP | Post 3 made on Wednesday September 24, 2008 at 14:21
Fishbones
Long Time Member
Joined:
Posts:
August 2008
14
OK, had "another" Read of the FM and came up with this:

var socket = new TCPSocket(true);
socket.connect("192.168.1.13", 80, 3000);
socket.write("/web/powerstate?newstate=0");
socket.close();

and an Asynchronous version:

var socket = new TCPSocket(false);
socket.onConnect = function()
{
socket.write("/web/powerstate?newstate=0");
socket.close();
};
socket.onClose = function()
{
};
socket.onIOError = function(e)
{
label = "Error: " + e;
};
socket.connect('192.168.1.13',80,3000);

Unfortunately, none of them work :-( and there is no indication of script errors on _PS_DEBUG_. Is there any other way to check what the sat receiver response is?

When I send _http://192.168.1.13/web/powerstate?newstate=0 from a browser it works but not via the above prontoscripts on a TSU9400.

Thank you.
Post 4 made on Wednesday September 24, 2008 at 14:47
MVis
Long Time Member
Joined:
Posts:
July 2007
94
try

socket.write("GET /web/powerstate?netstate=0 HTTP/1.0\r\n\r\n")
Post 5 made on Thursday September 25, 2008 at 00:36
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
You might want to invest in the book "Webmaster in a Nutshell" from O'Reilly to get a better understanding of the HTTP protocol which you have to use. Web browsers hide all this stuff from you that you need to know if writing raw strings to a TCP socket.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Thursday September 25, 2008 at 16:21
Fishbones
Long Time Member
Joined:
Posts:
August 2008
14
On September 24, 2008 at 14:47, MVis said...
try

socket.write("GET /web/powerstate?newstate=0 HTTP/1.0\r\n\r\n")

Yes! That works. Thank you very much.

For anyone that needs a workaround for discrete power on/off IR codes for a dreambox you can use the IR power toggle to power on and the following prontoscript to place the receiver in standby.

var socket = new TCPSocket(false);
socket.onConnect = function()
{
socket.write("GET /web/powerstate?newstate=0 HTTP/1.0\r\n\r\n")
socket.close();
};
socket.onClose = function()
{
};
socket.onIOError = function(e)
{
label = "Error: " + e;
};
socket.connect('dreambox_IP',80,3000);


Thank you once again to MVis.

Cheers.
Post 7 made on Friday May 22, 2009 at 05:42
kevin82
Long Time Member
Joined:
Posts:
January 2008
197
On September 25, 2008 at 16:21, Fishbones said...
Yes! That works. Thank you very much.

For anyone that needs a workaround for discrete power on/off IR codes for a dreambox you can use the IR power toggle to power on and the following prontoscript to place the receiver in standby.

var socket = new TCPSocket(false);
socket.onConnect = function()
{
socket.write("GET /web/powerstate?newstate=0 HTTP/1.0\r\n\r\n")
socket.close();
};
socket.onClose = function()
{
};
socket.onIOError = function(e)
{
label = "Error: " + e;
};
socket.connect('dreambox_IP',80,3000);

Thank you once again to MVis.

Cheers.

Can you please post the rest of the ip protocol of the Dreambox Receiver,
i would like full control of all functions by ip.

Thank you,,

Kevin
Post 8 made on Sunday May 24, 2009 at 12:04
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
Kevin,

You may want to send him an email (addy on profile). You posted to a rather old thread and the user only has 12 posts.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 9 made on Sunday May 24, 2009 at 13:13
kevin82
Long Time Member
Joined:
Posts:
January 2008
197
i already did,,

Thanks..


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse