added check symbol at the start of payload to help determine payload integrity
This commit is contained in:
parent
22d4c4dc76
commit
c5ae5dc15a
@ -647,12 +647,13 @@ int16_t measureCO2(){
|
||||
}
|
||||
|
||||
bool sendDataToServer(){
|
||||
char payload[22];
|
||||
char payload[32];
|
||||
char stemp[8];
|
||||
char shum[8];
|
||||
char check[] = "=";
|
||||
dtostrf(dataset.temp, 5, 2, stemp);
|
||||
dtostrf(dataset.hum, 5, 2, shum); //convert floats to strings
|
||||
sprintf(payload, "%s,%s,%d,%d", stemp, shum, dataset.rpres, dataset.co2); //convert everything to a string
|
||||
sprintf(payload, "%s,%s,%s,%d,%d", check, stemp, shum, dataset.rpres, dataset.co2); //convert everything to a string
|
||||
Serial2.print(payload); //send over serial 2 to esp
|
||||
Serial2.print('\n'); //terminate transmission
|
||||
delay(1000); //give time to process comm
|
||||
|
Loading…
Reference in New Issue
Block a user