Skip to content

Commit fe7cc85

Browse files
committed
Fix data being cut in the middle
1 parent 4c693bb commit fe7cc85

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main.ino

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
Reads data from RX pin, packages it into a Json object and sends it to AWS IoT, then responds through pin TX to the Arduino Board listening on the other side
3+
@author MecaHumArduino
4+
@version 3.0
5+
*/
6+
17
#include <ESP8266WiFi.h>
28
#include <WiFiClientSecure.h>
39
#include <SoftwareSerial.h>
@@ -47,6 +53,7 @@ void NTPConnect(void)
4753

4854
Serial.println(" done!");
4955
sendDataToUno(" done!\r\n", 1000, DEBUG);
56+
5057
struct tm timeinfo;
5158
gmtime_r(&now, &timeinfo);
5259

@@ -127,7 +134,7 @@ void sendDataToAWS(void)
127134

128135
// read data coming from Uno board
129136

130-
state_reported["values"] = Serial.readStringUntil('\r\n');
137+
state_reported["values"] = Serial.readString();
131138

132139
Serial.printf("Sending [%s]: ", MQTT_PUB_TOPIC);
133140
serializeJson(root, Serial);

0 commit comments

Comments
 (0)