Stuart Posted September 18, 2013 Share Posted September 18, 2013 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. Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/ Share on other sites More sharing options...
+OLD CS1 Posted September 18, 2013 Share Posted September 18, 2013 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 Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2831768 Share on other sites More sharing options...
Stuart Posted September 18, 2013 Author Share Posted September 18, 2013 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. Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2832053 Share on other sites More sharing options...
+OLD CS1 Posted September 18, 2013 Share Posted September 18, 2013 Pauses in typing. Any time I pause while I am typing the server pounces on me. Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2832067 Share on other sites More sharing options...
lucien2 Posted September 18, 2013 Share Posted September 18, 2013 Did you try with linefeeds only? GET /index.htm HTTP/1.0</0A>Host: www.avjd51.dsl.pipex.com</0A></0A> Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2832103 Share on other sites More sharing options...
Tursi Posted September 18, 2013 Share Posted September 18, 2013 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. Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2832179 Share on other sites More sharing options...
Stuart Posted September 21, 2013 Author Share Posted September 21, 2013 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. 1 Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2833906 Share on other sites More sharing options...
+OLD CS1 Posted September 22, 2013 Share Posted September 22, 2013 Excellent! Quote Link to comment https://forums.atariage.com/topic/216797-any-experts-on-tcpip/#findComment-2834019 Share on other sites More sharing options...
Recommended Posts
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.