php - SendMessage php_serial_class: sms begins with an empty row, the second row begins with ">" symbol

846

I'm using php_serial_class and php to send SMS with a simple code like this:

But the received sms begins with an empty row and the second row begins with ">" symbol, like:

"

'>Rel1 lock"

(symbol ' must be removed to a proper understanding in this site)

include "php_serial.class.php";

$serial = new phpSerial;
$serial->deviceSet("/dev/ttyS2");
$serial->confBaudRate(9600);

// Then we need to open it
$serial->deviceOpen();

$serial->sendMessage("ATZ\n\r");
// Wait and read from the port
//$read = $serial -> readPort();

$serial->sendMessage("ATE0\n\r");
// Wait and read from the port
//$read = $serial -> readPort();

// To write into
$serial->sendMessage("AT+cmgf=1;+cnmi=2,1,0,1,0\n\r");//
$serial->sendMessage("AT+cmgs=\"+7912_____\"\n\r");
$serial->sendMessage("Rel1 lock\n\r");
$serial->sendMessage(chr(26));

//wait for modem to send message
sleep(7);
$read=$serial->readPort();

$serial->deviceClose();

People are also looking for solutions to the problem: Reading Registry on IIS server with PHP com object not working

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.