added check symbol at the start of payload to help determine payload integrity

This commit is contained in:
2EEEB 2020-07-01 20:27:46 +02:00
parent 22d4c4dc76
commit c5ae5dc15a
Signed by: 2EEEB
GPG Key ID: 8F12BD6D9D435DB2

@ -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