         if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
             return;  // we can fail to parse a sentence in which case we should just wait for another
     }
+#if 0
     if (timer > millis())  timer = millis();
     if (millis() - timer > 2000)
     {
         timer = millis(); // reset the timer
     }
-}
+#endif
+    if (digitalRead(BUTTON) == HIGH)
+    {
+        // Send data to server
+        delay(2000);
+        char status = 0;
+        if (GPS.fix)
+        {
+            mypos.latitude = GPS.latitude;
+            mypos.longitude  = GPS.longitude;
+            status = 1;
+        }
+        else
+        {
+            gsm_get_latitude();
+            status = 1;
+        }
+        if (status)
+        {
+            send_server();
+        }
+    }
+}
+
+
+
+/* Functions */
 
 SIGNAL(TIMER0_COMPA_vect)
 {

struct towers_struct towers;

uint8_t header[]  = "POST /glm/mmap HTTP/1.1\r\nHost: www.google.com\r\nContent-type: application/binary\r\nContent-Length: 55\r\n\r\n";

uint8_t packet[] =
{

void setup()
{
    debug.begin(4800);

    pinMode(BUTTON, INPUT);
    digitalWrite(BUTTON, HIGH);

    gsm.InitSerLine(115200);
    GPS.begin(9600);

#if 0
    GPS.sendCommand(GPSGGA, 2);
    GPS.sendCommand(GPSGLL, 0);
