const char* ssid = "MAURO"; //replace with your own wifi ssid
const char* password = "R000@2021"; //replace with your own wifi ssid password
const char* host = "192.168.0.100";
WiFiClient client;
void setup() {
Serial.begin(115200);
delay(10); // We start by connecting to a WiFi network Serial.println();
Serial.println();
WiFi.mode(WIFI_OFF);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
I don’t have your server on my local network nor the same network configuration…
Start from a library example making a get request for a resource on the public internet. When that works you know your network and basic code is OK
Then move to your local network - I assume you have an http server somewhere, store a json file and make the get request for that
When that works you know the local network is ok too
Then insert your own server and again make that work.
Take small steps with known code. Then take this learning to write your own code
—-
PS: please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. It’s barely readable as it stands and I won’t spend a minute more studying stuff I can’t read nor easily copy in the IDE. (also make sure you indented the code in the IDE before copying, that’s done by pressing ctrlT on a PC or cmdT on a Mac)