Shop OBEX P1 Docs P2 Docs Learn Events
Can't get index.htm from microSD-card. — Parallax Forums

Can't get index.htm from microSD-card.

MoskogMoskog Posts: 554
edited 2012-12-13 13:22 in Accessories
After keeping the Spinneret in a shelf for more then a year I finally took it out and loaded it with Mike G's HTTPServer.spin and index.htm + led.htm on the microSD card. No error messages on the serial terminal, the mount SD card message is also OK.

But the problem is I cant seem to access the index.htm on the micro SD card. I tried several times also with several Formats in between. No index.htm but led.htm is easy to get. No problem turning LED on or off on the Spinneret. Also when accessing the Spinneret through a remote server.

So I wonder, could it be the SD card that doesn't fit? I have no information about the card, only know its 1,8Gb or something, formatted with FAT filesystem of some kind. The files are both in the root directory. No problem when puttiong the card into the computer, both files are shown and accessable. The SD card was taken from a cell-phone and formatted before use in the Spinneret.

Are there special things I should know when getting a microSD card for the Spinneret? Special limitations when used with this server?
Or is the problem related to something in the .spin-code I probably could have misunderstood or not seen?

Comments

  • twctwc Posts: 107
    edited 2012-12-11 09:20
    ...I'm also planning to get an SD card to try the Mike's server code. But I'm not sure what types work with his code (or in general with the popular drivers). Thought I'd seen mention in the past of issues with newer more advanced cards, searched the forums and OBEX a little but didn't see an obvious answer. Notably, according to Wikipedia systems/drivers that work with (older) 'SD' cards might not work with (newer) 'SDHC' cards. I'd asked Mike G. and he said the cards he's using just say 'SD' so I'm going to look for one of those.
  • Mike GMike G Posts: 2,702
    edited 2012-12-11 09:34
    But the problem is I cant seem to access the index.htm on the micro SD card. I tried several times also with several Formats in between. No index.htm but led.htm is easy to get. No problem turning LED on or off on the Spinneret. Also when accessing the Spinneret through a remote server.
    led.htm renders but index.htm does not render? What happens when requesting index.htm? Is there an error?
  • MoskogMoskog Posts: 554
    edited 2012-12-11 10:15
    Hi, Mike G, usually no error message, my Firefox browser is waiting until a timeout occurs.
    led.htm can be seen from outside my network at http://la3usa.com:5000/led.htm too but index is not.

    Now I also have another index.htm on the PINK server at port 80, but I dont think thats a problem, I tried to turn off the PINK and removed it from the ADSL-modem list, put Spinneret at port 80, changed port in .spin code but still could not see the index.htm, only the led-file.
  • Mike GMike G Posts: 2,702
    edited 2012-12-11 10:41
    The Spinneret is responding with HTTP/0.9 200OK. It seems odd that led.htm works but not index.htm.

    Get a clean copy of index.htm and led.htm. Format the SD card. Then copy the files back to the SD card.

    I've had weird issues with the SD driver. Sometimes overwriting an existing file directly on the SD card causes unexpected behavior.
  • MoskogMoskog Posts: 554
    edited 2012-12-11 12:33
    OK, thanks, Mike. I have already tried to format the card a couple of times so that probably won't help. But I think I will try to get another SD card. Do you know if there are special recommendations here or would any kind of cards normally do the job?
  • Mike GMike G Posts: 2,702
    edited 2012-12-11 15:37
    It could be the card but I doubt it. Archive your source, including HTML, and attach. Maybe there is something weird with the HttpServer.spin
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-11 16:27
    Just in case it's relevant: When you access a server with [noparse]http://www.myserver.com:5000[/noparse], it's up to the server to fill in the blanks and determine that what you want is the default index.htm or index.html. The client (i.e. browser) does not make this connection for you by providing a default page name in its request header.

    -Phil
  • MoskogMoskog Posts: 554
    edited 2012-12-13 11:51
    Just in case it's relevant: When you access a server with [noparse]http://www.myserver.com:5000[/noparse], it's up to the server to fill in the blanks and determine that what you want is the default index.htm or index.html. The client (i.e. browser) does not make this connection for you by providing a default page name in its request header.

    -Phil
    I have tried both with and without the index.htm following myserver.com:5000. Doesnt work. I have had the led.htm at the address line, removed the word led, letter by letter and replaced it with index but still no better. It does simply not find that file. I have tried with a different computer with Explorer instead of this one (with Firefox) but with same result.

    And Mike G,
    It could be the card but I doubt it. Archive your source, including HTML, and attach. Maybe there is something weird with the HttpServer.spin

    I have attached the html-files and the HTTPServer.spin with my own settings. I can't seem to figure out if there are anything I have forgotten. The only things I have modified is the spinnerets mac-address, my own subnet mask and the spinnerets local IP-address, and the ADSL-port. The LED on and off works pretty good both from my domestic network and through the remote dyndns-server.

    Hmm. it seems there are problems uploading the .htm-files, I get the message invalid files whatever I try.. The files was made in Notepad and saved as .htm. I post this and then I will try to make the files by using Frontpage and then try them with Spinneret. I'll be back!
  • MoskogMoskog Posts: 554
    edited 2012-12-13 12:20
    No, I made the htm.-files with the MS Frontpage editor but with same result. led is shown but not index.
    And I wasn't able to upload any of them to Parallax' server using Basic Uploader.

    Tried to make a copy of index and saved it as cat.htm, could not find the cat either, hmm
  • Mike GMike G Posts: 2,702
    edited 2012-12-13 12:24
    There's a bug in the Dispatcher method. StaticFileHandler(id) call is within the if(strcomp(Request.GetName(id), string("led"))) block, therefore a response is not sent back for any requests other than led.htm. I verified the source files are correct. Did you happen to download the source with this bug?

    corrected code
    PRI Dispatcher(id)
          ''Do some processing before sending the response
          if(strcomp(Request.GetName(id), string("led")))
            Led(id)
        
          StaticFileHandler(id)
          return
    
  • MoskogMoskog Posts: 554
    edited 2012-12-13 13:22
    Did you happen to download the source with this bug?

    I can't tell for sure if I have downloaded an earlier infected code or if I copy and pasted the PUB from your tutorials and simply made the bug by accident. Been a while since I started look at the Spinneret. But more important: The problem is gone and now everything seems to be OK.
    Thank you so much for beeing so helpful here and know I really do appreciate all the hard work you have done with the Spinneret and for sharing all this with us!
Sign In or Register to comment.