From 0abc5629fcdbcaf8fc57dec4f64b28bea5c8c55a Mon Sep 17 00:00:00 2001 From: Mark Polyakov Date: Sat, 29 May 2021 00:04:15 -0700 Subject: [PATCH] correct math.h header and specify wificlient as per new http library requirement --- AirGradient.cpp | 2 +- examples/C02_PM_SHT_OLED_WIFI/C02_PM_SHT_OLED_WIFI.ino | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/AirGradient.cpp b/AirGradient.cpp index 94ad002..ac6232e 100644 --- a/AirGradient.cpp +++ b/AirGradient.cpp @@ -11,7 +11,7 @@ #include #include "Arduino.h" #include -#include +#include // Constructor ///////////////////////////////////////////////////////////////// diff --git a/examples/C02_PM_SHT_OLED_WIFI/C02_PM_SHT_OLED_WIFI.ino b/examples/C02_PM_SHT_OLED_WIFI/C02_PM_SHT_OLED_WIFI.ino index 71cfdf2..f2e5b9d 100644 --- a/examples/C02_PM_SHT_OLED_WIFI/C02_PM_SHT_OLED_WIFI.ino +++ b/examples/C02_PM_SHT_OLED_WIFI/C02_PM_SHT_OLED_WIFI.ino @@ -37,6 +37,8 @@ AirGradient ag = AirGradient(); SSD1306Wire display(0x3c, SDA, SCL); +WiFiClient client; + // set sensors that you do not use to false boolean hasPM=true; boolean hasCO2=true; @@ -100,7 +102,7 @@ void loop(){ String POSTURL = APIROOT + "sensors/airgradient:" + String(ESP.getChipId(),HEX) + "/measures"; Serial.println(POSTURL); HTTPClient http; - http.begin(POSTURL); + http.begin(client, POSTURL); http.addHeader("content-type", "application/json"); int httpCode = http.POST(payload); String response = http.getString();