mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-27 23:47:16 +02:00
Adjusted examples to not send error codes (e.g. -1) to server
This commit is contained in:
@ -182,13 +182,15 @@ void showTextRectangle(String ln1, String ln2, boolean small) {
|
||||
void sendToServer() {
|
||||
if (currentMillis - previoussendToServer >= sendToServerInterval) {
|
||||
previoussendToServer += sendToServerInterval;
|
||||
|
||||
String payload = "{\"wifi\":" + String(WiFi.RSSI())
|
||||
+ ", \"rco2\":" + String(Co2)
|
||||
+ ", \"pm02\":" + String(pm25)
|
||||
+ (Co2 < 0 ? "" : ", \"rco2\":" + String(Co2))
|
||||
+ (pm25 < 0 ? "" : ", \"pm02\":" + String(pm25))
|
||||
+ ", \"atmp\":" + String(temp)
|
||||
+ ", \"rhum\":" + String(hum)
|
||||
+ (hum < 0 ? "" : ", \"rhum\":" + String(hum))
|
||||
+ "}";
|
||||
|
||||
|
||||
if(WiFi.status()== WL_CONNECTED){
|
||||
Serial.println(payload);
|
||||
String POSTURL = APIROOT + "sensors/airgradient:" + String(ESP.getChipId(), HEX) + "/measures";
|
||||
|
Reference in New Issue
Block a user