From 1ed29953fec5c5c69f4bb802bb212e8812057239 Mon Sep 17 00:00:00 2001 From: admar Date: Fri, 27 May 2022 20:48:58 +0200 Subject: [PATCH] Use https://sinoptik.luon.net and really close connections when doing http.end() --- Claire.ino | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Claire.ino b/Claire.ino index 949674f..59dbf32 100644 --- a/Claire.ino +++ b/Claire.ino @@ -58,8 +58,8 @@ String output; Bsec iaqSensor; static HTTPClient http; -static const String baseUrlAQI = "http://target.luon.net:2356//forecast?&metrics=PAQI&metrics=AQI&metrics=pollen&metrics=UVI"; -static const String baseUrlPrecipitation = "http://target.luon.net:2356//forecast?metrics=precipitation"; +static const String baseUrlAQI = "https://sinoptik.luon.net/forecast?metrics=PAQI&metrics=AQI&metrics=pollen&metrics=UVI"; +static const String baseUrlPrecipitation = "https://sinoptik.luon.net/forecast?metrics=precipitation"; static int hw_variant = 0; @@ -373,6 +373,8 @@ void setup() { Serial.begin(115200); Serial.println("buienradarklok starting"); + http.setReuse(false); + SPI.begin(); iaqSensor.begin(BME_CS, SPI); String output = "\nBSEC library version " + String(iaqSensor.version.major) + "." + String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." + String(iaqSensor.version.minor_bugfix); @@ -504,7 +506,7 @@ void getPrecipitation(const float * location) { Serial.println(url); - http.begin(url); + http.begin(url, root_ca); httpCode = http.GET(); if (httpCode > 0) { @@ -530,7 +532,7 @@ void getPrecipitation(const String address) { Serial.println(url); - http.begin(url); + http.begin(url, root_ca); httpCode = http.GET(); if (httpCode > 0) { @@ -562,7 +564,7 @@ void getAQI(const float * location) { Serial.println(url); - http.begin(url); + http.begin(url, root_ca); httpCode = http.GET(); if (httpCode > 0) { @@ -588,7 +590,7 @@ void getAQI(const String address) { Serial.println(url); - http.begin(url); + http.begin(url, root_ca); httpCode = http.GET(); if (httpCode > 0) {