the php_serial class sets the com port line by line. Windows seems to not be able to get the correct settings this way. Whenever I set the data bit to 8 the parity bits goes back to even. All these have to be done in one command line. So we have to modify the php_serial class to run the command in a single line and it solves the problem, for now.. :)
[Read More...]
Browse » Home » Archives for June 2008
Sending command to GSM Modem using php
I have a project on integrating sms module into Joomla interface. I found a php_serial class that enables sending command through serial port by using php. I have tested it through hyperterminal and it works perfectly well, but when I tested it with GSM Modem, the AT command seems to be not working. Anyone has an idea of how to use the php_serial to send AT command to GSM Modem? If you have any clue on how to send AT command using php_serial, please inform me :) Thanks
Here's my code
include "php_serial.class.php";
// Let's start the class
$serial = new phpSerial;
$serial->deviceSet("COM1");
$serial->confBaudRate(115200);
$serial->confCharacterLength(8);
$serial->confParity("none");
$serial->confStopBits(1);
$serial->confFlowControl("xonxoff");
$serial->deviceOpen();
$serial->sendMessage("at+cmgs=\"+6583569765\"\r");
$serial->sendMessage("hello".chr(26));
$serial->deviceClose();
?>
[Read More...]
Here's my code
include "php_serial.class.php";
// Let's start the class
$serial = new phpSerial;
$serial->deviceSet("COM1");
$serial->confBaudRate(115200);
$serial->confCharacterLength(8);
$serial->confParity("none");
$serial->confStopBits(1);
$serial->confFlowControl("xonxoff");
$serial->deviceOpen();
$serial->sendMessage("at+cmgs=\"+6583569765\"\r");
$serial->sendMessage("hello".chr(26));
$serial->deviceClose();
?>
Subscribe to:
Posts (Atom)