I'm just wondering how many times does the µC can waits inside a while loop before the watchdog of it quits this while loops ?
I'm asking this because i'm streaming a file directly from the SD card and it seems that when the file is bigger than 50kB, the while loop ends !
Is this problem related with the watchdog or do i have to look further in my code for finding my mistake ?
CrossRoads:
Did you do anything to explicitly turn the watchdog on?
Hi,
Errr ... Definitely not !
But i can confirm that when i strem a file from the µSD slot, if the file excess some size, the stream stops by itself on a regular basis.
EDIT : Please forgive me about my question ... I put a timeout earlier in my code for closing connection if there is no activity during 3000ms.
You can hit me if you want/need hahaha
EDIT2 : ERRATUM !!! I think the problem is linked to the SD library.
-> I removed the timeout on my function and it continues to end at the same filesize transmitted.
simkard:
EDIT2 : ERRATUM !!! I think the problem is linked to the SD library.
-> I removed the timeout on my function and it continues to end at the same filesize transmitted.
My function actually looks this code :
while (dataFile.available()){
TEMP_SD_READ_BYTE = dataFile.read();
HTTP_CLIENT.print(TEMP_SD_READ_BYTE);
}
The while loop ends systematicaly and respectively on the same file size for each file i try to download :
a GIF file : 12980 bytes
a JPG file : 20304 bytes
The speed of the connexion is ~5 ko/s.
I'm wondering if the command "dataFile.available()" is not running too fast and not permitting the result to update itself and becoming, at least, more than 1.
EDIT : i tried to add a "delay(1);" at the end, before the while loop ... loops, and then, i have to exact same problem (except that the result takes longer to obtain).
-> I'm definitely thinking there must be some kind of problem with the SD library.
For now i'm working on a HTTP server with far more features than webduino that lacks a lot (for me, at least ;)) of features.
When my code captures the client HTTP REQUEST, it has to answer to it after interpreting the contents.
When this is all done, it gathers the file to serve and send the HTTP HEADERS related to this file (content-length ; content-type; etc ...)
While the code serves the file, it stops @ some random file-size but systematically the same repectively for each file.
The code is exactly the one i provided (for the part where i serves the file).
There is no (upper in the code) while loops or anything that could do some timeout on the request.
So, i don't understand why it is just happening !
I will try to do the same without the whole code for trying the behavior.