Hi there, my arduino seems to be skipping part of the code and immediately looping the void setup() function. i am not sure why it is skipping the if else statement inside the while loop...
this is my code :
#include <SPI.h>
#include <WiFi.h>
#include <GSM.h>
#define PINNUMBER ""
#define GPRS_APN "sunsurf" // replace with your GPRS APN
#define GPRS_LOGIN "65" // replace with your GPRS login
#define GPRS_PASSWORD "user123" // replace with your GPRS password
char ssid[] = "john"; // wireless network name
//char password[] = ""; // wireless password
int status = WL_IDLE_STATUS;
WiFiClient client;
IPAddress server(192,168,1,100);
byte bssid[6];//for bssid aka AP Mac
byte mymac[6];
String bss; //string up the bssid
String mac;
String ap_mac = "ap_mac=";
String arduino_mac = "arduino_mac=";
String send_arduino_mac;
String send_ap_mac;
GSMClient GSMclient;
GPRS gprs;
GSM gsmAccess;
char GSMserver[] = "arduino.cc"; // the base URL
char GSMpath[] = "/latest"; // the path
int GSMport = 80; // the port, 80 for HTTP
void setup() {
Serial.begin(9600);
//Serial.println(WiFi.firmwareVersion());
Serial.println("Starting Arduino web client");
boolean notConnected = true;
while(notConnected)
{
if((gsmAccess.begin(PINNUMBER)==GSM_READY) &
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD)==GPRS_READY)){
notConnected = false;
Serial.println("Accepted");
}
else
{
Serial.println("Not connected");
delay(1000);
}
}
}