Cannot connect with TCP client suddenly - NOTconnected

This stuff drives me mad today. While I thought to have a working version of TCP connect last week, it now suddenly stopped working and gives me a ‘NOTconnected’. I stripped it down to the lightweight version (below) - pointing to my local web server - giving me the same.

this call:

   if (client.connected()) {

throws a false. is def. up and reachable from the core.

Any thoughts ?

– snippet:

TCPClient client;
 const char * serverName = ""; 
void setup() {



void loop() {

client.connect(serverName, 8000);
    if (client.connected()) {
        String GetURL = "GET /pushingbox?devid=";
            client.println("GET /pushingbox?devid=  HTTP/1.0");
            client.print("Host: ");
            client.println("Connection: close"); //just added
        else {


The client.connect() function returns a boolean upon succes or failure. Perhaps you should try to use that instead of cllient.connected()?

Second suggestion: the function can be used to see if a server responds to a ping request. Why don’t you try that to see if your server is still there.

In my own webserver project I’ve encountered several times that my loop was still running, but a ping to my gateway failed. In that situation clients were also not able to connect, so I now do an occasional ping of my gateway to see if the Spark Core is still functioning in its proper state.

Try changing that to

IPAddress serverName(10,0,1,4);

Thanks MDMA, that worked. Looks like I can only connect on IP, not on Server Name anymore (while I think that worked before, ie:

IPAddress serverName(173,194,44,80) // WORKS

const char * serverName = “”; // DOES NOT WORK

I flashed the core to factory reset. Its my local network, dns etc all works.

Any thoughts?