chipKIT® Development Platform

Inspired by Arduino™

MPIDE web server problem

Created Mon, 22 Sep 2014 07:58:11 +0000 by GPeti


Mon, 22 Sep 2014 07:58:11 +0000

Hi all! I made a web server with Cerebot MX7CK board, MPIDE-0023-windows-20120903, modified date of chipKITServer.cpp is 2011-10-10. Local netwowk work well, but via inernet across router or NAS the web page always froze, succesfully repair the defect, see code example:

//client.println("HTTP/1.1 200 OK"); client.print("H"); delay(1); client.print("T"); delay(1); client.print("T"); delay(1); client.print("P"); delay(1); client.print("/"); delay(1); client.print("1"); delay(1); client.print("."); delay(1); client.print("1"); delay(1); client.print(" "); delay(1); client.print("2"); delay(1); client.print("0"); delay(1); client.print("0"); delay(1); client.print(" "); delay(1); client.print("O"); delay(1); client.println("K");delay(1);

//client.println("Content-Type: text/html"); client.print("C"); delay(1); client.print("o"); delay(1); client.print("n"); delay(1); client.print("t"); delay(1); client.print("e"); delay(1); client.print("n"); delay(1); client.print("t"); delay(1); client.print("-"); delay(1); client.print("T"); delay(1); client.print("y"); delay(1); client.print("p"); delay(1); client.print("e"); delay(1); client.print(":"); delay(1); client.print(" "); delay(1); client.print("t"); delay(1); client.print("e"); delay(1); client.print("x"); delay(1); client.print("t"); delay(1); client.print("/"); delay(1); client.print("h"); delay(1); client.print("t"); delay(1); client.print("m"); delay(1); client.println("l");delay(1);

So between bytes needs 1ms delay, now the web server with this "correction" working very well, but slow and not too correct, the MX7CK in kliens mode work well no need delay. We can not change and don't know what is the rear problem please help and modify.


Tue, 30 Sep 2014 00:28:10 +0000

This is an inherent problem with the print class. What you are hitting is that print will not return the number of bytes actually transmitted and on a slow network you timeout before the characters are printed. Please use writeStream() and check the return count and loop until the buffer is written.

I only supported print for backwards compatibility, but print is a very bad Arduino class as status is not returned. This will be true for any IO device that uses print and the characters don't get posted, even print will fail with the UART.


Sat, 17 Jan 2015 04:50:25 +0000

I believe the compiler is compiled for 32-bit, not 64-bit. You will need to have the 32-bit support libraries installed.