Page 1 of 1
send command to FS from PHP
Posted: May 29th, 2011, 7:51 pm
by samy_14
Hi,
I'd like to develop a little interface in PHP to command PAR fixtures from a web server. After reading many topics in this forum I saw that I can use socket to send command directly to FS.
I try the command blackout and it works put not for the command channel 1 @ 255
Code: Select all
$socket = @fsockopen($IP,$PORT,$codeErreur, $msgErreur);
fputs($socket,"FSOC002255"); // works correctly
fputs($socket,"FSOC320255"); // send "command 1"
fputs($socket,"FSOC332255"); // send "command @"
fputs($socket,"FSOC321255"); // send "command 2"
fputs($socket,"FSOC324255"); // send "command 5"
fputs($socket,"FSOC324255"); // send "command 5"
fputs($socket,"FSOC337255"); // send "command enter"
fsockclose($socket);
Can you tell me what is wrong in my code ?
Thanks in advance for you help.
Re: send command to FS from PHP
Posted: May 29th, 2011, 8:40 pm
by Mattotone
Re: send command to FS from PHP
Posted: May 29th, 2011, 11:33 pm
by samy_14
Thanks for you answer.
I read the topic you told me and try this :
Code: Select all
$socket = @fsockopen($IP,$PORT,$codeErreur, $msgErreur);
fputs($socket,"FSOC320255"); // send "command 1 click"
fputs($socket,"FSOC3200"); // send "command 1 release"
fputs($socket,"FSOC332255"); // send "command @ click"
fputs($socket,"FSOC3320"); // send "command @ release"
fputs($socket,"FSOC321255"); // send "command 2 click"
fputs($socket,"FSOC3210"); // send "command 2 release"
fputs($socket,"FSOC324255"); // send "command 5 click"
fputs($socket,"FSOC3240"); // send "command 5 release"
fputs($socket,"FSOC324255"); // send "command 5 click"
fputs($socket,"FSOC3240"); // send "command 5 release"
fputs($socket,"FSOC337255"); // send "command enter click"
fputs($socket,"FSOC337255"); // send "command enter release"
fclose($socket);
But it doesn't work.
Can anyone help me ?
thanks in advance
Re: send command to FS from PHP
Posted: May 30th, 2011, 7:21 pm
by samy_14
Hi,
I create a little web interface to send command to FS with a little form.
fwrite($socket,"FSOC".$_PUT['CMD']."255"); //for only a click
Many command works correctly
After I modified my script to accept many commands in the same time
I test "008" ( open DMX 400) and "013" (open sound) with a break of 500ms between the 2 fwrite => work correctly, the 2 windows opened in FS
After I test to send command : 320,332,321,324,324,337 for "1@255Enter" => doesn't works.
Is there any way to see something in FS appear when I send only "command 1" for exemple? To see if FS understand it correctly.
Thanks in advance
Re: send command to FS from PHP
Posted: May 30th, 2011, 8:54 pm
by samy_14
thanks.
I can send you packets contain of what my socket send to FS ?
Re: send command to FS from PHP
Posted: May 30th, 2011, 9:44 pm
by Mattotone
Its a strange one, i can also send any command or even string of commands with no problem.
i can a whole group of parameters such as setting all 20 sequence speeds.
in tellnet the above code is printed as
FSOC320255FSOC3200FSOC332255FSOC3320FSOC320255FSOC320000FSOC319255FSOC319000FSOC3319255FSOC319000FSOC337255FSOC337255
Re: send command to FS from PHP
Posted: May 30th, 2011, 9:47 pm
by Mattotone
id suggest send an email to raph with your complete php code for him to test and create a solution.
Re: send command to FS from PHP
Posted: May 30th, 2011, 10:02 pm
by Mattotone
Also if its an urgent development the tcpip server is compatible with php,
The commands are differnt eg.
your example would simply be
ch 1 @ 255
Re: send command to FS from PHP
Posted: May 30th, 2011, 10:56 pm
by samy_14
I just sent an email to Raph as you advice.
Can you explain more about the tcp/ip server ? I can't find it in the download area.
Thanks
Re: send command to FS from PHP
Posted: May 30th, 2011, 11:07 pm
by Mattotone
Re: send command to FS from PHP
Posted: May 30th, 2011, 11:44 pm
by samy_14
Thanks for this. It works perfectly with it.
For the moment I will use it until the answer of Raph. As I prefer to avoid things between my script and FS.
Re: send command to FS from PHP
Posted: November 4th, 2016, 9:51 pm
by djsnipeeer
Hi, i'm finding a way to remote freestyler in web browser for a very long time. I'm not php or C developer but when i find this post i become happy and i want to ask You if somebody of You can sand me some code or files trougt wich i can remote freestyler in web browser or on other pc . Thank U so much