Core sometimes fails to connect to Cloud on startup

Hi all,

I’ve received today my battery shield, and wanted to test battery life with a simple script :

  1. connect to a server with TCP client
  2. ping it (access to a dedicated url, the keeps a log of pings)
  3. switch to deep sleep mode for one minute
  4. goto step 1

RGB led sequences is:

  1. White flashing (C3300 init process ?)
  2. Green flashing (WIFI authentication)
  3. Cyan flashing (connecting to Spark Cloud)
  4. Cyan breathing (script execution)
  5. RGB led off (sleep mode)

The scripts seems to work well, but sometimes the core is stuck into “Connecting to the Spark Cloud” until I manually reset it.

I don’t know if this issue cames from my Spark Core, or if sometimes the Spark Cloud may sometimes fails connexion (overloaded or similar issue).

Thanks for your help :slight_smile:

@aboudou where are you located and what is your internet bandwidth? I am guessing this is due to latency to the Cloud; we have some fixes in the works that should improve the robustness of this connection

@zach i’m located in France, behind a 7000/1024 kb DSL connection.

Thanks @aboudou - hopefully this issue will be resolved through improvements we make over the next couple of weeks; if it isn’t resolved in three weeks, will you let us know?

Thanks for your answer. I’ll tell you if this issue is resolved or not in three weeks :smiley:

Hi,

I don’t know if Sprint 4 should have fixed this bug, but it seems it’s not the case. I still suffer Spark Cloud connection issues after deep sleep. You can see it here : http://scbattest.herokuapp.com/ (first connection at 07:51 p.m GMT; last successful connection 20 minutes later).

I’ve made a factory reset to be sure to get last firmware version, but no changes.

Can you share any of your code so that we can see what might be going on?

Of course :smile:

TCPClient client;

void setup() {
}

void loop() {

    if (client.connect("scbattest.herokuapp.com", 80)) {
        client.println("GET /xxxx HTTP/1.1");
        client.println("Host: scbattest.herokuapp.com");
        client.println("User-Agent: Spark Core");
        client.println();
        
        while(!client.available());

        client.flush();
        
        client.stop();
    }

    Spark.sleep(SLEEP_MODE_DEEP,60);
}

Hi @aboudou - I think the issues you’re seeing may relate to problems in the TCP library rather than in the Spark Cloud connectivity. There are a few other threads relating to TCP issues that we’re working through, but there were no fixes applied here during Sprint 4.

Thanks for you answer. I’ll just have to wait for TCP library fixes :smile:

Hi @zach. I can confirm it may be related to TCP library. I use the following code all night without any issue:

void setup() {
}

void loop() {

    delay(2000);

    Spark.sleep(SLEEP_MODE_DEEP,60);
}  

The last firmware release (the one from https://community.spark.io/t/latest-firmware-released-to-spark-build/3127/22) seems to have fixed TCP client stability.

Thanks :slight_smile:

2 Likes