GSM Shield SLD33149P

How do I capture the output from an AT command on an Arduino?

I’m using the Arduino Uno R3 with a GSM shield. I have all the AT commands (garden.seeedstudio.com/images/a/ … _V1_00.pdf) and I can enter them just fine if I use the terminal and get output. However how can I capture the resulting output via code? The code below shows what I’ve tried but it does not work. In particular where I attempt to get the analog input and then print out the result.

[code]#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(7, 8);

void setup()
{
  char sensorValue[32] ="";
  Serial.begin(9600); 
  mySerial.begin(9600); 
  Serial.println("\r");
  delay(1000);                    //Wait for a second while the modem sends an "OK"
  Serial.println("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(1000);
  
  Serial.println("AT+CADC?");    //Get analog input
 Serial.println(Serial.available());  
 Serial.println(Serial.read());     //Print analog input
 
  Serial.println("AT+CMGS=\"+MSISDN\"\r");    //Start accepting the text for the message
                                                  //to be sent to the number specified.
                                                  //Replace this number with the target mobile number.
  delay(1000);
  Serial.println("!");   //The text for the message
  delay(1000);
  Serial.write(26);  //Equivalent to sending Ctrl+Z 
}
 
void loop()
{
  /*
    if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());  
    */
}

[/code]

The results I am getting are:

and

regardless of the changes I make in my analog input

hi there,
I don’t really understand what do you want to do.
this code can capture the output from an AT command on an Arduino .

if (mySerial.available()) Serial.write(mySerial.read());

Well that’s exactly my problem, I don’t get any output back. Allow focus on a test case:

Serial.println("Sending AT command"); mySerial.print("AT\r"); delay(1000); if (mySerial.available()) { Serial.println("MySerial Availabe"); Serial.println(mySerial.read()); }

When I run that the only output I get is “Sending AT command”. I would expect to also get back the “OK” that the command AT would respond with but I don’t.