How can I debug and find the error ind this code
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
The problem is: gsmAccess.begin(PINNUMBER)==GSM_READY
the gsmAccess.begin doesn't returm GSM_READY
how can I debug on this?
I know til PINNUMBER is correct I have defined it earlier
Not sure.
I know putchar is used to print chars in C, but I don't know if it works with the arduino.
It's a good idea to post the errors you are getting, with the entire traceback, so that people can better help you debug your code. And remember to use code tags.
// initialize the library instance
GSM gsmAccess(true); // include a 'true' parameter for debug enabled
GSMScanner scannerNetworks;
GSMModem modemTest;
You did not include the ERROR status, but I think there must be an error elsewhere in your code as the default case is not getting called.
Do you get any warnings during compilation? Does it print this only once, indicating that the loop is broken?
The problem was that my power suply was through the USB, which makes the GSM shield unreliable.
When I connected an external power suply, in my case 9Volt batteri.
Then the GSM shield returned the right AT commands and then the function began to work proberly.