This commit is contained in:
编码猿
2025-08-29 22:01:03 +08:00
parent 1360daaab0
commit e62f697592
109 changed files with 304 additions and 1668 deletions

View File

@@ -1 +0,0 @@
4ac256fd-d71d-4104-8790-e15731a6d4fe

View File

@@ -1,19 +0,0 @@
const int Red = 10; // 2
//const int RedTwo = 12;
void setup() {
pinMode(Red, OUTPUT);
// pinMode(RedTwo, OUTPUT);
analogWrite(Red, 0);
// analogWrite(RedTwo, 0);
}
void loop() {
analogWrite(Red,255);
// analogWrite(RedTwo,255);
delay(1000);
analogWrite(Red,0);
// analogWrite(RedTwo,0);
delay(1000);
}

View File

@@ -1,3 +1,9 @@
/**
*
* 小夜灯
*
*/
#define BLINKER_MIOT_LIGHT
#define BLINKER_WIFI
#include <ESP8266WiFi.h>

View File

@@ -1,3 +1,9 @@
/**
*
* 洞洞板氛围灯
*
*/
#define BLINKER_PRINT Serial
#define BLINKER_MIOT_LIGHT
#define BLINKER_WIFI
@@ -7,7 +13,7 @@
#define BLINKER_OTA_VERSION_CODE "1.0.1"
//【据自己情况修改】Blinker 的秘钥
char auth[] = "b082a19ce985";
char auth[] = "199e88f6969a";
// 自己家中的 2.4G wifi名称
char ssid[] = "bmy";
// 自己家中的 2.4G wifi密码
@@ -16,7 +22,7 @@ char pswd[] = "lb714500";
//【据自己情况修改】WS2812的 GPIO 引脚编号
#define LED_PIN 0 // 对应开发板上的 D3
#define LED_PIN_TWO 2 // 对应开发板上的 D4
#define LED_PIN_THREE 14 // 对应开发板上的 D5
// #define LED_PIN_THREE 14 // 对应开发板上的 D5
#define LED_COUNT 60 //【据自己情况修改】灯珠个数
#define DEFAULT_COLOR 0xFF5900 // 初始化灯的颜色
@@ -33,7 +39,7 @@ unsigned long now = 0; // 当前的时候
// 初始化 WS2812FX
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
WS2812FX ws2812two = WS2812FX(60, LED_PIN_TWO, NEO_GRB + NEO_KHZ800);
WS2812FX ws2812three = WS2812FX(30, LED_PIN_THREE, NEO_GRB + NEO_KHZ800);
// WS2812FX ws2812three = WS2812FX(30, LED_PIN_THREE, NEO_GRB + NEO_KHZ800);
// 颜色选择器
BlinkerRGB RGB1("RGB");
@@ -57,38 +63,38 @@ BlinkerSlider brightnessSlider("brightness");
void rgb1_callback(uint8_t r_value, uint8_t g_value, uint8_t b_value, uint8_t bright_value) {
ws2812fx.setColor(ws2812fx.Color(r_value, g_value, b_value));
ws2812two.setColor(ws2812two.Color(r_value, g_value, b_value));
ws2812three.setColor(ws2812three.Color(r_value, g_value, b_value));
// ws2812three.setColor(ws2812three.Color(r_value, g_value, b_value));
if (bright_value != 0) {
ws2812fx.setBrightness(bright_value);
ws2812two.setBrightness(bright_value);
ws2812three.setBrightness(bright_value);
// ws2812three.setBrightness(bright_value);
}
}
// 开灯
void openLamp() {
if (!ws2812fx.isRunning() || !ws2812two.isRunning() || !ws2812three.isRunning()) {
if (!ws2812fx.isRunning() || !ws2812two.isRunning()) {
openButton.color("#F0AA41");
openButton.text("已开启");
openButton.print("on");
ws2812fx.start();
ws2812two.start();
ws2812three.start();
// ws2812three.start();
}
}
// 关灯
void closeLamp() {
if (ws2812fx.isRunning() || ws2812two.isRunning() || ws2812three.isRunning()) {
if (ws2812fx.isRunning() || ws2812two.isRunning()) {
closeRandom();
openButton.color("#595959");
openButton.text("已关闭");
openButton.print("off");
ws2812fx.stop();
ws2812two.stop();
ws2812three.stop();
// ws2812three.stop();
}
}
@@ -110,10 +116,10 @@ int BrightTransformation(int Bright) {
void defaultButton_Callback(const String & state) {
closeRandom();
ws2812three.setBrightness(DEFAULT_BRIGHTNESS);
ws2812three.setSpeed(DEFAULT_SPEED);
ws2812three.setColor(DEFAULT_COLOR);
ws2812three.setMode(DEFAULT_MODE);
// ws2812three.setBrightness(DEFAULT_BRIGHTNESS);
// ws2812three.setSpeed(DEFAULT_SPEED);
// ws2812three.setColor(DEFAULT_COLOR);
// ws2812three.setMode(DEFAULT_MODE);
ws2812two.setBrightness(DEFAULT_BRIGHTNESS);
ws2812two.setSpeed(DEFAULT_SPEED);
@@ -132,9 +138,9 @@ void defaultButton_Callback(const String & state) {
void workButton_Callback(const String & state) {
closeRandom();
ws2812three.setBrightness(127);
ws2812three.setSpeed(1000);
ws2812three.setMode(FX_MODE_COLOR_WIPE_RANDOM);
// ws2812three.setBrightness(127);
// ws2812three.setSpeed(1000);
// ws2812three.setMode(FX_MODE_COLOR_WIPE_RANDOM);
ws2812two.setBrightness(127);
ws2812two.setSpeed(1000);
@@ -150,9 +156,9 @@ void workButton_Callback(const String & state) {
void sleepButton_Callback(const String & state) {
closeRandom();
ws2812three.setColor(255, 89, 0);
ws2812three.setBrightness(50);
ws2812three.setMode(FX_MODE_BREATH);
// ws2812three.setColor(255, 89, 0);
// ws2812three.setBrightness(50);
// ws2812three.setMode(FX_MODE_BREATH);
ws2812two.setColor(255, 89, 0);
ws2812two.setBrightness(50);
@@ -167,7 +173,7 @@ void sleepButton_Callback(const String & state) {
// 拖动调节亮度
void brightnessSlider_Callback(int32_t value) {
uint8_t set_brightness = 255 * int(value) / 100;
ws2812three.setBrightness(set_brightness);
// ws2812three.setBrightness(set_brightness);
ws2812two.setBrightness(set_brightness);
ws2812fx.setBrightness(set_brightness);
brightnessSlider.print(value);
@@ -217,7 +223,7 @@ void miotBright(const String & bright) {
}
//进行亮度值转换
uint8_t set_brightness = 255 * colorW / 100;
ws2812three.setBrightness(set_brightness);
// ws2812three.setBrightness(set_brightness);
ws2812two.setBrightness(set_brightness);
ws2812fx.setBrightness(set_brightness);
brightnessSlider.print(colorW);
@@ -229,7 +235,7 @@ void miotBright(const String & bright) {
// 灯的颜色设置
void miotColor(int32_t color) {
BLINKER_LOG("need set color: ", color);
ws2812three.setColor(color);
// ws2812three.setColor(color);
ws2812two.setColor(color);
ws2812fx.setColor(color);
BlinkerMIOT.color(color);
@@ -285,9 +291,9 @@ void miotMode(uint8_t mode) {
// 日光 模式
if (mode == BLINKER_CMD_MIOT_DAY) {
ws2812three.setColor(255, 255, 255);
ws2812three.setBrightness(255);
ws2812three.setMode(DEFAULT_MODE);
// ws2812three.setColor(255, 255, 255);
// ws2812three.setBrightness(255);
// ws2812three.setMode(DEFAULT_MODE);
ws2812two.setColor(255, 255, 255);
ws2812two.setBrightness(255);
@@ -300,9 +306,9 @@ void miotMode(uint8_t mode) {
}
// 月光 模式
else if (mode == BLINKER_CMD_MIOT_NIGHT) {
ws2812three.setColor(255, 89, 0);
ws2812three.setBrightness(255);
ws2812three.setMode(FX_MODE_STATIC);
// ws2812three.setColor(255, 89, 0);
// ws2812three.setBrightness(255);
// ws2812three.setMode(FX_MODE_STATIC);
ws2812two.setColor(255, 89, 0);
ws2812two.setBrightness(255);
@@ -315,9 +321,9 @@ void miotMode(uint8_t mode) {
}
// 彩光 模式
else if (mode == BLINKER_CMD_MIOT_COLOR) {
ws2812three.setBrightness(255);
ws2812three.setSpeed(200);
ws2812three.setMode(FX_MODE_RAINBOW_CYCLE);
// ws2812three.setBrightness(255);
// ws2812three.setSpeed(200);
// ws2812three.setMode(FX_MODE_RAINBOW_CYCLE);
ws2812two.setBrightness(255);
ws2812two.setSpeed(200);
@@ -330,30 +336,30 @@ void miotMode(uint8_t mode) {
}
// 温馨 模式
else if (mode == BLINKER_CMD_MIOT_WARMTH) {
ws2812three.setMode(FX_MODE_TWINKLEFOX);
// ws2812three.setMode(FX_MODE_TWINKLEFOX);
ws2812two.setMode(FX_MODE_TWINKLEFOX);
ws2812fx.setMode(FX_MODE_TWINKLEFOX);
}
// 电视模式
else if (mode == BLINKER_CMD_MIOT_TV) {
ws2812three.setBrightness(20);
ws2812three.setSpeed(1000);
ws2812three.setMode(FX_MODE_CHASE_RAINBOW);
// ws2812three.setBrightness(20);
// ws2812three.setSpeed(1000);
// ws2812three.setMode(FX_MODE_CHASE_RAINBOW);
ws2812two.setBrightness(20);
ws2812two.setBrightness(255);
ws2812two.setSpeed(1000);
ws2812two.setMode(FX_MODE_CHASE_RAINBOW);
ws2812fx.setBrightness(20);
ws2812fx.setBrightness(255);
ws2812fx.setSpeed(1000);
ws2812fx.setMode(FX_MODE_CHASE_RAINBOW);
brightnessSlider.print(BrightTransformation(20));
}
// 阅读 模式
else if (mode == BLINKER_CMD_MIOT_READING) {
ws2812three.setBrightness(255);
ws2812three.setSpeed(200);
ws2812three.setMode(FX_MODE_MULTI_STROBE);
// ws2812three.setBrightness(255);
// ws2812three.setSpeed(200);
// ws2812three.setMode(FX_MODE_MULTI_STROBE);
ws2812two.setBrightness(255);
ws2812two.setSpeed(200);
@@ -366,8 +372,8 @@ void miotMode(uint8_t mode) {
}
// 电脑模式
else if (mode == BLINKER_CMD_MIOT_COMPUTER) {
ws2812three.setBrightness(255);
ws2812three.setMode(FX_MODE_COLOR_SWEEP_RANDOM);
// ws2812three.setBrightness(255);
// ws2812three.setMode(FX_MODE_COLOR_SWEEP_RANDOM);
ws2812two.setBrightness(255);
ws2812two.setMode(FX_MODE_COLOR_SWEEP_RANDOM);
@@ -411,7 +417,7 @@ void heartbeat() {
void changeRandomTheme() {
if (isUseRandomTheme) {
if (now - last_change > TIMER_MS) {
ws2812three.setMode((ws2812three.getMode() + 1) % ws2812three.getModeCount());
// ws2812three.setMode((ws2812three.getMode() + 1) % ws2812three.getModeCount());
ws2812two.setMode((ws2812two.getMode() + 1) % ws2812two.getModeCount());
ws2812fx.setMode((ws2812fx.getMode() + 1) % ws2812fx.getModeCount());
BlinkerMIOT.brightness(100 * ws2812fx.getBrightness() / 255);
@@ -422,12 +428,12 @@ void changeRandomTheme() {
void Ws2812fxInit() {
ws2812three.init();
ws2812three.setBrightness(DEFAULT_BRIGHTNESS);
ws2812three.setSpeed(DEFAULT_SPEED);
ws2812three.setColor(DEFAULT_COLOR);
ws2812three.setMode(DEFAULT_MODE);
ws2812three.start();
// ws2812three.init();
// ws2812three.setBrightness(DEFAULT_BRIGHTNESS);
// ws2812three.setSpeed(DEFAULT_SPEED);
// ws2812three.setColor(DEFAULT_COLOR);
// ws2812three.setMode(DEFAULT_MODE);
// ws2812three.start();
ws2812two.init();
ws2812two.setBrightness(DEFAULT_BRIGHTNESS);
@@ -464,7 +470,7 @@ void BlinkerInit() {
// 工作模式
workButton.attach(workButton_Callback);
// 默认模式
defaultButton.attach(defaultButton_Callback);
defaultButton.·(defaultButton_Callback);
// 休眠模式
sleepButton.attach(sleepButton_Callback);
// 随机模式
@@ -501,7 +507,7 @@ void loop() {
now = millis();
ws2812fx.service();
ws2812two.service();
ws2812three.service();
// ws2812three.service();
Blinker.run();
changeRandomTheme();
}

View File

@@ -0,0 +1,198 @@
/**
*
* 三进一出 HDMI 切换
*
*/
#define BLINKER_PRINT Serial
#define BLINKER_MIOT_LIGHT
#define BLINKER_WIFI
#include <Arduino.h>
// 红外模块的 控制库
#include <IRremoteESP8266.h>
#include <IRsend.h>
// wifi 和 WebServer 库
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
// json处理库
#include <ArduinoJson.h>
#include <Blinker.h>
// 开发板的 GPIO 4
const uint16_t kIrLed = 4;
// 点灯app中新创建的设备密钥key
char auth[] = "c55b251e4fd2";
// 2.4g wifi名字
char ssid[] = "bmy";
//2.4g wifi密码
char pswd[] = "lb714500";
// 遥控器的 NEC 红外控制码,通过红外接收模块从遥控器上获取到
uint32_t Button1 = 0xFFE01F; // 笔记本
uint32_t Button2 = 0xFF9867; // N100服务器
uint32_t Button3 = 0xFF906F; // Switch 主机
uint32_t ButtonMode = 0xFF02FD; // 1 2 3 顺序切换
// 和点灯app上的按键进行绑定
BlinkerButton But1("btn1");
BlinkerButton But2("btn2");
BlinkerButton But3("btn3");
BlinkerButton ButMode("btnmode");
// 初始化 红外发射类,传入 GPIO
IRsend irsend(kIrLed);
// 创建Web服务器实例监听8080端口
ESP8266WebServer server(8080);
// 接口的响应数据json格式
JsonDocument response;
// 按键回调函数 - 开始
void But1_callback(const String& state) {
BLINKER_LOG("笔记本");
send(Button1);
}
void But2_callback(const String& state) {
BLINKER_LOG("N100服务器");
send(Button2);
}
void But3_callback(const String& state) {
BLINKER_LOG("Switch 主机");
send(Button3);
}
void ButMode_callback(const String& state) {
BLINKER_LOG("1 2 3 顺序切换");
send(ButtonMode);
}
// 按键回调函数 - 结束
// 语音 模式切换
void miotMode(uint8_t mode) {
BLINKER_LOG("need set mode: ", mode);
// 电脑模式 == 笔记本
if (mode == BLINKER_CMD_MIOT_COMPUTER) {
send(Button1);
// 电视模式 == Switch 主机
} else if (mode == BLINKER_CMD_MIOT_TV) {
send(Button3);
// 阅读模式 == N100服务器
} else if (mode == BLINKER_CMD_MIOT_READING) {
send(Button2);
}
BlinkerMIOT.mode(mode);
BlinkerMIOT.print();
}
// 发送NEC红外 方法的封装
void send(uint32_t cmd) {
irsend.sendNEC(cmd);
}
// 初始化 Blinker并绑定各种事件监听
void BlinkerInit() {
// 开启调试信息
BLINKER_DEBUG.stream(Serial);
//配网步骤WIFI接入
Blinker.begin(auth, ssid, pswd);
// 按钮事件的绑定
But1.attach(But1_callback);
But2.attach(But2_callback);
But3.attach(But3_callback);
ButMode.attach(ButMode_callback);
// 语音设置模式
BlinkerMIOT.attachMode(miotMode);
}
// 当访问的接口地址不存在的时候
void handleNotFound() {
String message = "File Not Found\n\n";
message += "URI: ";
message += server.uri();
message += "\nMethod: ";
message += (server.method() == HTTP_GET) ? "GET" : "POST";
message += "\nArguments: ";
message += server.args();
message += "\n";
for (uint8_t i = 0; i < server.args(); i++) {
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
}
server.send(404, "text/plain", message);
}
void changeDisplayEvent() {
// 获取前端传递过来的参数
String code = server.arg("code");
response["code"] = 200;
if (code == "1") {
Serial.print("笔记本");
send(Button1);
response["mesage"] = "请求参数为1已显示为 笔记本";
} else if (code == "2") {
Serial.print("n100");
send(Button2);
response["mesage"] = "请求参数为2已显示为 N100服务器";
} else if (code == "3") {
Serial.print("switch");
send(Button3);
response["mesage"] = "请求参数为3已显示为 Switch";
} else {
response["code"] = 404;
response["mesage"] = "code 参数无效";
}
String jsonCode;
serializeJson(response, jsonCode);
server.send(200, "application/json", jsonCode);
}
// WebServer 的 事件监听
void serverOnEvent() {
// 定义切换显示器的接口
server.on("/changeDisplay", changeDisplayEvent);
// 处理404的情况
server.onNotFound(handleNotFound);
}
void setup() {
// 初始化串口
Serial.begin(9600);
// 调用方法
serverOnEvent();
// 点灯 SDK 初始化
BlinkerInit();
// 启动 WebServer 启动服务器
server.begin();
// 初始化红外
irsend.begin();
}
void loop() {
// 处理客户端请求
server.handleClient();
Blinker.run();
}

View File

@@ -0,0 +1 @@
GET http://192.168.31.75:8080/changeDisplay?code=3

View File

@@ -0,0 +1,36 @@
3进1出 HDMI 遥控器 笔记:
协议NEC
方法irsend.sendNEC(Code, 32);
红外码:
按键1: 笔记本
Code : 0xFFE01F (32 Bits)
uint16_t rawData[71] = {8944, 4578, 488, 620, 486, 622, 484, 624, 484, 622, 486, 622, 484, 622, 484, 624, 482, 624, 484, 1720, 484, 1720, 484, 1720, 484, 1720, 484, 1720, 484, 1720, 486, 1720, 484, 1718, 488, 1718, 486, 1716, 486, 1716, 486, 622, 486, 620, 486, 620, 486, 620, 486, 622, 486, 620, 486, 620, 486, 622, 460, 1742, 486, 1718, 484, 1718, 486, 1718, 486, 1718, 486, 40880, 8968, 2056, 512}; // NEC FFE01F
uint32_t address = 0x0;
uint32_t command = 0x7;
uint64_t data = 0xFFE01F;
按键2: N100服务器
Code : 0xFF9867 (32 Bits)
uint16_t rawData[71] = {8988, 4522, 530, 598, 532, 574, 506, 600, 506, 600, 532, 574, 508, 600, 534, 574, 534, 574, 506, 1698, 506, 1698, 506, 1698, 534, 1670, 532, 1676, 532, 1672, 506, 1698, 532, 1672, 534, 1670, 508, 600, 506, 600, 534, 1670, 532, 1672, 534, 576, 534, 574, 534, 574, 532, 574, 532, 1672, 508, 1698, 532, 576, 534, 576, 532, 1670, 532, 1672, 532, 1672, 506, 40626, 9034, 2014, 532}; // NEC FF9867
uint32_t address = 0x0;
uint32_t command = 0x19;
uint64_t data = 0xFF9867;
按键3: Switch 主机
Code : 0xFF906F (32 Bits)
uint16_t rawData[71] = {9038, 4478, 548, 580, 528, 580, 532, 576, 528, 578, 530, 578, 532, 576, 530, 578, 530, 576, 530, 1674, 530, 1674, 530, 1672, 530, 1672, 530, 1674, 530, 1674, 528, 1674, 532, 1672, 532, 1672, 506, 600, 532, 576, 506, 1698, 530, 578, 530, 578, 530, 576, 532, 574, 530, 578, 532, 1672, 530, 1674, 532, 574, 528, 1674, 530, 1672, 532, 1672, 532, 1672, 506, 40606, 9006, 2016, 578}; // NEC FF906F
uint32_t address = 0x0;
uint32_t command = 0x9;
uint64_t data = 0xFF906F;
MODE1 2 3 顺序切换
Code : 0xFF02FD (32 Bits)
uint16_t rawData[71] = {9030, 4484, 554, 574, 530, 578, 528, 578, 528, 580, 530, 578, 530, 578, 528, 580, 528, 578, 528, 1678, 528, 1676, 530, 1674, 530, 1652, 554, 1674, 530, 1674, 526, 1678, 528, 1676, 528, 578, 530, 576, 530, 578, 530, 578, 528, 580, 528, 580, 530, 1674, 532, 578, 530, 1674, 530, 1674, 528, 1676, 528, 1676, 530, 1652, 550, 1676, 526, 580, 528, 1656, 552, 40666, 9012, 1990, 580}; // NEC FF02FD
uint32_t address = 0x0;
uint32_t command = 0x40;
uint64_t data = 0xFF02FD;

View File

@@ -1,3 +1,9 @@
/**
*
* 普通灯带 控制
*
*/
#define BLINKER_PRINT Serial
#define BLINKER_MIOT_LIGHT
#define BLINKER_WIFI

View File

@@ -1 +0,0 @@
04d37c7c-1f3e-4016-8649-f22e73c3f717

View File

@@ -1,56 +0,0 @@
#include <ESP8266WiFi.h> // 本程序使用 ESP8266WiFi库
#include <ESP8266WiFiMulti.h> // ESP8266WiFiMulti库
#include <ESP8266WebServer.h> // ESP8266WebServer库
ESP8266WiFiMulti wifiMulti; // 建立ESP8266WiFiMulti对象,对象名称是'wifiMulti'
ESP8266WebServer esp8266_server(80);// 建立ESP8266WebServer对象对象名称为esp8266_server
// 括号中的数字是网路服务器响应http请求的端口号
// 网络服务器标准http端口号为80因此这里使用80为端口号
void setup(void){
Serial.begin(115200); // 启动串口通讯
//通过addAp函数存储 WiFi名称 WiFi密码
wifiMulti.addAP("bmy", "lb714500"); // 这三条语句通过调用函数addAP来记录3个不同的WiFi网络信息。
int i = 0;
while (wifiMulti.run() != WL_CONNECTED) { // 此处的wifiMulti.run()是重点。通过wifiMulti.run()NodeMCU将会在当前
delay(1000); // 环境中搜索addAP函数所存储的WiFi。如果搜到多个存储的WiFi那么NodeMCU
Serial.print(i++); Serial.print(' '); // 将会连接信号最强的那一个WiFi信号。
} // 一旦连接WiFI成功wifiMulti.run()将会返回“WL_CONNECTED”。这也是
// 此处while循环判断是否跳出循环的条件。
// WiFi连接成功后将通过串口监视器输出连接成功信息
Serial.println('\n'); // WiFi连接成功后
Serial.print("Connected to "); // NodeMCU将通过串口监视器输出。
Serial.println(WiFi.SSID()); // 连接的WiFI名称
Serial.print("IP address:\t"); // 以及
Serial.println(WiFi.localIP()); // NodeMCU的IP地址
//--------"启动网络服务功能"程序部分开始-------- // 此部分为程序为本示例程序重点1
esp8266_server.begin(); // 详细讲解请参见太极创客网站《零基础入门学用物联网》
esp8266_server.on("/", HTTP_GET, handleRoot); // 第3章-第2节 ESP8266-NodeMCU网络服务器-1
esp8266_server.onNotFound(handleNotFound);
//--------"启动网络服务功能"程序部分结束--------
Serial.println("HTTP esp8266_server started");// 告知用户ESP8266网络服务功能已经启动
}
/* 以下函数语句为本示例程序重点3
详细讲解请参见太极创客网站《零基础入门学用物联网》
第3章-第2节 3_2_1_First_Web_Server 的说明讲解*/
void loop(void){
esp8266_server.handleClient(); // 处理http服务器访问
}
/* 以下两个函数为本示例程序重点2
详细讲解请参见太极创客网站《零基础入门学用物联网》
第3章-第2节 3_2_1_First_Web_Server 的说明讲解*/
void handleRoot() { //处理网站根目录“/”的访问请求
esp8266_server.send(200, "text/plain", "Hello from ESP8266"); // NodeMCU将调用此函数。
}
// 设置处理404情况的函数'handleNotFound'
void handleNotFound(){ // 当浏览器请求的网络资源无法在服务器找到时,
esp8266_server.send(404, "text/plain", "404: Not found"); // NodeMCU将调用此函数。
}