Dear experts,
I am trying to readout cell information of my cell provider through "AT+QENG?" (see simple script below).
This command is supposed to return information about the serving cell and 6 neighbour cells.
whenever I execute the command (through below code) my interface from my Arduino One to the GSM Shield gets stuck and I have to reboot my modem.
I looks like this behaviour is related to retrieving large result sets from GSM Shield.
Any idea on how I can eliminate the problem?
// ADDON - I tried the same code with softwareserial.h (without GSM.h) and it works ... looks like softwareserial implementation of gsm.h has problems with result sets > 128Byte size ... any idea on how to fix this is highly appreciated as I need to use GSM.h due to subsequent usage of MQTT.
#include <GSM.h>
// initialize the library instance
GSM gsmAccess(true); // GSM access: include a 'true' parameter for debug enabled
// you need modemAccess to access the function writeModemCommand
// that function allows you to specify a delay for getting the answer from the gsm module
GSM3ShieldV1DirectModemProvider modemAccess(true);
// PIN Number
#define PINNUMBER ""
void setup()
{
Serial.begin(38400);
Serial.flush();
boolean notConnected = true;
Serial.println("Connecting to the GSM network");
while (notConnected) {
if (gsmAccess.begin(PINNUMBER) == GSM_READY)
notConnected = false;
else {
Serial.println("Not connected, trying again");
delay(1000);
}
}
Serial.println("Connected.");
}
void loop()
{
String data;
data.reserve(350);
// Start Collecting Cell Information
Serial.println("Sending AT Command.");
Serial.println(modemAccess.writeModemCommand("AT+QENG=1,1", 1000));
modemAccess.flush();
delay(2000);
// Display Cell Information
data = modemAccess.writeModemCommand("AT+QENG?", 1000);
Serial.println(data);
modemAccess.flush();
delay (2000);
// Below command doesn't work anymore ... system hangs ... looks like interface is down
data = modemAccess.writeModemCommand("AT+QENG?", 1000);
Serial.println(data);
delay (2000);
while (true);
}