HTTP help please


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1

    Default HTTP help please

    I've downloaded Fred Eady's mini ethernet picbasic code module, but before I get too involved can anyone tell me if it will be possible for me to use it as a small HTTP server ?

    I have a zigbee network of machines, each one outputs about 20 bytes every thirty minutes, which I am storing on the main coordinator. I need to gateway/bridge the stored information onto a small webserver to make it available over the internet.
    Ideally the person viewing the page should get to see the data contained as a set of fields in a file (format unknown just yet) so I suppose I am talking about small dynamic web pages here.

    I don't think huge graphics are required (except maybe a line graph).

    <RANT>
    The backstory to this is that the Lantronix XPORT won't allow me to put data into internal memory for serving onto a web page. The XBEE based Rabbit Semiconductor Zigbee demo kit I bought for this first of all only had Series 1 XBEE modules inside and weren't zigbee compatible. The latest CYAN Technology ethernet/zigbee gateway I bought as a replacement for the Rabbit kit won't actually let you use the SD Card or USB modules while the zigbee network is operational (Despite a big clear picture and description in the datasheet calling it the 'demo configuration'), and so, like the Rabbit kit, that will be getting returned for a refund now too.
    </RANT>

    I just need to squirt a few bytes, infrequently, into a server, where the server will need to act as a buffer either using internal memory or offboard embedded SD card type device (I2C/SPI etc)

    (The reason for not coding the XPORT via the custom firmware devkit is that I don't feel my C programming is up to it, and my PicBasic and ASM is so much better ! IMHO)

    Any ideas ?
    Chris

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Spamming my own thread with an update.

    I now have a Lantronix XPORT with Beta firmware tunneling the HTTP requests directly to it's serial output, connected to USART2 on a pic 18F87J10.

    The pic parses the GET string and gets the files from an SD card (attached to the SPI port) and serves them up, to make a web server.The dynamic nature and variable length data means that the HTTP data is output in chunked format.

    The files on the SD card are a combination of pre-made headers, and some dynamic files comprising data collected from a zigbee network, received via USART1

    Only serving pages at 56k for the time being, until I get the appropriate crystal, but I've finally got my gateway working, which is pleasing :-)

    The ready made HTML pages are made in Frontpage, saved to the root directory on the SD card, along with any images, and the card then plugs into the server.

    I need to include the PUT method now, so that I can upload pages to the SD card, then I've got the full server working !

  3. #3
    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

  4. #4


    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.

  5. #5
    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

  6. #6


    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 :-)

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