HTTP_SDCard_File_Server_WIZwiki-W7500 avec gestion des extensions MIME

Dependencies:   SDFileSystem WIZnetInterface mbed STATIC_COLORS

Fork of HTTP_SDCard_File_Server_WIZwiki-W7500 by WIZnet

WIZnet WIZwiki-W7500

/media/uploads/Fo170/wizwiki-w7500_usb_connected.jpg

/media/uploads/Fo170/wiznet_logo_110x37.png http://www.wiznet.co.kr/product-item/w7500/

Windows serial configuration https://developer.mbed.org/handbook/Windows-serial-configuration https://developer.mbed.org/media/downloads/drivers/mbedWinSerial_16466.exe

How to write the firmware into WIZwiki-W7500 https://developer.mbed.org/teams/WIZnet/wiki/How-to-write-the-firmware-into-WIZwiki-W

Data Output using Serial Port https://blog.wiznettechnology.com/2015/08/14/wiznet-wizwiki-w7500-tutorial-exercise-2-data-output-using-serial-port/ http://wizwiki.net/wiki/doku.php?id=products:w7500:peripherals:uart

SDFileSystem Instanciation

SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "sd"); WIZwiki-W7500

/media/uploads/Fo170/wizwiki_w7500_spi_sch.png

Ethernet Initialization

eth.init () uses the eth.init (MAC) If you use DHCP instead, and when using a Static IP uses eth.init ((uint8_t *) MAC, IP, MASK, GATEWAY). This section uses a static IP.

  1. define MAC "\x\x\x\x\x\x" Should be Replaced with your MAC
  2. define IP "192.168.77.100" Should belong with your lan.
  3. define MASK "255.255.255.0"
  4. define GATEWAY "192.168.77.1"

eth.init((uint8_t*)MAC); Use DHCP for WIZnetInterface eth.init((uint8_t*)MAC,IP,MASK,GATEWAY); IP,mask,Gateway

Also watch its pages, the initial contributor to the project For Import the example https://developer.mbed.org/teams/WIZnet/code/HTTP_SDCard_File_Server_WIZwiki-W7500/

Wiki on ARMmbed https://developer.mbed.org/teams/WIZnet/code/HTTP_SDCard_File_Server_WIZwiki-W7500/wiki/HTTP_SDCard_File_Server_WIZwiki-W7500

/media/uploads/Fo170/wp_20160508_008.jpg

WIZwiki_W7500 LED RGB :

/media/uploads/Fo170/wizwiki_w7500_led_rgb.png

LED1 = LED_RED = LEDR = PC_8

LED2 = LED_GREEN = LEDG = PC_9

LED3 = LED_BLUE = LEDB = PC_5

LED4 = LED_BLUE

Files at this revision

API Documentation at this revision

Comitter:
MidnightCow
Date:
Fri Jun 26 01:17:43 2015 +0000
Parent:
7:04744a9ce2b9
Child:
9:d0615c97295e
Commit message:
Web Browsing a file list in SD card of WIZwiki-W7500.
; 1st Released

Changed in this revision

EthernetInterface.lib Show diff for this revision Revisions of this file
WIZnetInterface.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 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	Sun Apr 12 03:04:28 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WIZnetInterface.lib	Fri Jun 26 01:17:43 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/WIZnet/code/WIZnetInterface/#c830d2e7e0f5
--- a/main.cpp	Sun Apr 12 03:04:28 2015 +0000
+++ b/main.cpp	Fri Jun 26 01:17:43 2015 +0000
@@ -4,6 +4,12 @@
 #include <stdio.h>
 #include <string.h>
 
+
+#define MAC     "\x00\x08\xDC\x11\x34\x78"
+#define IP      "192.168.77.100"
+#define MASK    "255.255.255.0"
+#define GATEWAY "192.168.77.1"
+
 #define HTTPD_SERVER_PORT   80
 #define HTTPD_MAX_REQ_LENGTH   1023
 #define HTTPD_MAX_HDR_LENGTH   255
@@ -14,7 +20,8 @@
 
 //SDFileSystem sd(p5, p6, p7, p8, "sd"); // LPC1768 MBD2PMD
 //SDFileSystem sd(P0_18, P0_17, P0_15, P0_16, "sd"); // Seeeduino Arch Pro SPI2SD
-SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); // K64F
+//SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); // K64F
+SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "sd"); // WIZwiki-W7500 
 
 EthernetInterface eth;
 TCPSocketServer server;
@@ -31,6 +38,18 @@
 FILE *fp;
 int rdCnt;
 
+DigitalOut led1(LED1); //server listning status
+DigitalOut led2(LED2); //socket connecting status
+
+Ticker ledTick;
+
+void ledTickfunc()
+{
+    led1 = !led1;
+}
+
+
+
 void get_file(char* uri)
 {
     uart.printf("get_file %s\n", uri);
@@ -88,6 +107,7 @@
 
 int main (void)
 {
+    ledTick.attach(&ledTickfunc,0.5);
 //    Serial Interface eth;
     uart.baud(115200);
     uart.printf("Initializing\n");
@@ -103,7 +123,8 @@
 
 //    EthernetInterface eth;
     uart.printf("Initializing Ethernet\n");
-    eth.init(); //Use DHCP
+    //eth.init(); //Use DHCP
+    eth.init((uint8_t*)MAC,IP,MASK,GATEWAY);  //IP,mask,Gateway
     uart.printf("Connecting\n");
     eth.connect();
     uart.printf("IP Address is %s\n", eth.getIPAddress());
@@ -120,6 +141,7 @@
 
         uart.printf("Connection from: %s\r\n", client.get_address());
         while (true) {
+            led2 = true;
             int n = client.receive(buffer, sizeof(buffer));
             if (n <= 0) break;
             uart.printf("Recieved Data: %d\r\n\r\n%.*s\r\n",n,n,buffer);
@@ -144,7 +166,7 @@
                 }
             }
         }
-
+        led2 = false;
         client.close();
     }
 }
--- a/mbed-rtos.lib	Sun Apr 12 03:04:28 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#83895f30f8f2
--- a/mbed.bld	Sun Apr 12 03:04:28 2015 +0000
+++ b/mbed.bld	Fri Jun 26 01:17:43 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7
\ No newline at end of file