     readString += inchar;
     delay(10);
   }
-  //Serial.println(readString);
+  if (debug) {
+    Serial.print("[DBG] getNetworkStatus:");
+    Serial.print(readString);
+  }
   for (int i = 0; i < 200; i++)
   {
-    if (readString.substring(i, i + 5) == "ERROR")
-    {
-      sim900status = false;
-      Serial.print("Network status:"); Serial.println(readString.substring(i, i + 5));
+    if (readString.substring(i, i + 5) == "+CSQ:")
+    {
+      sim900status = true;
+        if (debug) {
+      Serial.print("FOUND:"); Serial.println(readString.substring(i, i + 10));
+       }
+      gsm_signal = readString.substring(i+5, i + 10).toFloat();
       break;
     }
   }
   return sim900status;
 }
 
+String toProgressBar(int minV, int maxV, int currV)
+{
+  String result;
+  int len = 10;
+  int absV = maxV - minV;
+
+  float mPos;
+  mPos = ((float)currV - (float)minV) / (float)absV;
+  int nPos = round(len * mPos);
+  result = String("[");
+  for (int i=1;i<=len;i++)
+  {
+    if (i <= nPos)
+    { 
+      result = String(result) + String("#");
+      }
+    else
+    {
+      result=String(result) + String("-");
+    }
+  }
+  result = String(result) + String("]");
+  return String(result);
+}
 
 // get a termal-sensors device address
 String getAddress(DeviceAddress deviceAddress)


  call_done = false;
  armed = false;

  // SIM900 serial console initialize and hanging off call (just for shure);
  delay(1000);
  SIM900.println("AT"); //Sending "AT" to modem for auto baud rate sensing;
  delay(1000);
  SIM900.println("ATH");
  delay(1000);
  SIM900.println("AT+CMGD=1,4"); // delete all SMS
  delay(1000);

 if (getSIM900status(true))
  {
    Serial.println("Waiting for network registration");
    while (getNetworkStatus(true))
    {
      Serial.print("."); 
      delay(100); 
    }
  }
  else
  {
    Serial.println("SIM card error!");
  }

  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if (timeStatus() != timeSet)
    Serial.println("Unable to sync with the RTC");
  else
    Serial.println("RTC has set the system time");


  // locate termal sensors on the bus
  Serial.print("Found ");
  Serial.print(sensors.getDeviceCount(), DEC);
  Serial.println(" devices.");

  // search for devices on the bus and assign based on an index.
  for (int i = 0; i < sensors.getDeviceCount(); i++)
  {
    if (!sensors.getAddress(thermalSensor[i], i))
    {
      Serial.print("Unable to find address for Device:"); Serial.print(i);
    }

    Serial.print("Sensor #"); Serial.print(i);
    Serial.print(": "); Serial.println(getAddress(thermalSensor[i]));
    sensors.setHighAlarmTemp (thermalSensor[i], HighAlarmTemp[i]);          // alarm when temp is higher than HighAlarmTemp[i]
    sensors.setLowAlarmTemp(thermalSensor[i], LowAlarmTemp[i]);             // alarm when temp is lower than LowAlarmTemp[i]
    Serial.print("Alarms:");  Serial.println(getAlarms(thermalSensor[i]));
    tt1m[i] = sensors.getTempC(thermalSensor[i]);
  }
}
// get sim900 module status
boolean getSIM900status(boolean debug)
{
  boolean sim900status = false;
  String readString;

  SIM900.println("AT+CPIN?"); // check SIM card status
  while (SIM900.available() > 0)
  { char inchar = SIM900.read();

    delay(10);
  }

  if (debug) {
    Serial.print("[DBG] getSimCardStatus:");
    Serial.print(readString);
  }

  for (int i = 0; i < 200; i++)
  {
    if (readString.substring(i, i + 5) == "READY")
    {
      sim900status = true;

      if (debug) {
        Serial.print("FOUND:");
        Serial.println(readString.substring(i, i + 5));
      }
      break;
