Compare commits

..

No commits in common. "40b2550c899df8354dc9047ddeb2cfdce473982c" and "c89486bd31be5088889c20ff71bbb53a4b3640e3" have entirely different histories.

3 changed files with 5 additions and 30 deletions

View file

@ -3,8 +3,8 @@
// config general setting and behavior of the weatherstation // config general setting and behavior of the weatherstation
#define WIFI_AUTOCONNECT_TIMEOUT_S 60 #define WIFI_AUTOCONNECT_TIMEOUT_S 120
#define WIFI_CONFIG_PORTAL_TIMEOUT_S 300 #define WIFI_CONFIG_PORTAL_TIMEOUT_S 120
#define UPDATE_SENSOR_INTERVAL_S 300 #define UPDATE_SENSOR_INTERVAL_S 300
#define UPDATE_WEBSERVER_INTVERVAL_S 1 // Do not change, bigger values will prevent using webupdater webinterface #define UPDATE_WEBSERVER_INTVERVAL_S 1 // Do not change, bigger values will prevent using webupdater webinterface
#define DELAY_LOOP_MS 100 #define DELAY_LOOP_MS 100
@ -13,7 +13,7 @@
#define RESET_ESP_TIME_INTERVAL_MS (60*60*12*1000) // reset every 12 hours #define RESET_ESP_TIME_INTERVAL_MS (60*60*12*1000) // reset every 12 hours
#define WIND_SENSOR_MEAS_TIME_S 15 #define WIND_SENSOR_MEAS_TIME_S 15
#define WATCHDOG_TIMEOUT_MS 30000 #define WATCHDOG_TIMEOUT_MS 30000
#define WIFI_CHECK_INTERVAL_MS 120000 #define WIFI_CHECK_INTERVAL_MS 600000
#define ENERGY_SAVING_ITERATIONS 30 #define ENERGY_SAVING_ITERATIONS 30

View file

@ -48,8 +48,6 @@ boolean validData = false;
boolean do_not_read_windsensor = false; boolean do_not_read_windsensor = false;
uint32_t wifi_reconnect_cnt = 0;
//*************************************************************************// //*************************************************************************//
void debug(String x) void debug(String x)
@ -157,8 +155,6 @@ void initSensors()
#endif #endif
} }
//*************************************************************************//
float readSensors(uint8_t s) float readSensors(uint8_t s)
{ {
float ret = nan("no value"); float ret = nan("no value");
@ -245,20 +241,12 @@ void wifiConnectionCheck()
return; return;
} }
wifi_reconnect_cnt++; debug("no wifi connection, try to reconnect");
debug("no wifi connection, try to reconnect " + String(wifi_reconnect_cnt));
#ifdef WEBUPDATER_FEATURE
setWifiReconnectCnt(wifi_reconnect_cnt);
#endif
wifiConnect(); wifiConnect();
} }
//*************************************************************************//
void wifiConnect() void wifiConnect()
{ {
@ -421,16 +409,14 @@ void _fsm_loop()
{ {
// read data from sensor // read data from sensor
currentSensorData[sensor_cnt] = readSensors(sensor_cnt); currentSensorData[sensor_cnt] = readSensors(sensor_cnt);
//debug(String(sensor_cnt) + "=" + String(currentSensorData[sensor_cnt]));
} else { } else {
start_measure_wind(); // start measurement of wind speed start_measure_wind(); // start measurement of wind speed
fsm_state = FSM_STATE_9; // wait untile the wind meas time exceeded fsm_state = FSM_STATE_9; // wait untile the wind meas time exceeded
break; // abort case here to prevent read of next sensor in list break; // abort case here to prevent read of next sensor in list
} }
if (sensor_cnt < VALUES-1) if (sensor_cnt < VALUES)
{ {
sensor_cnt++; sensor_cnt++;
fsm_state = FSM_STATE_5; // jump to same state again, more sensors to read fsm_state = FSM_STATE_5; // jump to same state again, more sensors to read

View file

@ -41,8 +41,6 @@ const String hb_ws_msg_end = "}";
boolean wuValidData = false; boolean wuValidData = false;
uint32_t _wifi_reconnect_cnt = 0;
//*************************************************************************// //*************************************************************************//
void setupWebUpdater(String device, String ip) void setupWebUpdater(String device, String ip)
@ -77,13 +75,6 @@ void doWebUpdater(void)
httpServer.handleClient(); httpServer.handleClient();
} }
//*************************************************************************//
void setWifiReconnectCnt(uint32_t wrc)
{
_wifi_reconnect_cnt = wrc;
}
void setSensorData(float sensorValues[]) void setSensorData(float sensorValues[])
{ {
@ -100,7 +91,6 @@ void setSensorData(float sensorValues[])
if (sensorValues[i] != nanf("no value") and (not isnan(sensorValues[i]))) if (sensorValues[i] != nanf("no value") and (not isnan(sensorValues[i])))
{ {
// only copy real float values // only copy real float values
debug(String(i) + "=" + String(sensorValues[i]));
_webUpdater_sensValues[i] = sensorValues[i]; _webUpdater_sensValues[i] = sensorValues[i];
} }
} }
@ -134,7 +124,6 @@ TR_TD_START_STR + "batvoltage" + TD_TD_MID_STR + String(_webUpdater_sensValue
TR_TD_START_STR + "millis" + TD_TD_MID_STR + String(millis()) + TR_TD_END_STR TR_TD_START_STR + "millis" + TD_TD_MID_STR + String(millis()) + TR_TD_END_STR
TR_TD_START_STR + "valid" + TD_TD_MID_STR + String(wuValidData) + TR_TD_END_STR TR_TD_START_STR + "valid" + TD_TD_MID_STR + String(wuValidData) + TR_TD_END_STR
TR_TD_START_STR + "wifi rssi" + TD_TD_MID_STR + WiFi.RSSI() + TR_TD_END_STR TR_TD_START_STR + "wifi rssi" + TD_TD_MID_STR + WiFi.RSSI() + TR_TD_END_STR
TR_TD_START_STR + "wifi rec cnt" + TD_TD_MID_STR + String(_wifi_reconnect_cnt) + TR_TD_END_STR
"</table>" "</table>"
"<br><br><br><br><br><a href=\"http://" + _webUpdater_ip + ":8080/resetWifiManager\">reset WiFi Manager</a><br>" "<br><br><br><br><br><a href=\"http://" + _webUpdater_ip + ":8080/resetWifiManager\">reset WiFi Manager</a><br>"
"</body></html>"; "</body></html>";