TCP messages ?

You have a question or need an advice about how to do something? Ask it here!
Post Reply
TheoOrl45
Posts: 111
Joined: 23 Apr 2012 00:28
TCP messages ?

Post by TheoOrl45 »

Hi Bernd,

I'm trying to make the TCP messages work, in order to control proppfrexx with a small AutoIt program, but, it seems not to work properly.

I'm using this explanation you gave on this forum :
The 'TCP messages' are actually text strings (in UTF-8 form) and consist of the same control-commands as already explained.
a) You must (as the first command) send the "AUTHORIZATION" command using the password of the remote client
b) each command must be terminated by a double CRLF (\r\n)
Example:
Code:

Code: Select all

AUTHORIZATION <password>

SHOW_ALERT_WINDOW Online|You are now online!

Note, that each individual command is separated by a double CRLF (\r\n). If you need to combine multiple commands in a block, just use a single CRLF (\r\n).
But I don't manage to make the CRLF ...
Here is the autoit code.
autoitcapture.PNG
autoitcapture.PNG (27.66 KiB) Viewed 8360 times
I tried those expressions
- "AUTHORIZATION mdp\r\nSHOW_ALERT_WINDOW test|test\r\n"
- "AUTHORIZATION mdp\r\n\r\nSHOW_ALERT_WINDOW test|test\r\n\r\n"
- "AUTHORIZATION mdp\r\rSHOW_ALERT_WINDOW test|test\r\r"
- "AUTHORIZATION mdp\n\nSHOW_ALERT_WINDOW test|test\n\n"

Nothing works. Have you got an idea what I'm doing wrong ?
Theo, from France.
TheoOrl45
Posts: 111
Joined: 23 Apr 2012 00:28
Re: TCP messages ?

Post by TheoOrl45 »

I find my mistake
autoitcapture2.PNG
autoitcapture2.PNG (40.24 KiB) Viewed 8358 times
But there is still a problem : why will I not be able to chain the commands ?
In the exemple above, there are 3 commands, but the last doesn't execute.
If I try "AUTHORIZATION" + "SHOW_ALERT_WINDOW", it works fine. If I try "AUTHORIZATION" + "PLS_CURRENT_NEW", it works fine. If I try "AUTHORIZATION" + "PLS_CURRENT_NEW" + "SHOW_ALERT_WINDOW", it doesn't work : only the PLS_CURRENT_NEW is executed.

Moreover, my $cmd4 command doesn't work anymore (the path is correct !!)evenf if I try it alone with AUTHORIZATION...

Any idea ?
Theo, from France.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: TCP messages ?

Post by radio42 »

The syntax is, that each command must be seperated by a CRLF (\r\n) and the final command gets an additional CRLF (ending with \r\n\r\n):
"Command1\r\nCommand2\r\nCommand3\r\n\r\n"

Example:
"AUTHORIZATION pwd\r\nSHOW_ALERT_WINDOW test1|test2\r\nPLS_CURRENT_NEW\r\nSLEEP 1000|PLS_CURRENT_LOAD_PLAYLIST H:\Autoit\P20130307_0000.pfp\r\n\r\n"

If all that is too complex, note, that there is also a command-lin tool available within the ProppFrexx installation folder called "pfremcmd.exe" which handles the communication for your.
TheoOrl45
Posts: 111
Joined: 23 Apr 2012 00:28
Re: TCP messages ?

Post by TheoOrl45 »

Stuning.... It works as you said (for chaining commands, except that 2 CRLF seems to be needed for each commands...), but the "PLS_CURRENT_LOAD_PLAYLIST" command keeps not working... perhaps because of the "\" into the path of the playlist filename...

Never mind, I will use pfremcmd, but I would prefer that my own program would do the job... :-(

Thank for your help.
Theo, from France.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: TCP messages ?

Post by radio42 »

Can you pls post me your PLS_CURRENT_LOAD_PLAYLIST command and is the filename really available at that location?
TheoOrl45
Posts: 111
Joined: 23 Apr 2012 00:28
Re: TCP messages ?

Post by TheoOrl45 »

All the command works fine with the pfremcmd program. But when I put it into my program, it doesn't work... Probably a problem with my code... Not yours :-)
Theo, from France.
djgait
Posts: 14
Joined: 13 Sep 2012 13:48
Re: TCP messages ?

Post by djgait »

Some programs automatically perform a CRLF (\r\n) when a white space is detected in the script line.
When you define a CRLF (\r\n) and add a space after that is actually sends out 2 x CRLF (\r\n)

I had this a few times. Mostly a setting of the program can be altered to overcome this (plain text mode)
TheoOrl45
Posts: 111
Joined: 23 Apr 2012 00:28
Re: TCP messages ?

Post by TheoOrl45 »

It was a problem with the autoit code editor... Testing the same code into my personal computer at home, all is ok.
Commands works fine now :-)

No need, at the moment, to use the pfremcmd program ^^.

Thanks for your help. Have a nice week !
Theo, from France.

Post Reply