TCPClient.write in loop doesn't transfer data after few kilobytes

Set such simple enviroment:

on linux box run: nc -l 30003 > /tmp/aaa.bin
on spark core flash code:

int num;
TCPClient client;
byte server[] = { 192, 168, 1, 2 }; // linux IP

void setup()
    while(!Serial.available()) SPARK_WLAN_Loop();
        num = random(10);
        if (client.connected())
        else {
            Serial.println(F("connection attempt failed"));
            while(!client.connect(server, 30003))
            {   // blink LED if no connection
                RGB.color(0, 0, 0);
                RGB.color(100, 100, 100);

Around a minute (or often less) data collecting in aaa.bin on linux and serial monitor showing random numbers. Then serial monitor freeze on few seconds. After that numbers runs on monitor again, but stop saving in file.
So core think that it’s still connected to linux. Netcat also doesn’t interrupt the session. But no more data saved. Sometimes during this process Core start blinking red and reboot :frowning:
If i try to send data not a single bytes but byte series then all this events happen in same manner.

What does such behaviour mean? And how can i transfer more than a couple of bytes to the server?

Have you tried updating to the latest cc3000 service pack?

Thank you very much.
I am missed this cc3000 update. It’s fix issue.

1 Like