HTTP SD Card File Server

Dependencies:   SDFileSystem WIZnetInterface mbed

Fork of HTTP_SD_Server_K64F by FRDM-K64F Code Share

Prerequisite

This Program is the example how to show SD card file list with web-browser for WIZwiki-W7500.

To implement this function, you need a Platform board, network Interface board and SD card. Below are what we used.

  • WIZwiki-W7500 from WIZnet (Platform board and Ethernet I/F board)
  • SD card

Hardware Configuration

WIZwiki-W7500 Pin map

pin map

Software

SPI Initialization

main.cpp

SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "sd");

Refer to ....

Files at this revision

API Documentation at this revision

Comitter:
gsteiert
Date:
Sun Apr 12 03:04:28 2015 +0000
Parent:
6:ca17ce165ebc
Child:
8:4b43259a1e33
Commit message:
Updated libraries. Seems to be more stable.

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Thu Aug 07 03:32:26 2014 +0000
+++ b/EthernetInterface.lib	Sun Apr 12 03:04:28 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#f69b81aa9eb1
+http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
--- a/main.cpp	Thu Aug 07 03:32:26 2014 +0000
+++ b/main.cpp	Sun Apr 12 03:04:28 2015 +0000
@@ -66,17 +66,22 @@
         sprintf(fileName, "/sd%s", uri);
         fp = fopen(fileName, "r");
         if (fp == NULL) {
+            uart.printf("File not found\n");
             sprintf(httpHeader,"HTTP/1.1 404 Not Found \r\nContent-Type: text\r\nConnection: Close\r\n\r\n");
             client.send(httpHeader,strlen(httpHeader));
             client.send(uri,strlen(uri));
         } else {
+            uart.printf("Sending: header");
             sprintf(httpHeader,"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: Close\r\n\r\n");
             client.send(httpHeader,strlen(httpHeader));
+            uart.printf(" file");
             while ((rdCnt = fread(buffer, sizeof( char ), 1024, fp)) == 1024) {
                 client.send(buffer, rdCnt);
+                uart.printf(".");
             }
             client.send(buffer, rdCnt);
             fclose(fp);
+            uart.printf("done\n");
         }
     }
 }
--- a/mbed-rtos.lib	Thu Aug 07 03:32:26 2014 +0000
+++ b/mbed-rtos.lib	Sun Apr 12 03:04:28 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#34e80e862021
+http://mbed.org/users/mbed_official/code/mbed-rtos/#83895f30f8f2
--- a/mbed.bld	Thu Aug 07 03:32:26 2014 +0000
+++ b/mbed.bld	Sun Apr 12 03:04:28 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/6213f644d804
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file