Home/Support/Support Forum/Partial tables from RabbitWeb
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Partial tables from RabbitWeb

0 votes
I am using a Rabbit for temperature & humidity data logging and have tables of several hundred measurements (date, time, temp, humidity) accessed via HTTP and a browser. Sometimes the tables are displayed and sometimes they are partially displayed and the browser displays "Waiting for WW.XX.YY.ZZ" followed by "This page can't be displayed".
I can make the tables smaller, but I would rather not. Waiting for the table to be completed is not a problem. Looking for other solutions.
The http handler is in a loop with a costate section that does the data processing.
while (1) { http_handler(); costate { waitfor(DelayMs(20000)); data processing } }
asked Feb 26, 2016 in Rabbit Software by bflusche New to the Community (3 points)

Please log in or register to answer this question.

2 Answers

0 votes
I think that the http_handler() should be inside of its own costate block, along with a "yield;" to allow execution of the other block.
answered Feb 29, 2016 by TomCollins Veteran of the Digi Community (2,382 points)
Thanks.  I did some more testing and it isn't specific to costate.  See my update.
0 votes
I have tried some experiements, like removing the costate and using a simple if statement to process data every 20 seconds. I also added an elapsed time printf and I found
that it takes multiple calls to the http_handler() function to transfer the table, ~ 20 or so. Each call lasts from ~30mS to ~180mSec.

1. Using the code below, I get the elapsed time of each handler call, but the browser freezes before the complete table is sent.
2. If I comment out the if & printf statement then I get all the table transferred.
while (1) { t0 = MS_TIMER; http_handler(); delta = MS_TIMER - t0; if (delta > 10l) printf("\nhttp: %ul", delta); }
answered Mar 7, 2016 by bflusche New to the Community (3 points)
edited Mar 6, 2016 by bflusche
It sounds like the data processing you do every 20 seconds might stall the HTTP server enough to break the connection.  Is this while the debugger is running, or with STDIO redirected to a serial port?

Note that you should use the "%lu" format specifier for an unsigned long.  The print works correctly because you're just printing the lower 16 bits of "delta".

I'm also wondering about buffer allocation what happens if you increase the value used for MAX_TCP_SOCKET_BUFFERS ?

How complex is your zhtml?  Can you reduce the number of tags to simplify processing?