Jump to content
IGNORED

Any experts on TCP/IP?


Stuart

Recommended Posts

I'm trying to retrieve a web page using my TMS9900 system connected to a Lantronix UDS-10 serial to Ethernet adaptor. Testing what I'm trying to do using Telnet on the PC first:

 

Telnet 62.24.202.30 80<Return>

GET /index.htm HTTP/1.0<Return>

Host: www.avjd51.dsl.pipex.com<Return><Return>

 

... retrieves the text of the web page I'm after.

 

Trying from my TI system, sending and receiving character strings on the serial port:

 

C62.24.202.30/80</0D> (Make a connection between the Lantronix and the server port 80)

(Wait for the Lantronix to return "C" indicating successful connection)

GET /index.htm HTTP/1.0</0D></0A>

Host: www.avjd51.dsl.pipex.com</0D></0A></0D></0A>

 

... always returns the text of an HTTP 400 Bad Request page. As far as I can see the command is getting to the server OK as it echoes the characters back correctly.

 

Anyone any ideas where the problem lays?

 

Stuart.

Link to comment
Share on other sites

I'm trying to retrieve a web page using my TMS9900 system connected to a Lantronix UDS-10 serial to Ethernet adaptor. Testing what I'm trying to do using Telnet on the PC first:

 

Telnet 62.24.202.30 80<Return>

GET /index.htm HTTP/1.0<Return>

Host: www.avjd51.dsl.pipex.com<Return><Return>

 

... retrieves the text of the web page I'm after.

 

Trying from my TI system, sending and receiving character strings on the serial port:

 

C62.24.202.30/80</0D> (Make a connection between the Lantronix and the server port 80)

(Wait for the Lantronix to return "C" indicating successful connection)

GET /index.htm HTTP/1.0</0D></0A>

Host: www.avjd51.dsl.pipex.com</0D></0A></0D></0A>

 

... always returns the text of an HTTP 400 Bad Request page. As far as I can see the command is getting to the server OK as it echoes the characters back correctly.

 

Anyone any ideas where the problem lays?

 

Stuart.

 

This is not a TCP/IP problem, it is an HTTP problem. The HTTP/1.0 protocol does not support Host: headers, which means that what you are actually asking the server is the deafult site's index.html, which may or may not be replied to. (In fact, you can configure Apache NOT to accept 1.0 requests.) Change the request to HTTP/1.1 and it works fine.

 

Note, however, that you need to send your requests in stream. Typing will probably not work. (I struck above because the problem is not the protocol version, but the stream problem. When I type the request it fails every time. But if I copy and paste it into the telnet session I get your data.)

 

This request returns your index.html:

GET /index.htm HTTP/1.1
Host: www.avjd51.dsl.pipex.com
Link to comment
Share on other sites

Thanks. Are you able to elaborate on what you mean by "send your requests in stream"? I'm sending the GET and Host as two consecutive strings at 19,200 Baud. Conversely, I've managed to download some pages through Telnet by typing the details (some servers time-out quicker than others, but I have managed it, although Telnet may be buffering the input?).

 

I've been trying the HTTP/1.0 protocol to prevent the 'chunked' response of HTTP/1.1, which is more difficult to process.

Link to comment
Share on other sites

Telnet can operate in both character mode and line mode, you can see if the Lantronix can communicate in line mode to avoid issues with character delay. (In my experience telnetting to web servers, line delay hasn't been an issue, but many servers will time out eventually!)

 

The HTTP spec specifies end of line to be CRLF, so it's probably not that.

 

Do you have access to the server logs? Tailing the log while you send the command will probably give you more information than just trying random things.

Link to comment
Share on other sites

Thanks for the suggestions folks. I've done some more poking round and now got it working. The Lantronix has an option for "Telnet mode" where it send a "Terminal Type" message when it makes a connection, and this also set remote echo. Switching this option off, and modding my code to not wait for the remote echo, and it now all works. ;-)

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...