Hello
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()
{
RGB.control(true);
Serial.begin(9600);
while(!Serial.available()) SPARK_WLAN_Loop();
while(1){
num = random(10);
if (client.connected())
{
client.write(num);
Serial.println(F(num));
}
else {
Serial.println(F("connection attempt failed"));
while(!client.connect(server, 30003))
{ // blink LED if no connection
RGB.color(0, 0, 0);
delay(1000);
RGB.color(100, 100, 100);
delay(1000);
}
}
}
}
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
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?