Dear All,
While I send an AT command I need to put into a buffer the response.
I do have an Arduino UNO and TEL0051 shild with SIM908.
I also created a special ino file to work on that issue (see below)
First I quickly look at the AT command for SIM908
http://www.dfrobot.com/image/data/TEL0051/3.0/SIM908_AT%20Command%20Manual_V1.01.pdf
If you look at page 13, you can raed:
The "AT" or "at" prefix must be set at the beginning of each Command line. To terminate a
Command line enter <CR>.
Commands are usually followed by a response
that includes. "<CR><LF><response><CR><LF>"
Throughout this document, only the responses are presented, <CR><LF> are omitted
intentionall
Then when I send an AT command, I should "filter" the data from CR LF and the second CR LF.
I have difficulties to do that and I really will appreciate your help
Then now if you look at page 266, there is command AT+GPSSTATUS and the repsonse.
Now my code. I created a read_AT_serial.iono file will necessery code. Most of them it to start the module and power the GPS. It work. In order to understand my issue, look at loop() and read_AT_string(char* command, int timeout)
loop() will, each 10sec, call read_AT_string(). read_AT_string() will send the command and try to put into a buffer the response of the AT command.
For my exercise, I use AT+GPSSTATUS command. The detail is at page 266.
I adding comment in CAPITAL
Here is the code in a txt file (I had to put that code into an external file)
http://www.hello-web.net/temp/read_AT_string.txt
Here is what display buffer (It display a lot of '1' for the time of timeout. I do not pasted all '1')
DISPLAY BUFFER:
AT+GPSSTATUS
1
1
11
1
1
1END DISPLAY BUFFER
If you look at page 226, I should have an response looking at this
Response
+CGPSSTATUS: Location Not Fix
OK
I hope I provided clear information and you can check at my code, because I am blocked and I do not have any colleague who have experience on my issue.
PS: When I will solve that issue, I will delete sendATcommand() and adapt read_AT_command while I am looking for a special response from the buffer.
Many thank.
Feel you free to ask me additional information