use ingress api domain

esp8266-bme280
noerw 7 years ago
parent d847ba7f43
commit 4b07ad5aed

@ -6,7 +6,7 @@
* to disable the routines, just skip the begin() call in the setup * to disable the routines, just skip the begin() call in the setup
*/ */
# pragma once #pragma once
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#define MAX_TELNET_CLIENTS 3 #define MAX_TELNET_CLIENTS 3
@ -14,7 +14,7 @@ class TelnetPrint : public Print {
protected: protected:
WiFiServer server; WiFiServer server;
WiFiClient clients[MAX_TELNET_CLIENTS]; WiFiClient clients[MAX_TELNET_CLIENTS];
public: public:
TelnetPrint(uint16_t port=23) : server(port) {} TelnetPrint(uint16_t port=23) : server(port) {}
@ -44,7 +44,7 @@ class TelnetPrint : public Print {
//no free/disconnected spot so reject //no free/disconnected spot so reject
WiFiClient serverClient = server.available(); WiFiClient serverClient = server.available();
serverClient.stop(); serverClient.stop();
} }
} }
// TODO: find more efficient method than sending byte by byte (!) // TODO: find more efficient method than sending byte by byte (!)

@ -9,7 +9,7 @@ class OsemApi {
public: public:
bool postMeasurement(String measurement, String sensorID) { 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 << String("POST ") << "/boxes/" << ID_BOX << "/" << sensorID << " HTTP/1.1" << EOL;
client << "Host: " << API_ENDPOINT << EOL; client << "Host: " << API_ENDPOINT << EOL;

@ -21,7 +21,7 @@ class Storage {
// convert floats to strings // convert floats to strings
char val[8], lat[16], lng[16]; 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.lat, 12, 8, lat);
dtostrf(m.lng, 12, 8, lng); dtostrf(m.lng, 12, 8, lng);

Loading…
Cancel
Save