I use php_serial library to work with GSM module (MC39i).

Everything is fine, except for one - getting a list of SMS.

If the answer is large, then not all SMS comes, cut off at the end.

Example:

<?php include "app/lib/php_serial/php_serial.php"; $port = new PhpSerial(); $port->deviceSet('/dev/ttyACM0'); $port->confBaudRate(115200); $port->deviceOpen('a+b'); $port->sendMessage("AT+CMGF=0\r", 0.1); $port->sendMessage("AT+CMEE=2\r", 0.1); $port->sendMessage("ATV\r"); $port->sendMessage("ATE0\r"); $port->readPort(); $port->sendMessage("AT+CMGL=4\r", 3); $data = $port->readPort(); var_dump($data); 

In response, I get 8 sms,

 string(1216) " +CMGL: 1,1,,23 0791973007038... +CMGL: 2,1,,64 07919730071111F1... +CMGL: 3,1,,64 07919730071111F1... +CMGL: 4,1,,64 07919730071111F1... +CMGL: 5,1,,64 07919730071111F1... +CMGL: 6,1,,64 07919730071111F1... +CMGL: 7,1,,64 07919730071111F1... +CMGL: 8,1,,64 07919730071111F1... " 

At the end there is no answer OK (in this case 0). If you go through minicom (or putty), then 11 SMS messages with the code OK come back.

 +CMGL: 1,1,,23 07919730070386F70... +CMGL: 2,1,,64 07919730071111F10... +CMGL: 3,1,,64 07919730071111F10... +CMGL: 4,1,,64 07919730071111F10... +CMGL: 5,1,,64 07919730071111F10... +CMGL: 6,1,,64 07919730071111F10... +CMGL: 7,1,,64 07919730071111F10... +CMGL: 8,1,,64 07919730071111F10... +CMGL: 9,1,,64 07919730071111F10... +CMGL: 10,1,,64 07919730071111F10... +CMGL: 11,1,,64 07919730071111F10... 0 

I tried other modes (AT + CMGF = 1) - even less SMS comes ... I also tried changing parameters: parity, flow control, set a longer timeout - nothing changes.

The modem is connected via USB, OS - ubuntu 14.04

Tell me where to dig?

    0