     if (client.connected()) {
         client.stop();
     }
-    Spark.sleep(SLEEP_MODE_DEEP, 1);    // Reboot the Spark Core after one second
+    System.sleep(SLEEP_MODE_DEEP, 1);    // Reboot the Spark Core after one second
 }
 
 void copyHubsToRAM(void) {

    
    Serial.begin(9600);             // Used for logging
#ifdef sparkdebug
    while(!Serial.available()) SPARK_WLAN_Loop();
    Serial.print("Beginning bridge process with connectable = ");
    Serial.println(connectable);
#endif

        while(idx < framelen) {
            do {
                c = client.read();
                if (c == -1) Particle.process();
            } while (c == -1);
            
            //if (idx < 3)
