# ESP32_smartConfig **Repository Path**: chiyoooo/esp32_smart-config ## Basic Information - **Project Name**: ESP32_smartConfig - **Description**: esp32 smartConfig 配网,使用微信小程序- 一键配网。基于巴法云例程修改 - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2024-04-08 - **Last Updated**: 2025-01-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: ESP32, SmartConfig, 配网, 巴法云, Arduino ## README # Arduino smartconfig Library WiFi 配网 在这个库中,我们使用 smartconfig 技术来进行 Wi-Fi 网络配置。重启设备后,它可以自动连接到先前配置的网络。用户还可以通过微信搜索 “一键配网” 并选择 smartconfig 服务进行网络配置。此库是基于巴法云提供的 ESP8266 网络配置代码进行封装和改进的。 https://www.cnblogs.com/bemfa/p/15439769.html 快速使用指南: 首先,在代码中引入库头文件 smartconfig.h。 接着,在 setup () 函数中加载存储的配置信息,并检查是否需要重新配置网络。如果需要,调用 smartConfig.startWiFiConfig () 来等待通过 smartconfig 进行网络配置;否则,如果不需要重新配置网络,只需调用 smartConfig.initWiFi () 来初始化 Wi-Fi 连接。 最后,通过调用 smartConfig.getSSID () 和 smartConfig.getPassword () 方法,并将结果显示在 Serial Monitor 中,可以获得已配置的 Wi-Fi 网络的 SSID 和密码信息。 这个库的更改日志可以在 CHANGELOG 中找到。 ## 快速使用 ### 引入头文 ```CPP #include "smartconfig.h" ``` ### 在 `setup ()` 中配置引入 ```CPP // 加载存储的配置信息并检查是否需要重新配网 smartConfig.loadConfig(); if (smartConfig.checkNetConfigNeeded()) { smartConfig.startWiFiConfig (); // 等待 SmartConfig 配网 } else { smartConfig.initWiFi (); // 不需要配网,初始化 WiFi } ``` ### 获取 WIFI 信息 ```CPP Serial.println("SSID: " + smartConfig.getSSID() + " Password: " + smartConfig.getPassword()); ```