Everything was in the WebClientRepeating.ino and WebServer.ino sample code sketches, I am just trying to mix them.
void httpRequestToWebServer() {
webClient.stop(); // close any connection before send a new request, this will free the socket on the WiFi shield
is in the WebClient sample. Why you say I am not not reading response to client?
As I said if you comment loadServer you see the response coming
You make a GET request, but you neither read the response
the client code shows the reply is read in the main loop
while (client.available()) {
char c = client.read();
Serial.write(c);
}
Why you say I am not not reading response to client?
I repeat, if you comment loadServer you see the response coming.
void loadClient(){
while (Serial.available()) {
params = Serial.readString(); // "azione=accendi&sensore_id=12"
httpRequestToWebServer();
}
}
xcuse my ignorance, but why the hell is that a while loop?
I just would like to obtain this:
Arduino runs in loop, reading from sensors (we say every hour), maybe running some servos and the sends datas to a remote server.
The remote server can send to Arduino commands (tell me your status, read sensor n10, stop servo n4 ... etc )
Maybe It is a wrong approach, just for testing by the way: I just wanted to test the client when new data are available (emulating from serial) and I have not built the 1-hour loop code.