Fast Sending Data To Server Loop
Fast Sending Data To Server Loop
h>
#include <HardwareSerial.h>
#include <HTTPClient.h>
void setup() {
Serial.begin(115200);
mySerial.begin(9600, SERIAL_8N1, 16, 17); // RX2 (GPIO16) and TX2 (GPIO17)
// Connect to Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println("Connected to Wi-Fi");
}
void loop() {
String nmeaSentence = "";
if (httpResponseCode > 0) {
String response = http.getString();
Serial.println("Response: " + response);
} else {
Serial.println("Error: " + String(httpResponseCode));
}
http.end();
} else {
Serial.println("Error: Not connected to Wi-Fi");
}
}