6.4. API
6.4.1. Sending pictures or videos to an FTP server with WiFi
This function uses the WiFi module to send the pictures or the videos captures by the Video Camera Sensor Board. You must
include the Wi-Fi libraries before the 3G libraries. The function,
•
Name of the file to send in Waspmote 3G/GPRS Board. The file must be in the current directory
•
Name of the file to save in the FTP server
•
FTP address
•
FTP port
•
FTP mode: 0 for passive mode and 1 for proactive mode
•
FTP username
•
FTP password
•
WiFi encryption: WEP, WPA1, WPAMIX and WPA2
•
WiFi password
•
SSID
Example of use:
{
// First, goes to the folder with the videos
_3G.goRoot(1);
_3G.cd("Video");
// Then, sends VIDEO1.mp4 to FTP
_3G._3G.sendFiletoWiFiFTP("VIDEO1.mp4", ""VIDEO1.mp4", "ftp.server.com",
21, 0, "FTP_username", "FTP_password", WPA2, "wifi_pass", "SSID");
}
The function returns:
•
'1' if success
•
'-2' if error setting the connection options
•
'-3' if error setting the DHCP options
•
'-4' if error setting FTP parameters
•
'-5' if error setting authentication key
•
'-6' if error setting the join mode
•
'-7' if error joining to the WiFi network
•
'-8' if error opening the FTP session
•
'-9' if error uploading the file
6.4.2. Sending pictures or videos to an FTP server with 3G/GPRS Board
The function
sendFileto3GFTP
connection. The parameters needed in order are the next:
•
Location of the file: 0 for current directory, 1 for "C:/Picture" directory, 2 for "C:/Video" directory, 4 for "D:/Picture" directory
and 5 for "D:/Video" directory
•
Name of the file
•
FTP address
•
FTP port
•
FTP mode: 0 for proactive mode and 1 for passive mode
•
FTP username
•
FTP password
configures the 3G/GPRS Board to send an image to an FTP server using the 3G or GPRS
, needs the next input parameters:
sendFiletoWiFiFTP
-36-
Sending the photos and videos
v4.3
Need help?
Do you have a question about the Waspmote and is the answer not in the manual?