I have an application running a Server and a Client together, along with the need to count coins, responding pretty much in real time, which has been a challenge. As we all know the server.handleClient() function is the bottleneck of the system, having to be instantiated very often under risk of resetting the system by watchdog timer.
So, to prevent the system from getting stuck in an overly long loop, I reduced the Timeout of the client function parameter that talks to the cloud, namely the TIMEOUT_MS_SERVERRESPONSE value was reduced from 5,000ms to 1,500ms in the ThingSpeak.h file (C:\Users\<USER>\Documents\Arduino\libraries\ThingSpeak\src).
But this seemed have not being reflected in the actual execution of the program, because when surrounding the function below, sometimes due to network issues, it takes a lot of time to get away, much more than the value that I have modified above.
Serial.println ("Start-Upload");
ThingSpeak.setField (ID_DEVICE, (String) MountString ()); // takes long time between both "Serial Prints"
Serial.println ("Stop-Upload");
I suspect that the file is not being re-compiled, but rather that some object file is being re-used instead, even though in the Arduino IDE I have changed the option of "agressively cache code" or not.
Anyone have any tips on how to solve this?