I,m working on project that reading RFID and send to C# server , but when the esp code finish and wants start over c# got error .
for now it just send a string and read string from server;
I am appreciate for help.
And here error
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
const char* ssid = "";
const char* pass = "";
const char* host = "";
int buttonState = 1;
void setup() {
Serial.begin(115200);
Serial.println();
Serial.print("conecting to: ");
Serial.println(ssid);
Serial.println("Try to connect to server: ");
Serial.println(host);
delay(1000);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println();
Serial.print("My IP: ");
Serial.println(WiFi.localIP());
}
void loop() {
WiFiClient client;
Serial.print("Connecting to server");
while (!client.connect(host, 8888)) {
Serial.print(".");
yield();
}
Serial.println();
Serial.print("Conected to IP: ");
Serial.println(host);
Serial.println("Sending string to server: ");
client.println("RFID");
delay(1000);
String line = client.readStringUntil('\n');
Serial.print(line);
Serial.println();
Serial.println("Closing connection");
client.flush();
client.stop();
Serial.println("Connection Closed");
yield();
}