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