Hello, I’ve connected GM862 (on the Sparkfun USB evaluation) to the Arduino Decimila USB board. The plan is to control GM862 from Arduino. I can execute AT commands, e.g., send an SMS message, but I’m unable to read the response. For example, here is a simple example where I just send an AT command. I expect to get an OK response (according to the spec. with ATV0, I should expect .
I can see the AT responses fine when I connect to the GM862 USB board directly via a Terminal program. But programatically, I cant get the responses. Any help would be much appreciated. Thank you.
I’m not sure which version of the Arduino IDE you are using, but there were many problem in the original SoftSerial library.
Try using the real serial lines while you are debugging. If that works (or if you cant using that for some reason) try AFSoftSerial or NewSoftSerial. You can find links & threads about those libraries on the main Arduino forum.
That should at least eliminate any problems in the library from the equation.
First your “print” statments need to have the actual carriage return (0x0D) and linefeed (0x0A) characters. Using “\r\n” doesn’t work this way and only sends these characters (literally). Optionally you can use “println”
SoftwareSerial is non-interrupt based. This means you have to have to actively be listening for data when it arrives or else it’s lost. Your delay(1000) is making you lose the response.
Remove the delay entirely and you should get back some data. Note that the modem.read will “block” until some data comes back. This is another limitation of SoftwareSerial.
I second the comment about looking into NewSoftSerial.