hi
i am newbie to gsm modems, i recently purchased the arduino gsm shield v2 (M10) for research and development. Testing the various gsm functionality included the GSM library worked of the bat. i ran into some issues when trying to executed USSD (using AT commands) via Software Serial library, seems like the cellular provider (Vodacom South Africa) didn't like the standard GSM character set, it had to be changed to IRA thereafter i was able to retrieve a balance via USSD. Once the functionality was proven, i decided to combine sketches, typical newbie error was made with the compatibility of GSM vs SoftwareSerial. My research has extended to looking for way to send AT commands via the GSM library. I found many posts regarding the GSM3ShieldV1DirectModemProvider to be used in order to archive the desired. The issue i am facing now, is every time i send commands via this interface i get an error. below is a code snippet
#include <GSM.h>
#include <GSM3ShieldV1DirectModemProvider.h>
GSM gsmAccess(true);
GSM3ShieldV1DirectModemProvider modemAccess(true);
int timeout = 10000; // 1 seconds
void setup()
{
Serial.begin(9600);
boolean notConnected = true;
Serial.println("Connecting to the GSM network");
while(notConnected){
if(gsmAccess.begin() == GSM_READY) // Note: I do not require PIN #
notConnected = false;
else {
Serial.println("Not connected, trying again");
delay(1000);
}
}
Serial.println("Connected");
String reply = modemAccess.writeModemCommand("AT+CUSD=?",1000);
Serial.print("Response: ");
Serial.println(reply);
Below is the trace output, green text is output from modemAccess:
Connecting to the GSM network
AT%13%
0 6>%13%%10%OK%13%%10%
AT+CGREG?%13%
6 27>%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10%
AT+IFC=1,1%13%
27 33>%13%%10%OK%13%%10%
AT+CMGF=1%13%
33 39>%13%%10%OK%13%%10%
AT+CLIP=1%13%
39 45>%13%%10%OK%13%%10%
ATE0%13%
45 51>%13%%10%OK%13%%10%
AT+COLP=1%13%
51 57>%13%%10%OK%13%%10%
Connected
AT+CUSD=?
A%13%
57 66>%13%%10%ERROR%13%%10%
ERROR
Response:
ERROR
i noticed commands through writeModemCommand didn't contain a terminator, so i tried being "clever" and inserted %13%, which didn't work.