I have been using WifiClient and WifiClientSecure to make HTTP get request for JSON file. I observed that WifiClient may crash the program occasionally while it is facing a timeout or connection error to web server. The same situation doesnt happen while calling WifiClientSecure, failure of http request can be handled properly without any system hanging or crash.
Thank you. I think it is installed with v2.1.0. I will try 2.1.1
May I know if I can disable the CA cert check in WIFIClientSecure? ! have a couple of https url to call, hard-coding all of them with different CA Cert in my code is not sustainable
I changed my code to get JSON via http client, everything looks ok however system hang/crash happen again after a failed URL call occasionally.
My program is very simple which allow Bluetooth Client to connect and provide WIFI SSID & pwd.
Then download data periodically from web server via wifi and disable in screen as a system monitor device… Unfortunately the network API is unstable
if (httpCode > 0) {
// HTTP header has been send and Server response header has been handled
Serial.printf("[HTTP] GET… code: %d\n", httpCode);
// file found at server
if (httpCode == HTTP_CODE_OK) {
payload = client.getString();
Serial.println(payload);
}