HTTP help please


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I'm interested in your project, and would like to see your code when you get it completed. I'm using an XPORT as well, and with custom code which allows me to do SNMP.
    Charles Linquist

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    I'm interested in your project, and would like to see your code when you get it completed. I'm using an XPORT as well, and with custom code which allows me to do SNMP.

    Charles, the firmware in the XPORT may be the same firmware yoiu have. I am told it allows SNMP, but because I don't need to use it (can't think of anything 'creative' to do with it ?) I have not yet looked at it.

    The XPORT tunneling of HTTP on port 80 produces headers like....

    Code:
    GET /index.htm HTTP/1.1                       
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shock                                                                                
    wave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application                                                                                
    /msword, */*            
    Accept-Language: en-gb                      
    Accept-Encoding: gzip, deflate                              
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0                                                                                
    .50727; .NET CLR 1.1.4322)                          
    Host: 192.168.0.9                 
    Connection: Keep-Alive

    ....Which is useful because at last you can write your own pages without needing to store them on the COBOX, and that means that _dynamic_ pages with variable sized data fields can be used.

    I'm just using plain HTML right now but I've tried some Java objects and they seem to work fine.

    The only downside is that because I'm using SDFS which doesn't seem to support directories, all of my webpages are stored in the root directory.


    I'm just going to take a break but I'll leave the server running for you for the next hour or two. Not much to see but one page is
    http://92.8.106.11/MACMON01.htm
    and another is
    http://92.8.106.11/INDEX.HTM

    There's also an image on the SD card http://92.8.106.11/PICTURE.GIF

    Those pages are coming live from an SD card. They are complete files and the images are served correctly by subsequent GET methods (I didn't think the code would deal with that situation properly but to my pleasant surprise it does !)



    With the exception of the 'index.htm' file, ALL filenames are
    [8-characters] . [3-characters] , all in uppercase.

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Impressive! I have a need for something like this. Collaboration?
    Charles Linquist

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    Impressive! I have a need for something like this. Collaboration?
    Sure !
    I'm happy to hear what you're proposing :-)

  5. #5
    Join Date
    Apr 2008
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Ethernet Mini

    I am curious if any of you are still working on Ethernet Mini or not. I would like to make a small HTTP server. I am new on this. I would like to see your code or picture of your project.

    Reid

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Reid View Post
    I am curious if any of you are still working on Ethernet Mini or not. I would like to make a small HTTP server. I am new on this. I would like to see your code or picture of your project.

    Reid
    Reid,
    I used a Lantronix Xport-03, which has the ability to do port redirection between the ethernet socket and the two wire serial interface. This means that you can attach a pic to the serial port of the Xport and read the actual HTTP requests for files as they arrive, and in my case i responded by serving the suitable file from an SD memory card.

    I would recommedn that you look at the relevant RFC documentation covering things like HTTP, TFTP and FTP etc, because you will be working with it at a very low level if yoiu decide to go down this route.

    you would also need a fast method for serving files, which in my case consisted of reading a block of 512 bytes from the SD Card into a buffer on the pic and then using Hserout to transmit the buffer's contents to the serial port of the Xport. The actual etehernet side of things is dealt with for you by the Xport The SD Card used 2 wire SPI mode, which actually seemed quite slow in the end, especially when serving images >20kB in size and I would have preffered to use the 4 wire mode. But I got the SD software (SDFS) for free and mustn't complain.

    If you take a step back from what you are trying to achieve, you really are only moving large chunks of data between devices. The remote web server 'knows' what to do with the file it requested, yoiu simply need to send it when requested. Unless, you want to start serving live data. I ended up serving live data via an HTML file which is created only once, at the time the request for the data is made, and the usual HTML tags are inserted one by one as part of a loop. This probably also led to the program being slower than I would have liked.

    There are a lot of options available now for bridging a pic to the internet and I think yoiur best source of info is going to be the datasheets from the devices themselves. As well as the Xport, there is also something called a 'WebLynx' which seems to be similar although I am not sure if they are doing port redirection with that device yet.

    Chris

  7. #7
    Join Date
    Apr 2008
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Ethernet Mini

    Chris,

    Maybe I did not make myself clear. At first I would like to use webpage that go into ethernet Mini to look up something on it. just like a router 192.168.01What I would like to make a simple task. I would like make port A0-A4, B0-B4 ,C0-C4, D0-D4 to turn it on (high) or off ( low) or read those port the value. I hope myself clear. I am not sure if we called it as web server or just remote the hub. I was hope someone has done this. I would like to see sample codes.

    Reid

Similar Threads

  1. xport code, have example, confused though
    By kenpo in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 30th March 2009, 19:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts