This is sort of a combo question and this community is quite a bit stronger than others, so I was hoping I could get some help here.
I have an app on a WeMos D1 Mini using WiFiClient posting to an endpoint. I am unable to connect when using the initial client.connect(“foo.com”, 80)); statement - it fails immediately which tells me it’s not a network issue since I have a 10-second timeout. When I create an MWE it works fine so somewhere in my app I’m doing something wrong. This is the basic gist of it where it fails:
// Connect to the HTTP server
WiFiClient client;
client.setTimeout(10000);
Log.verbose(F("Connecting to: %s, %l" CR), url.getHost().c_str(), url.getPort());
if (!client.connect(url.getHost(), url.getPort())) {
Log.error(F("Connection failed: %s, %l" CR), url.getHost().c_str(), url.getPort());
return false;
}
… Like I said; simple, so I’m definitely missing something equally simple.
So the two-part question is:
-
(Core related) Is there a way to debug the WiFiClient’s inner workings (without dropping a buncha Serial.prints in the core)?
-
(PlatformIO related) How does one enable/disable Serial debugging as is done via the Arduino ISE’s Tools>Debug>Serial menu selection?
This one is really annoying and I am quite sure I’ll kick myself when I find it.