From 4b07ad5aed02c34fce795e94ed854ec7909f180c Mon Sep 17 00:00:00 2001 From: noerw Date: Sat, 23 Sep 2017 14:10:39 +0200 Subject: [PATCH] use ingress api domain --- TelnetPrint.h | 6 +++--- api.h | 2 +- storage.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TelnetPrint.h b/TelnetPrint.h index 1eae646..bb69e76 100644 --- a/TelnetPrint.h +++ b/TelnetPrint.h @@ -6,7 +6,7 @@ * to disable the routines, just skip the begin() call in the setup */ -# pragma once +#pragma once #include #define MAX_TELNET_CLIENTS 3 @@ -14,7 +14,7 @@ class TelnetPrint : public Print { protected: WiFiServer server; WiFiClient clients[MAX_TELNET_CLIENTS]; - + public: TelnetPrint(uint16_t port=23) : server(port) {} @@ -44,7 +44,7 @@ class TelnetPrint : public Print { //no free/disconnected spot so reject WiFiClient serverClient = server.available(); serverClient.stop(); - } + } } // TODO: find more efficient method than sending byte by byte (!) diff --git a/api.h b/api.h index ad9c854..445ddf7 100644 --- a/api.h +++ b/api.h @@ -9,7 +9,7 @@ class OsemApi { public: bool postMeasurement(String measurement, String sensorID) { - if (!client.connect(API_ENDPOINT, 8000)) return false; + if (!client.connect(API_ENDPOINT, 80)) return false; client << String("POST ") << "/boxes/" << ID_BOX << "/" << sensorID << " HTTP/1.1" << EOL; client << "Host: " << API_ENDPOINT << EOL; diff --git a/storage.h b/storage.h index 69e7aec..f3406e0 100644 --- a/storage.h +++ b/storage.h @@ -21,7 +21,7 @@ class Storage { // convert floats to strings char val[8], lat[16], lng[16]; - dtostrf(m.value, 6, 4, val); + dtostrf(m.value, 6, 2, val); dtostrf(m.lat, 12, 8, lat); dtostrf(m.lng, 12, 8, lng);