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:
Pronto script ip relay Question.
This thread has 8 replies. Displaying all posts.
Post 1 made on Tuesday July 27, 2010 at 17:02
danieljgor
Long Time Member
Joined:
Posts:
December 2008
105
Hi Guy's

if i need to send a comand like below which opens relay number one on a ip server what is the easiest way? can it be done on a single button press?

[Link: 192.168.1.3]


Thanks
Daniel
Post 2 made on Tuesday July 27, 2010 at 17:17
gopronto
Senior Member
Joined:
Posts:
April 2008
1,453
i think you could you the TCP/ip script from the pronto web site to send
(http)://192.168.1.3/Set.cmd?cmd=setpower+p61=1t"

i had to put the bracket in to show the string
Pronto still one of the best Wi-Fi Remotes,
www.ikonavs.co.nz and [Link: axiumcontrol.com] Axium Control
Post 3 made on Wednesday July 28, 2010 at 05:00
zedmtrappe
Long Time Member
Joined:
Posts:
July 2008
35
I've been working on almost exactly the same thing (an Avios IP Power 9258)

PS should be:

socket = new TCPSocket(false);
socket.onConnect = function(){
socket.write("GET /Set.cmd?CMD=SetPower+p61=1t HTTP/1.0 \r\n\r\n");
}

socket.connect('192.168.1.3', 80, 3000);


Just check that the port number is the same (80 in the above case) / if you have to specify it.

Also, should there definitely be a t after 1 in 'SetPower +p61=1t' ? (not needed on my device otherwise the syntax is identical.)

Also in my case I have to use the authentication of login and password - if you do too you'll need to add....:

Authorization: Basic YWRtaW46MTIzNDU2Nzg=

....before the HTTP/1.0 business... Above authorisation is converted to Base64 and is for default login/password.

If you have changed your login/password you will need to add your own base64 conversion of your login/password - google a site that does it for you.

Cheers

Zed
OP | Post 4 made on Wednesday July 28, 2010 at 05:22
danieljgor
Long Time Member
Joined:
Posts:
December 2008
105
Hi Zed,

You are awesome....... and you are right there is no t :)


Thanks heaps.

Thanks again
Daniel
OP | Post 5 made on Monday August 2, 2010 at 05:00
danieljgor
Long Time Member
Joined:
Posts:
December 2008
105
On July 28, 2010 at 05:00, zedmtrappe said...
I've been working on almost exactly the same thing (an Avios IP Power 9258)

PS should be:

socket = new TCPSocket(false);
socket.onConnect = function(){
socket.write("GET /Set.cmd?CMD=SetPower+p61=1t HTTP/1.0 \r\n\r\n");
}

socket.connect('192.168.1.3', 80, 3000);

Just check that the port number is the same (80 in the above case) / if you have to specify it.

Also, should there definitely be a t after 1 in 'SetPower +p61=1t' ? (not needed on my device otherwise the syntax is identical.)

Also in my case I have to use the authentication of login and password - if you do too you'll need to add....:

Authorization: Basic YWRtaW46MTIzNDU2Nzg=

....before the HTTP/1.0 business... Above authorisation is converted to Base64 and is for default login/password.

If you have changed your login/password you will need to add your own base64 conversion of your login/password - google a site that does it for you.

Cheers

Zed

Hi Guy's

i have gone with the Aviosys 9202 4 channel ip server and i have got My relays turning on and off, but i cannot find a pulse command. Anybody got any ideas?

(http:)//192.168.1.69/SetIO?p63=0 = off
(http:)//192.168.1.69/SetIO?p63=1 = on

Thanks heaps
Daniel
Post 6 made on Monday August 2, 2010 at 08:30
BluPhenix
Long Time Member
Joined:
Posts:
December 2008
371
If the command has a http .... starting you must use a http protocol, otherwise the device will not understand it or better it will reject the application-layer connection and the "handshaking".

Look at the http library from philips. The part that zedmtrappe provided is a way to do it, but it's not a really right way, because the http header is missing some key strings, like the Connection: close:

HTTP/1.1 applications that do not support persistent connections MUST include the "close" connection option in every message.

As you don't know if the embedded http server supports a persistent connection, you should always close it. Anyway if you do use such things, you should do it the right way, so you don't regret it in the future:

[Link: en.wikipedia.org]
Post 7 made on Monday August 2, 2010 at 18:01
zedmtrappe
Long Time Member
Joined:
Posts:
July 2008
35
Ok BluPhenix, I have to admit I'm no expert as regards this TCPIP HTTP malarkey - but I do know that the method I posted works 100% reliably for my device - though I'm willing to accept that it may be more by accident than design!

In my case I would have liked to have used the philips HTTP library but had no success - I believe that's because as far as I can tell it does not support authentication?

Also I omitted the socket.close() command because my device closes the connection at then end of each response - according to it's response - if that makes sense!

Anyway, like I said I'm new to this aspect of this so any input welcomed.

Cheers

Zed
Post 8 made on Tuesday August 3, 2010 at 02:55
BluPhenix
Long Time Member
Joined:
Posts:
December 2008
371
Hey Zed.

I know it works, but it's better if it's done in the apropriate way.

If you don't actually need http parsing and advanced http stuff you don't need the philips library (it has too much stuff in it for simple uses).
I wasn't talking about the socket.close() prontoscript function but about the close in (this is how a http header should look like):

GET / subfolder/subfolder HTTP/1.1[CRLF]
Host: www.google.com[CRLF]
Connection: close[CRLF]
User-Agent: your device[CRLF]
Accept-Encoding: gzip[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no[CRLF]
Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]


This is a sample of a http header. Everything else (http data) comes after this. The pronto doesn't need some fields. In the 3rd row you see a Connection: close command. This command tells that the current http connection will be closed after receiving a response.

If you use the pronto to connect to web sites some of the fields are reuired, otherwise your connection might be refused.

A nice tool to study the html headers:
http://web-sniffer.net/

The request for this thread looks like:
Connect to 216.250.177.3 on port 80 ... ok

GET /cgi-bin/mboard/prontopro/thread.cgi?3903 HTTP/1.1[CRLF]
Host: www.remotecentral.com[CRLF]
Connection: close[CRLF]
User-Agent: Web-sniffer/1.0.36 (+http://web-sniffer.net/)[CRLF]
Accept-Encoding: gzip[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no[CRLF]
Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
Referer: http://web-sniffer.net/[CRLF]
[CRLF]


Sorry if it looked like I was getting "on you", didn't mean it like this.
OP | Post 9 made on Wednesday August 4, 2010 at 16:48
danieljgor
Long Time Member
Joined:
Posts:
December 2008
105
thanks to everybody who helped, i have now got it working, one question that isnt related to pronto but maybe somebody knows if i need to type in to trigger my ip relay (http)://192.168.1.68/state.xml?relayState=2 is there any way i can make the ie windows close after the comand without java script. i have looked at the close.window command but would love to do it via a book mark.

Thanks
Daniel


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