Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CameraC328 SDFileSystem WIZnetInterface mbed-src
Fork of Camera_FTP_WIZwiki-W7500 by
Prerequisite
This example send the image data acquired from the camera to an FTP Server.
To implement this function, you need a Platform board, network Interface board, camera module.
Available camera modules are C328, LJ-DSC02. Because the cameras listed above all have similar internal protocols.
This example uses LJ-DSC02.
- WIZwiki-W7500 from WIZnet (Platform board and Ethernet I/F board)
- LJ-DSC02 (Camera module)
- FTP Server(AL FTP)
- Micro SD Card
Hardware Configuration
- connect Ethernet Cable & USB Cable
- connect Camera module
Software
Init FTP Server information
static char ID[]={"abc"}; //Set FTPServer Login ID
static char PASSWORD[]={"123"}; //Set FTPServer Login Password
const char ftpServer_control_ip_addr[] = "192.168.1.2";
Caution
Must fix FTP server ip, id, pass
Diff: main.cpp
- Revision:
- 2:c469227cb913
- Parent:
- 1:7d428f360a0a
- Child:
- 3:55b7af329281
diff -r 7d428f360a0a -r c469227cb913 main.cpp
--- a/main.cpp Tue Jul 21 23:52:52 2015 +0000
+++ b/main.cpp Wed Jul 22 01:14:39 2015 +0000
@@ -24,17 +24,15 @@
char ftpServer_data_ip_addr[4]={0,};
char ftpServer_data_ip_addr_str[20]={0,};
static char buf[256];
+static char ID[]={"abc"}; //Set FTPServer Login ID
+static char PASSWORD[]={"123"}; //Set FTPServer Login Password
enum CommandFirst {
f_nocmd,
- f_dir,
f_put,
- f_get,
};
enum CommandSecond {
s_nocmd,
- s_dir,
s_put,
- s_get,
};
enum ftpc_datasock_state{
DATASOCK_IDLE,
@@ -53,15 +51,15 @@
/* SD Card filesystem */
SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "sd"); // WIZwiki-W7500
-/* UART */
-Serial pc(USBTX, USBRX);
-char gMsgBuf[10];
-int User_Keyboard_MSG_Cnt;
-/* CAMERA */
static FILE *fp_jpeg;
char fname[32];
char fname_server[16];
char fnamecnt=0;
+/* UART */
+Serial pc(USBTX, USBRX);
+char gMsgBuf[10];
+char User_Keyboard_MSG_Cnt;
+/* CAMERA */
CameraC328 camera(PA_13, PA_14, CameraC328::Baud115200);
/* Function*/
char* User_Keyboard_MSG(void);
@@ -99,6 +97,11 @@
//while 1
while(true)
{
+ pc.printf("\r\n----------------------------------------\r\n");
+ pc.printf("Press menu key\r\n");
+ pc.printf("----------------------------------------\r\n");
+ pc.printf("1> Snapshot Picture and Send FTPServer\r\n");
+ pc.printf("----------------------------------------\r\n");
Msg_c = pc.getc();
if(Msg_c==0x31){
@@ -136,12 +139,12 @@
//buf if
if (!strncmp(buf, "220", 3)){
FTP_CONTROL_SOCK.send(USER, sizeof(USER)-1);
- //FTP_CONTROL_SOCK.send(gMsgBuf, User_Keyboard_MSG_Cnt-1);
+ FTP_CONTROL_SOCK.send(ID, sizeof(ID));
FTP_CONTROL_SOCK.send(END, sizeof(END)-1);
}
else if(!strncmp(buf, "331", 3)){
FTP_CONTROL_SOCK.send(PASS, sizeof(PASS)-1);
- //FTP_CONTROL_SOCK.send(gMsgBuf, User_Keyboard_MSG_Cnt-1);
+ FTP_CONTROL_SOCK.send(PASSWORD, sizeof(PASSWORD));
FTP_CONTROL_SOCK.send(END, sizeof(END)-1);
}
else if(!strncmp(buf, "230", 3)){
