Searching \ for '[OT] Simple web server' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=simple+web+server
Search entire site for: 'Simple web server'.

Exact match. Not showing close matches.
PICList Thread
'[OT] Simple web server'
2007\12\17@140319 by Harold Hallikainen

face
flavicon
face
I'm working with a dPac 802.11 wireless module. It has a command where it
will open a telnet port, wait for a connection, then pass data back and
forth with whatever client connects to it. The default port is 8023. The
current IP address for the module is 192.168.1.65 . I can telnet to this
address, port 8023, send data back and forth, disconnect, then connect
again, etc. However, when I try to use a web browser (Firefox) to connect
to http://192.168.1.65:8023 , I RARELY get the http header (GET request,
etc.). Most of the time, the browser doesn't seem to send anything. But,
if I send data back to it, then disconnect, it DOES show up on the
browser.

I haven't been able to figure out what the difference between telnetting
to the server and using a browser to connect to the server is. Someone
here had suggested the http request was being held in a buffer, but I can
see characters show up one by one when I telnet to the device.

Continuing to mess with it, I DID get this:

GET /favicon.ico HTTP/1.1
Host: 192.168.1.65:8023
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7)
Gecko/20070914 Firefox/2.0.0.7
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

Hitting reload, I get "waiting for 192.168.1.65", but no request showing
up at the server. If I then start typing stuff back at the server end,
Firefox changes to "receiving data". When I close the connection (right
now I have a 10 second timeout), the stuff I typed shows up in the browser
window.

So... any ideas on why I am not consistently seeing the GET request? If I
connect with a telnet client, it works every time!

THANKS!

Harold



--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!



2007\12\17@144437 by Herbert Graf

flavicon
face
On Mon, 2007-12-17 at 11:02 -0800, Harold Hallikainen wrote:
> So... any ideas on why I am not consistently seeing the GET request? If I
> connect with a telnet client, it works every time!

Wild stab: there are two types of "end of lines" in this world.
DOS/Windows sends CR/LF, under Unix/Linux only one is sent (don't
remember which...

If the "line collector" in the module is expecting both, but the browser
only sends one, that could be your problem.

Download wireshark (formally Etherreal) and look at the packets being
sent when using Telnet vs. what's being sent by firefox, the difference
should be obvious.

TTYL

2007\12\17@151435 by Neil Cherry

picon face
Herbert Graf wrote:
> On Mon, 2007-12-17 at 11:02 -0800, Harold Hallikainen wrote:
>> So... any ideas on why I am not consistently seeing the GET request? If I
>> connect with a telnet client, it works every time!
>
> Wild stab: there are two types of "end of lines" in this world.
> DOS/Windows sends CR/LF, under Unix/Linux only one is sent (don't
> remember which...

Unix is LF (^J)
Old Mac/VMS CR (^M)
DOS/Windows/IP Networking CR LF (^M^J)

> If the "line collector" in the module is expecting both, but the browser
> only sends one, that could be your problem.

I agree with Herbert's assessment.

--
Linux Home Automation         Neil Cherry       spam_OUTncherryTakeThisOuTspamlinuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2007\12\18@214101 by andrew kelley

picon face
> However, when I try to use a web browser (Firefox) to connect
> to http://192.168.1.65:8023 , I RARELY get the http header (GET request,
> etc.). Most of the time, the browser doesn't seem to send anything. But,
> if I send data back to it, then disconnect, it DOES show up on the
> browser.

What does your reply look like to the browser?  If you don't send
content-type and content-length, it will wait until the connection is
dropped to display the page.

> So... any ideas on why I am not consistently seeing the GET request? If I
> connect with a telnet client, it works every time!

Perhaps try flushing the receive buffer before accepting perhaps?

--
Andrew

2007\12\18@225153 by Harold Hallikainen

face
flavicon
face

>> However, when I try to use a web browser (Firefox) to connect
>> to http://192.168.1.65:8023 , I RARELY get the http header (GET request,
>> etc.). Most of the time, the browser doesn't seem to send anything. But,
>> if I send data back to it, then disconnect, it DOES show up on the
>> browser.
>
> What does your reply look like to the browser?  If you don't send
> content-type and content-length, it will wait until the connection is
> dropped to display the page.
>

Thanks for the comments! I'm not sure what I did, but got it working.
Every now and then the request from the browser either doesn't show up, or
gets cut off in the middle. I'm dumping received data out to a terminal so
I can watch what's going on. I think I've just got something wrong with
the radio module, perhaps with the SPI timing. I'm trying to get a timing
diagram out of the manufacturer as to what the SPI is supposed to look
like.

Thus far I am not including content length and, as you point out, the page
is not rendered by the browser until the connection is dropped. I'll try
adding content length tomorrow. The page I'm sending is plain old html. I
assume the length is a decimal count of bytes after the end of the header
(after the \r\n\r\n).

Thanks!

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2007\12\22@072619 by Peter P.

picon face
Harold Hallikainen <harold <at> hallikainen.org> writes:
> Thus far I am not including content length and, as you point out, the page
> is not rendered by the browser until the connection is dropped. I'll try
> adding content length tomorrow. The page I'm sending is plain old html. I
> assume the length is a decimal count of bytes after the end of the header
> (after the \r\n\r\n).

If the browser is IE pad the sent page with spaces or whatnot to >512 bytes
before sending it. Afaik it's a well known IE bug.

Peter P.


2007\12\23@013547 by Harold Hallikainen

face
flavicon
face

> Harold Hallikainen <harold <at> hallikainen.org> writes:
>> Thus far I am not including content length and, as you point out, the
>> page
>> is not rendered by the browser until the connection is dropped. I'll try
>> adding content length tomorrow. The page I'm sending is plain old html.
>> I
>> assume the length is a decimal count of bytes after the end of the
>> header
>> (after the \r\n\r\n).
>
> If the browser is IE pad the sent page with spaces or whatnot to >512
> bytes
> before sending it. Afaik it's a well known IE bug.
>
> Peter P.
>

Thanks! I've generally been using Firefox for my testing. The problem is
the request Firefox sends out either does not show up at all at the
wireless module, or shows up partially. Later, the remainder of it shows
up if I do a page reload. I think it's an issue in the radio module and am
trying to get something out of the manufacturer on it.

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...