1 Star 0 Fork 2

刘宝军/Wireless_SD

forked from Giftina/Wireless_SD 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Wireless_SD.ino 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
Giftina 提交于 2020-07-25 10:13 . 更改WiFi密码为 OSHWHubNB
#include <ESP8266WiFi.h>
#include <SD.h>
#include "ESP8266FtpServer.h"
const char* ssid = "SDcard Reader";
const char* password = "OSHWHubNB";
// config static IP
IPAddress apIP(192, 168, 12,7);
IPAddress gateway(192, 168,12, 7);
IPAddress subnet(255, 255, 255, 0);
FtpServer ftpSrv;//set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
void setup(void){
Serial.begin(115200);
Serial.println("");
//Setting the Ip address for the WiFi connectivity
WiFi.config(apIP, gateway, subnet);
Serial.println();
Serial.print("Configuring access point...");
//Setting the esp to softaccess point mode
WiFi.mode(WIFI_AP);
WiFi.disconnect();
delay(100);
//changing softAP config and starting the Start AP
WiFi.softAPConfig(apIP, gateway, subnet);
WiFi.softAP(ssid, password);
//2 indicates the Chip select pin
if (SD.begin(2)) {
Serial.println("SD opened!");
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp. set ports in ESP8266FtpServer.h (default 21, 50009 for PASV)
}
}
void loop(void){
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/liu_baojun/Wireless_SD.git
git@gitee.com:liu_baojun/Wireless_SD.git
liu_baojun
Wireless_SD
Wireless_SD
master

搜索帮助