@bko. The joy was short lived. Now I'm getting nearly consistent DNS fails.
Code:
IPAddress serverIP;
for (int i = 0; i < 10; i++)
{
serverIP = WiFi.resolve(cmStr);
if (serverIP) break;
delay(250); // allow time for the DNS server to maybe think about giving us an IP address?
}
Serial.print("Server IP: "); Serial.println(serverIP);
I would check those DNS logs on your router or DNS host to see what it thinks it happening.
If this is a core, you should check if you DNS host is 76.83.0.0. If so you should reapply TI CC3000 patch since the TI part seems to lose itās mind sometimes wrt DNS. In the CLI do, particle flash --usb cc3000 to reflash the TI part with the core in DFU mode over USB.
One successful DNS resolve made; the one immediately following failed. FWIW, I don't have control of the WiFi router, but that could be part of the problem. Yes, I'm using a Core, and the router gives it a fixed IP address of 10.0.0.43.
I tried it again, and got the same DNS IP address. Following that, it successfully resolved textbelt.com...but the TCPClient failed to connect to the resolved IP address!
I'll try connecting the Core to my phone's WiFi hotspot. If everything's hunky dory after that, I know what to blame.
Connected my Core to my phoneās unsecured WiFi hotspot. The response?
DNS host: 192.168.43.1
Result? Same. It was able to resolve the first hostname (textbelt.com), but not the second (smtp.gmx.com). Actually, there was no response back from textbelt.com and no message sent. Obviously, I didnāt get an e-mail from GMX, either.
@bko: Quick question, as this could possibly be the issue: Is it good practice to define my TCPClient in the declarations at the head of the source code? I do understand that there are no destructors specified for the TCPClient/TCPServer, but am running out of things to try to resolve this issue.
As in:
#define RS_DEBUG // for RS-232 printout.
TCPClient cClient; // our own TCPClient
char cmStr[80];
int mBase, mWork;
//-----------------------------------------------------------------------------
// Glue-wrapper routine
//-----------------------------------------------------------------------------
void SendNotify(char *Message)
{
...
Basically, Iām getting random DNS fails on every single build Iāve tried, (now) from Particle Dev IDE, to RELEASE 0.4.3, LATEST and DEVELOP.
FWIW: My WiFi router is using OpenDNS.
EDIT: some more thoughts. The TCPServer/TCPClient server is working very nicely, and reliably. BUTā¦that code also creates a new TCPClient structure for each connection. Could it be that in my notification code, thereās some āstrayā values not getting reset in the structure that are causing these connection issues with my publicly-defined TCPClient instance?
connection seems to be what breaks it. Disable the cloud (Iām in manual modeā¦itās easy to do), and bingo: 100% transmission success rate, and 100% DNS resolveā¦
ā¦the only problem? My local Sprint tower just died again, so I havenāt received a single message. Cheers!
Iām experimenting with adding Spark.process() to strategic locations around the loop.