You said you tried to telnet in and ‘it shows the command when i press enter’? What exactly do you mean by this?
I’m going to stick with my original suggestion of sticking with testing with telnet until you get some actual results. There’s no point in trying to write PHP if you cant get connectivity through telnet or similar.
Thank you for the reply…,The device is sending data now to our server and my socket script works fine and i can save the data to the text file,but my only problem is that if i will send a command to the device,the device won’t response with the command that i send,it’s always through data to our server which is not needed to me…
Alright, I’m not sure I’m there yet with your description. Are you trying to send a command on the same pipe that is receiving the data? Have you successfully tested sending a command to the device under any circumstance?
Did sending the command through telnet work? If all your looking to do is record the response from a command being sent, you can pipe telnet into a log file.
Again, please test in telnet. There’s no point in coding until you’ve tested successfully there.
It’s working now i get the response now from the device i just figure it out that my command i send is wrong…I have another problem.if there is already running socket connection i could not run this command script…can you help me please how can i achieve if there is running connection i can run this script command.
Well, once again I’m going to point you to use telnet for your testing. Fire up two terminals, trying connecting in with both using telnet, whats the result?
I run the script, but still it cannot connect if there is already running stream_socket script,I need to turn of first the first one,then run this script…