Page 1 of 2
Web Site works from SD, not from module flash
Posted: Thu Sep 16, 2010 12:52 pm
by khoney
I have a working web site running on my SD card, and I tried to move it into module flash memory by importing the folder structure into the html folder of my project. I have an index.htm file, and subfolders called js, css, and image containing the respective file types. When I build the program and try to access the site, i get error 404 saying index.htm is not found on the server. I tried simplifying things by just putting a 'hello world' index.htm file in the html folder, and I get the same error.
I can see that the htmldata.cpp and .o files are being created in my Release folder, so I don't understand what the problem is? I thought the system automatically looked in the module flash memory if no file was found on the SD card?
Re: Web Site works from SD, not from module flash
Posted: Tue Sep 21, 2010 6:19 am
by khoney
No help here? Is there some setup in the IDE that I'm missing, or is there something special that needs to be done in the firmware?
Has anyone tried embedding an SD-card based website into module flash? The only reason I want to do this is it makes firmware updates easier, i.e. I can send one file via multi-part form from my web site. If anyone has suggestions about how to easily update a system with both module firmware and SD-card web site, I'm all ears

Re: Web Site works from SD, not from module flash
Posted: Tue Sep 21, 2010 9:37 am
by rnixon
I don't think you are getting a reply because the question you are asking doesn't show that you tried to narrow things down, run examples, etc. The problem could be one of dozens of things, and who wants to write all that down? Can you select an example, run it, and look for differences between it and your code? Thats what I always do if I try something new in my own app and it doesn't work. If you have a problem with an example it will be easier to discuss it and help you.
For updating both your app and sd card, you could use ftp. There are examples of both of those. The problem with multiform posts is that you need to statically allocate enough memory for the largest file, which can be wasteful.
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 6:53 am
by khoney
I might consider FTP if there weren't firewall issues. My corporate network is blocking communications from the device. I can access the main folder via
ftp://ip address, but I am unable to establish the ftp session to download/upload files. I would expect other corporate sites to have similar restrictions.
I thought I did make things simple by just having a single index.htm file built into the app. I guess I just wanted verification that the Netburner software will indeed automatically get this file from flash if the SD card is inaccessible or the file is not found. I am using long filenames on the SD - maybe this is incompatible with the flash module access?
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 9:28 am
by rnixon
There is no automatic method I know of. If you want to have your site in internal flash, the easiest way is to compile it in. If you want to use the file system so it can be updated, you need to modify the get handler so it looks in the right place (ie. on-chip file system).
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 11:25 am
by khoney
To quote the Netburner EFFS-Programmer's Guide...
"When HTML files exist on both the module flash memory and the external flash card memory, the web server will look at the external flash card first, then look to internal flash. For example, if you have an index.htm file located in both internal flash and in the external flash card, then the index.htm from the external flash card will be loaded."
Unless I'm misinterpreting it, it sounds to me like it's supposed to be automatic. Thus my confusion...
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 11:35 am
by khoney
Your advice to look at the examples was spot on... There is a section of code in the get handler that handles the internal/external decision-making. I thought I had used that example as my base code, but apparently I did not - either that, or I stripped out the necessary code. Sure wish my memory was better...
Thanks for the advice. When I looked at the programmer's manual and read the quoted paragraph, I incorrectly assumed that application code was not necessary. And actually, it's probably not if you used the default get handler...
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 12:26 pm
by rnixon
The default get handler will only work with compiled-in html files. In the example all the references to "internal flash" mean compiled-in html, which does not use the on-chip file system. It seems like you should be able to change the example code so that the file system usage is switched from external sd-card to internal on-chip file system access. Or, you could even do all 3, just establish a precedence of compiled-in, then on-chip file system, then external file system.
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 12:28 pm
by rnixon
Thinking some more about my last comments, I would go for just one file system, not two. Not sure if you can do both the sd-card and on-chip files systems at that same time, and even if you can, too much overhead and complexity.
Re: Web Site works from SD, not from module flash
Posted: Thu Sep 30, 2010 12:38 pm
by khoney
If I can fit my entire web site into the compiled-in code, I'll probably try to do that to make firmware updates easier. If not, I'll use the compiled-in code to tell the user the web site could not be found on the SD card (it is removable).
This has been fun. BTW, I highly recommend jQuery, jQueryUI, and Allan Jardine's DataTables plug-in for web development/tools. For my particular app, DataTables was a godsend.