Problem: Running webserver with files from SD-Card

02 Feb 2012

I want to write the HTML-Files for the Webserver to an SD-Card. When I try to get a page from the root-dir the mbed stopped working (no blinky lights).

I tried this (code snipped):

#include "SDHCFileSystem.h"
#include "EthernetNetIf.h"
#include "HTTPServer.h"


EthernetNetIf eth;
HTTPServer svr;
SDFileSystem sd(p5, p6, p7, p26, "sd");
[...]

    // Initialise ethernet
    EthernetErr ethErr = eth.setup();
    eth_present=1;
    if (ethErr) {
        printf("Error %d in setup.\n", ethErr);
        lcd.printf("Network error\n");
        eth_present=0;
    }

    FSHandler::mount("/webfs", "/sd"); //Mount /webfs path on /files web path  <-------- is this correct?
    FSHandler::mount("/webfs", "/"); //Mount /webfs path on web root path

    svr.addHandler<FSHandler>("/sd");
    svr.addHandler<FSHandler>("/"); //Default handler

    svr.bind(80);
  
    while (1) {
       Net::poll();
    }
09 Feb 2012

no suggestions?

26 Feb 2012

I have same problem, but I can create new files, list directory (debug print to console). But FSHandler is not working with SD card mount fails or something... ?