         Serial.println("Retrying connecion...");
     }
     initSensors();
-    registerDevice();
+    registerDevice(generateRegister(ip, identifier));
+    Serial.println("Done registering!");
 }
 
 void loop() {
+    Serial.println("loop!");
     int index;
 
     // Update the value in the sensors

  dht.begin();

  for (index = 0; index < MAX_SENSOR_COUNT; index++){
      Sensor sensor;
      sensor.identifier = "S" + index;
      // initalise to -1 to give it a value which will never succeed
      sensor.databaseId = -1;


typedef struct {
    String identifier;
    float value;
    int databaseId;
} Sensor;

// This is for the ESP8266 processor on ESP-01
