diff --git a/firmware/firmware.ino b/firmware/firmware.ino index a5e4c9d..07cfc9c 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -94,18 +94,10 @@ void setup() wifiConnect(); debug("Connected!"); -#ifdef INFLUXDB_FEATURE - influxdb_begin(); -#endif + initWifiBasedSW(); initSensors(); -#ifdef WEBUPDATER_FEATURE -#ifndef BATTERY_POWERED - setupWebUpdater(DEVICE_NAME, WiFi.localIP().toString()); -#endif -#endif - //It's magic! leave in delay(100); @@ -140,6 +132,23 @@ void setup() //*************************************************************************// +void initWifiBasedSW() +{ + +#ifdef INFLUXDB_FEATURE + influxdb_begin(); +#endif + +#ifdef WEBUPDATER_FEATURE +#ifndef BATTERY_POWERED + setupWebUpdater(DEVICE_NAME, WiFi.localIP().toString()); +#endif +#endif + +} + +//*************************************************************************// + void initSensors() { // Initialize and configure the sensors