B@tto 51 Posted August 4, 2016 Share Posted August 4, 2016 Hi, I have strange problems with my connected launchpad. This is the code : byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; EthernetServer server(1234); void setup() { Ethernet.begin(mac); server.begin(); Serial.begin(9600); Serial.print("Chat server address:"); Serial.println(Ethernet.localIP()); } void loop() { EthernetClient client = server.available(); if (client) { unsigned long timing = micros(); Serial.println("New client !"); while (client.connected()) { if (client.available() > 0) { if (client.read() == 'A') { char buffer[300]; memset(buffer, NULL, sizeof(buffer)); strcat(buffer, "1000"); strcat(buffer, ","); strcat(buffer, "1000"); strcat(buffer, ","); strcat(buffer, "1000"); strcat(buffer, ","); strcat(buffer, "1000"); server.write(buffer); } } } Serial.println("Client disconnected!"); client.stop(); } } It's very simple : I send a 'A', it responds. For now it's just a simulation, the purpose is to send data. My probleme is the latency : I have a soft which send a 'A', receives the response, and immediately sends another 'A' etc ... With connected launchpad, it's very slow, around 400-500ms to get the answer. I tested the same code with an Arduino Uno + ethernet shield, it's so much faster. And another strange thing : even if I close my TCP socket from computer, client.connected() still returns true. On Arduino I immediately get a "Client disconnected!". Any ideas ? Quote Link to post Share on other sites
B@tto 51 Posted August 16, 2016 Author Share Posted August 16, 2016 UP Same code with CC3200 LP is OK too. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.