I'am using a Telecom Italian Mobile SIM.
I can't connect with it, this is my code:
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
It don't work with gsmAccess.begin(PINNUMBER), the SIM has disable the PIN, if i don't write a value to PINNUMBER the script stop at gsmAccess.begin(PINNUMBER) instruction, if i write a "0000" value, the real SIM PIN value, it answer "Not connect".
Any suggestion ?
#include <GSM.h>
// PIN Number
#define PINNUMBER "0000"
// initialize the library instance
GSM gsmAccess; // include a 'true' parameter to enable debugging
GSMScanner scannerNetworks;
GSMModem modemTest;
// Save data variables
String IMEI = "";
// serial monitor result messages
String errortext = "ERROR";
void setup()
{
// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("GSM networks scanner");
scannerNetworks.begin();
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}