     Serial.println("Connected to Proximity Sensor.");
   }
 
+  // Network
+  setup_wifi();
+  mqttClient.setServer(MQTT_SERVER, MQTT_PORT);
+
+  // Schedulers
   tickerHeartbeat.attach(10, heartbeat);
   tickerUpdate.attach_ms(100, update);
 

  }
}

void door_opened() {
  Serial.println("Cat door opened");
}

void door_closed() {
  Serial.println("Cat door closed.");
}

void setup() {
  for (uint16_t i = 0; i < NB_PROXIM_SAMPLES; i++) {
    proxim_samples[i] = proxim_nominal;
  }

#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include <Ticker.h>
#include <PubSubClient.h>

#include "Adafruit_VCNL4010.h"

