This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions,
flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.
Strange Behavior from RabbitWeb - "mdiaz.tello" - Jun 3 16:54:15 2009
So I wrote a simple web page using purely HTML and CSS, and I tested it using Google
Chrome, Firefox, and IE 8. I hosted this web page using a free webserver on my network and
I debugged it till it worked just fine there. Then I loaded it onto the rabbit, but now
the same web pages being served by the Rabbit seem to be super quirky. For example, when I
visit the web page using Firefox, none of the CSS stuff shows up at all. All I see is a
pure white page with some text and links (there is also a logo image on the page that only
seems to display when the planets align). When I try looking at the page in an older
version of Chrome, the page loads and works as intended immediately. When I try a newer
version of Chrome, I get the same deal as before with Firefox, except the logo loads more
often. In IE 8 and IE 7, the page loads in all white, but if you click a link and then go
back to the first page, it then renders the whole page properly! Furthermore, if you close
IE8/7 and reopen the page, you end up having to do the same dance all over again!
I don't understand why this is happening. I would think perhaps the problem is that the
rabbit is not serving the pages fast enough, but I see no evidence that the page is still
loading: no matter how long I leave the page to load, the page rendering stays all white
(IE/Chrome/Firefox).
I would think perhaps something was wrong with the DC code and web pages that I had to
load onto the rabbit except for the fact that sometimes IE8/7 seem to render the page
properly. Does anyone know what the problem could be?
--MDiaz-Tello
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )
Re: Strange Behavior from RabbitWeb - Tom Collins - Jun 5 18:36:31 2009
On Jun 3, 2009, at 9:42 AM, mdiaz.tello wrote:
> I would think perhaps something was wrong with the DC code and web
> pages that I had to load onto the rabbit except for the fact that
> sometimes IE8/7 seem to render the page properly. Does anyone know
> what the problem could be?
Make sure you've included the following line in your program, after
calling http_init():
tcp_reserveport(80);
And check the activity window for your browser -- that could tell you
where the failure is. Without the call to tcp_reserveport, the
browser will try (and fail) to make multiple, simultaneous
connections to the Rabbit to download the files necessary to display
the page.
With the call, the Rabbit will queue up those requests so the browser
can download all of the files.
-Tom
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )Re: Strange Behavior from RabbitWeb - allsoft01a - Jun 5 18:53:25 2009
There was an issue a while back with the default HTTP_MAXBUFFER not being large enough.
(At least I had the problem with DC 9.25) I was having weird issues with web pages. I
think it had to do with Windows Vista.
I increased the HTTP_MAXBUFFER to 384 and it solved the problem.
Add:
#define HTTP_MAXBUFFER 384
to the top of your program, before the #use http.lib
--- In r...@yahoogroups.com, "mdiaz.tello"
wrote:
>
> So I wrote a simple web page using purely HTML and CSS, and I tested it using Google
Chrome, Firefox, and IE 8. I hosted this web page using a free webserver on my network and
I debugged it till it worked just fine there. Then I loaded it onto the rabbit, but now
the same web pages being served by the Rabbit seem to be super quirky. For example, when I
visit the web page using Firefox, none of the CSS stuff shows up at all. All I see is a
pure white page with some text and links (there is also a logo image on the page that only
seems to display when the planets align). When I try looking at the page in an older
version of Chrome, the page loads and works as intended immediately. When I try a newer
version of Chrome, I get the same deal as before with Firefox, except the logo loads more
often. In IE 8 and IE 7, the page loads in all white, but if you click a link and then go
back to the first page, it then renders the whole page properly! Furthermore, if you close
IE8/7 and reopen the page, you end up having to do the same dance all over again!
>
> I don't understand why this is happening. I would think perhaps the problem is that the
rabbit is not serving the pages fast enough, but I see no evidence that the page is still
loading: no matter how long I leave the page to load, the page rendering stays all white
(IE/Chrome/Firefox).
>
> I would think perhaps something was wrong with the DC code and web pages that I had to
load onto the rabbit except for the fact that sometimes IE8/7 seem to render the page
properly. Does anyone know what the problem could be?
>
> --MDiaz-Tello
>
------------------------------------

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )Re: Strange Behavior from RabbitWeb - "mdiaz.tello" - Jun 8 15:21:19 2009
Thanks for the replies. I did try both suggestions, and I was met with some degree of
success. When I did the tcp_reserveport(80), IE8 seemed to load the page just fine on the
first try, which is good. However, firefox and chrome would still only display the actual
text and would not do any of the CSS styling (despite the fact that IE did the CSS styling
like it was supposed to). I tried increasing that buffer size as the other poster
mentioned, but nothing happened. I also tried looking for an "activity window" in each of
those browsers, but they don't seem to come with that tool. So, after a bit of searching,
I found an extension for firefox that did this "activity window" function. After using it,
it looks like when firefox loads the page, it is in fact retrieving all the parts
(including the CSS file), but it still does not render properly. So, I loaded up my apache
webserver on my workstation and hosted the same pages from there, and the page renders
flawlessly (Even the exact same activity window entries show up wether I am serving the
page from my workstation or the rabbit). This has me stumped. I really don't understand
why it would work in IE and not chrome or Firefox.
Another thing to mention, I looked through a couple of the other sample HTTP programs
(such as BROWSELED.C) to see if I was missing any important initialization calls, but the
program that I wrote for my Rabbit seems to have all the right stuff.
Your help is much appreciated.
-MDiaz-Tello
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )Re: Re: Strange Behavior from RabbitWeb - Scott Henion - Jun 8 15:49:49 2009
mdiaz.tello wrote:
> Thanks for the replies. I did try both suggestions, and I was met with some degree of
success. When I did the tcp_reserveport(80), IE8 seemed to load the page just fine on the
first try, which is good. However, firefox and chrome would still only display the actual
text and would not do any of the CSS styling (despite the fact that IE did the CSS styling
like it was supposed to). I tried increasing that buffer size as the other poster
mentioned, but nothing happened. I also tried looking for an "activity window" in each of
those browsers, but they don't seem to come with that tool. So, after a bit of searching,
I found an extension for firefox that did this "activity window" function. After using it,
it looks like when firefox loads the page, it is in fact retrieving all the parts
(including the CSS file), but it still does not render properly. So, I loaded up my apache
webserver on my workstation and hosted the same pages from there, and the page renders
flawlessly (Even the exact same activity window entries show up wether I am serving the
page from my workstation or the rabbit). This has me stumped. I really don't understand
why it would work in IE and not chrome or Firefox.
>
> Another thing to mention, I looked through a couple of the other sample HTTP programs
(such as BROWSELED.C) to see if I was missing any important initialization calls, but the
program that I wrote for my Rabbit seems to have all the right stuff.
>
> Your help is much appreciated.
>
Try adding:
#define HTTP_MAXSERVERS 5
to the top of your program.
--
------------------------------------------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------------------------------------------
today's fortune
Microsoft is not the answer.
Microsoft is the question.
Linux is the answer.

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )
Re: Strange Behavior from RabbitWeb - "mdiaz.tello" - Jun 8 16:18:50 2009
Re: Strange Behavior from RabbitWeb - "mdiaz.tello" - Jun 8 16:30:25 2009
I believe I may have found the problem:
At the top of the dynamic C program, you have to set up a MIME table that reads more or
less as follows:
SSPEC_MIMETABLE_START
SSPEC_MIME_FUNC(".shtml","text/html", shtml_handler),
SSPEC_MIME(".html", "text/html")
SSPEC_MIMETABLE_END
As it turns out, I needed to add a line that says "SSPEC_MIME(".css", "text/css")" to the
MIME table. I suppose I should have seen this before, but I guess when the Rabbit would
upload the CSS page to firefox and chrome, perhaps the extension of the file had been lost
because the rabbit didn't know what kind of file it was (due to there being no MIME type)
and therefore they refused to interpret the code inside. This is as opposed to IE8/7 where
everything was rendered anyways. In any case, I will continue plugging away at this
project and correcting the other problems I have, and I will continue to post here as
problems arise.
I hope this solution is of use to others in the future.
--MDiaz-Tello
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )Re: Re: Strange Behavior from RabbitWeb - Scott Henion - Jun 8 16:33:33 2009
mdiaz.tello wrote:
> Nothing seemed to happen when I did that: Firefox and Chrome still rendered the page
without CSS. Is that change just restricting the max number of connections the browser can
attempt to establish?
>
>
Yes, FF does multiple connections at once. The default setiing for the
DC lib is two.
That usually gets it going better. I find it is faster with TCP_BUF_SIZE
set to 8192.
Setting ETH_MTU to 1500 helps also.
--
------------------------------------------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------------------------------------------
today's fortune
Woman on Street: Sir, you are drunk; very, very drunk.
Winston Churchill: Madame, you are ugly; very, very ugly.
I shall be sober in the morning.
------------------------------------

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )
Re: Strange Behavior from RabbitWeb - "mdiaz.tello" - Jun 10 14:56:50 2009
So it turns out that this solution you gave me to change the MAX_BUFFER to 384 (which I
did) most likely solved a problem that I hadn't run into yet. It seems that the ACCEPT
field that IE8/7 transmits in its HTTP GET request is too long for the Rabbit. This
appears in wireshark as a truncated field, and most likely the Rabbit has no idea what to
do with the truncated field and simply rejects the request. It is funny that I ran into
this problem later while trying to set up the Softools version of the HTTP server. You may
have given me the answer to my problem with the Softools HTTP server before I even knew I
had that problem. I am going to try adjusting this field and see if that will fix my
problem. Thanks so much, allsoft01a!
--MDiaz-Tello
------------------------------------

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )