feature/InfluxDB-Connection-Update #1

Merged
klaute merged 39 commits from feature/InfluxDB-Connection-Update into master 2022-05-23 17:36:59 +02:00
Showing only changes of commit d670b753dc - Show all commits

View file

@ -226,11 +226,14 @@ void _loop() {
debug("Reading wind sensor because of exceed call functionality"); debug("Reading wind sensor because of exceed call functionality");
if (sensors[SENSOR_WINDSPEED]) if (sensors[SENSOR_WINDSPEED])
{ {
// read from windspeed sensor // read from windspeed sensorSTATUS_LED_PIN
digitalWrite(STATUS_LED_PIN, HIGH);
currentSensorData[SENSOR_WINDSPEED] = sensors[SENSOR_WINDSPEED](); currentSensorData[SENSOR_WINDSPEED] = sensors[SENSOR_WINDSPEED]();
digitalWrite(STATUS_LED_PIN, LOW);
if (currentSensorData[SENSOR_WINDSPEED] >= HTTP_CALL_ON_WINDSPEED_EXCEED_MPS) if (currentSensorData[SENSOR_WINDSPEED] >= HTTP_CALL_ON_WINDSPEED_EXCEED_MPS)
{ {
digitalWrite(STATUS_LED_PIN, HIGH);
// call the url HTTP_CALL_ON_WINDSPEED_URL // call the url HTTP_CALL_ON_WINDSPEED_URL
WiFiClient client; WiFiClient client;
HTTPClient http; HTTPClient http;
@ -239,6 +242,7 @@ void _loop() {
// Send HTTP GET request // Send HTTP GET request
int httpResponseCode = http.GET(); int httpResponseCode = http.GET();
debug("Called windspeed exceed callout"); debug("Called windspeed exceed callout");
digitalWrite(STATUS_LED_PIN, LOW);
} }
} else { } else {
currentSensorData[SENSOR_WINDSPEED] = nan("no value"); currentSensorData[SENSOR_WINDSPEED] = nan("no value");