In this example, the image data acquired from the camera is stored on the Micro SD card and displayed through a web browser.

Dependencies:   Ethernet_Camera_LS_Y201_SDcard SDFileSystem WIZnetInterface mbed

Fork of HTTP_SDcard_file_server_WIZwiki-W7500 by justin kim

Prerequisite

In this example, the image data acquired from the camera is stored on the Micro SD card and displayed through a web browser.

To implement this function, you need a Platform board, network Interface board, camera module.

This example uses LS-Y201 Camera module.

  • WIZwiki-W7500 from WIZnet (Platform board and Ethernet I/F board)
  • LS-Y201 (Camera module)
  • Micro SD Card

Hardware Configuration

/media/uploads/Ricky_Kwon/camera_ls-y201.png

  • connect Ethernet Cable & USB Cable
  • connect Camera module

Software

Init network information

#define IP      "192.168.0.100"
#define MASK    "255.255.255.0"
#define GATEWAY "192.168.0.1"
#define PORT    80

Caution

Must fix network information

Files at this revision

API Documentation at this revision

Comitter:
justinkim
Date:
Tue Jun 23 03:44:18 2015 +0000
Parent:
0:fbb29d9ea96b
Child:
2:f2d70f552a3e
Commit message:
HTTP_SDcard_file_server example for WIZwiki-W7500

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 07 11:23:03 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#9b2d10dc0392
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WIZnetInterface.lib	Tue Jun 23 03:44:18 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/WIZnet/code/WIZnetInterface/#24a9f2df2145
--- a/main.cpp	Sun Apr 07 11:23:03 2013 +0000
+++ b/main.cpp	Tue Jun 23 03:44:18 2015 +0000
@@ -5,13 +5,13 @@
 #define EnDebugMSG  false //true-> print debug message to PC USB terminal, false->not print
 #include "filelib.h"
 
-#define IP      "192.168.100.100"
+#define IP      "192.168.240.100"
 #define MASK    "255.255.255.0"
-#define GATEWAY "192.168.100.1"
+#define GATEWAY "192.168.240.1"
 #define PORT    80
 
 Serial pc (USBTX,USBRX);    // tx, rx
-SDFileSystem sd(p5, p6, p7, p8, "wfs"); // the pinout on the mbed
+SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "wfs"); // the pinout on the mbed
 
 char sMethod[7];
 char sURL[250];
@@ -67,7 +67,7 @@
         printf(sentBuffer);
         printf("\n--end Header-- bytes:%d",strlen(sentBuffer));
     }
-    Thread::wait(200);  //200ms important for browser!
+    wait(0.2);  //200ms important for browser!
 }
 
 void send_HTML_line(char* line, unsigned int length_line)
@@ -75,7 +75,7 @@
     client.send_all(line,length_line);
     if (EnDebugMSG)
         printf("\n-->send HTML line:\n%s ...Ok!",line);
-    Thread::wait(10);
+    wait(0.01);
 }
 
 void send_HTML_error( int status_code, char* title, char* body_text)
@@ -301,12 +301,12 @@
 int main()
 {
 
-
+    uint8_t MAC_Addr[6] = {0x00, 0x08, 0xDC, 0x00, 0x01, 0x02}; 
     ledTick.attach(&ledTickfunc,0.5);
     //ledTick.detach();
     //setup ethernet interface
     //eth.init(); //Use DHCP
-    eth.init(IP,MASK,GATEWAY);  //IP,mask,Gateway
+    eth.init(MAC_Addr,IP,MASK,GATEWAY);  //MAC,IP,mask,Gateway
     eth.connect();
     printf("IP Address is %s\n\r", eth.getIPAddress());
 
@@ -362,7 +362,7 @@
             }//while
             printf("close connection.\n\rHTTP server is listening...\n\r\n");
             client.close();
-            Thread::wait(50);
+            wait(0.05);
             led2 = false;
         }
     }
--- a/mbed-rtos.lib	Sun Apr 07 11:23:03 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#53e6cccd8782
--- a/mbed.bld	Sun Apr 07 11:23:03 2013 +0000
+++ b/mbed.bld	Tue Jun 23 03:44:18 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7
\ No newline at end of file