diff --git a/metesp.ino b/metesp.ino index 630ebf7..b9874e1 100644 --- a/metesp.ino +++ b/metesp.ino @@ -45,7 +45,7 @@ static OWM* owm[6] = {new OWM(LOCATION_0, OPENWEATHER_API), new OWM(LOCATION_1, OPENWEATHER_API), new OWM(LOCATION_2, OPENWEATHER_API), NULL,NULL,NULL}; -static Influx* iflx = new Influx(NULL, owm);//TODO: Add sensor +static Influx* iflx = new Influx(sensor, owm);//TODO: Add sensor static TimedFun* tf = new TimedFun(); static bool time_update = true, view_update = true, view_refresh = false; @@ -121,10 +121,10 @@ REGISTER_TIMEDFUN(NTP_TF, ntp->updateNTPtime()); void setup_TIMEDFUN() { REGISTER_TIMEDFUN_CALL(NTP_TF, 60*60); - REGISTER_TIMEDFUN_CALL(SENSOR_MEASURE_TF,5); - REGISTER_TIMEDFUN_CALL(OWM_MEASURE_TF,5*60); - // REGISTER_TIMEDFUN_CALL(RECORD_LOCAL_TF,1*60); - // REGISTER_TIMEDFUN_CALL(RECORD_WEATHER_TF,5*60); + REGISTER_TIMEDFUN_CALL(SENSOR_MEASURE_TF,5); // 5s LOCAL SYNC + REGISTER_TIMEDFUN_CALL(OWM_MEASURE_TF,5*60); // 5m WEATHER SYNC + REGISTER_TIMEDFUN_CALL(RECORD_LOCAL_TF,1*60); // 1m LOCAL DB + // REGISTER_TIMEDFUN_CALL(RECORD_WEATHER_TF,5*60); // 5m WEATHER DB } void setup_POWER() { diff --git a/src/display/display.cpp b/src/display/display.cpp index 01ce962..e7dceea 100644 --- a/src/display/display.cpp +++ b/src/display/display.cpp @@ -153,8 +153,8 @@ void LightDisplay::drawDisplay() { Paint_DrawFltUnit(76,0,sensor->light_lux, "lux", &Font24, BLACK, WHITE); Paint_DrawIntUnit(76,24*1,sensor->uvi, "uvi", &Font24, BLACK, WHITE); - Paint_DrawFltUnit(76,24*2,sensor->light, "l", &Font24, BLACK, WHITE); - Paint_DrawIntUnit(76,24*3,sensor->light_vis, "vl", &Font24, BLACK, WHITE); + Paint_DrawIntUnit(76,24*2,sensor->light_full, "f", &Font24, BLACK, WHITE); + Paint_DrawIntUnit(76,24*3,sensor->light_vis, "v", &Font24, BLACK, WHITE); Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - Font16.Height,"Nominal", &Font16, WHITE, BLACK); } diff --git a/src/influxdb/influx.h b/src/influxdb/influx.h index cffcd03..f0521e3 100644 --- a/src/influxdb/influx.h +++ b/src/influxdb/influx.h @@ -87,12 +87,11 @@ public: dp.addTag("device", "WESP0"); dp.addTag("location", "local"); - dp.addField("temperature", sensor->temp); - dp.addField("pressure", sensor->pres); - dp.addField("humidity", sensor->temp); - dp.addField("heat_index", sensor->heatidx); + dp.addField("temperature", float(sensor->temp)); + dp.addField("pressure", int32_t(sensor->pres)); + dp.addField("humidity", int32_t(sensor->hum)); + dp.addField("temperature_feel", float(sensor->heatidx)); - dp.addField("light", sensor->light); dp.addField("uv", sensor->uv); dp.addField("uvi", sensor->uvi); diff --git a/src/sensor/dev/tsl25911.cpp b/src/sensor/dev/tsl25911.cpp index da7210d..ae2651e 100644 --- a/src/sensor/dev/tsl25911.cpp +++ b/src/sensor/dev/tsl25911.cpp @@ -77,7 +77,7 @@ bool TSL25911::ReadData(uint32_t* dataf) { uint8_t* data = static_cast(static_cast(dataf)); bool success = WriteRegister(REG_ENABLE, ENABLE_POWERON | ENABLE_AEN); - delay((uint32_t)atime()); + delay((uint32_t)atime()+100); success &= ReadRegister(CHAN0_LOW,&data[0],2); success &= ReadRegister(CHAN1_LOW,&data[2],2); diff --git a/src/sensor/sensor.h b/src/sensor/sensor.h index 46b1568..9d4c098 100644 --- a/src/sensor/sensor.h +++ b/src/sensor/sensor.h @@ -24,7 +24,6 @@ public: float hum = 0; float heatidx = 0; - float light = 0; uint32_t uv = 0; uint32_t uvi = 0; diff --git a/src/timedfun/timedfun.h b/src/timedfun/timedfun.h index 6cbaec7..67631d4 100644 --- a/src/timedfun/timedfun.h +++ b/src/timedfun/timedfun.h @@ -43,7 +43,6 @@ public: e.first(); } } - old_counter = counter; }; void updateForce() {