Arduino GPRS shield - handle result codes

Post Reply
alanjpraha
Posts: 1
Joined: Sat Oct 17, 2015 9:43 pm

Arduino GPRS shield - handle result codes

Post by alanjpraha » Sat Oct 17, 2015 10:17 pm

Hello world! :) Does anybody have good code for reading the result codes sent by the GPRS shield, please? I am sending SMSs - they are sent correctly, but all attempts so far to read the result codes into my program fail completely. In a terminal emulator I see the result codes - OK, ERROR, etc - on the screen, but trying to read them into my program finds nothing. I use SoftwareSerial to communicate with the shield, using read() with and without delay() of up to 2 seconds, with and without available() (if and while), and looping up to 100000 times . . . always gets -1! I've tried comms at 9600 and 19200 - and yes, both ends are at the same speed, and I know that the commands I send get through.

I've searched the web and found no real attempt to handle error codes from the shield. True, Geeetech's sample program issues a 'AT + CEER=?' command, but it does nothing with the result, and there's no indication that there <is> a result. Surely, people are interested in whether it worked or not? I've been programming for 48 years (though not in the micro world!), and it always seemed to me that checking for errors and exceptions was vitally important. I've checked everything I can think of, and all I can imagine now is that I've missed something very simple and very obvious: I don't mind looking a fool, but I would like to know!

My Arduino is UNO, Rev 3; my arduino software is 1:1.0.5+dfsg2-2, my GPRS shield is the original (not V2.0, but <1 month old) and I use ino as an IDE (can't wean myself off vi!) This problem is destroying my life - any help would be very welcome :)

Edit: Oh, dear . . . I've just looked at the first example on the Wiki page. It works, of course. I was getting confused in passing object references around. Sorry to have taken up space and time!

AlanJ

Post Reply