esp8266 smartconfig V2.5.4 Unable to connect to the distribution network with esptouch app
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- embedded-iot, networking
Research direction
Start by reproducing the report with the supplied setup, ESP8266WiFi.h, smartconfig.h, and the ESP-Touch app. Trace the smartconfig_start callback through SC_STATUS_FIND_CHANNEL, SC_STATUS_LINK, and SC_STATUS_LINK_OVER, checking where connection progress stops. Done means the device receives the credentials and successfully connects to the router.
Written by the indexing model from the issue text.
Description
`
#include <ESP8266WiFi.h>
#include <smartconfig.h>
// 回调函数
void smartConfigCallback(uint32_t st, void* result)
{
sc_status status = (sc_status) st;
Serial.printf("[SmartConfig] status:%d\n", status);
if (status == SC_STATUS_FIND_CHANNEL) {
Serial.println("正在扫描信道... 请打开 ESP-Touch App 开始配网");
}
else if (status == SC_STATUS_GETTING_SSID_PSWD) {
Serial.println("正在接收 SSID 和密码...");
if (result != NULL) {
sc_type type = (sc_type)result;
if (*type == SC_TYPE_ESPTOUCH) {
Serial.println("协议类型: ESP-Touch");
} else if (*type == SC_TYPE_AIRKISS) {
Serial.println("协议类型: AirKiss");
}
}
}
else if (status == SC_STATUS_LINK) {
Serial.println("已成功获取 SSID 和密码!正在连接路由器...");
if (result != NULL) {
struct station_config *sta_conf = (struct station_config *)result;
// 保存配置并连接
wifi_station_set_config(sta_conf);
wifi_station_disconnect();
wifi_station_connect();
}
}
else if (status == SC_STATUS_LINK_OVER) {
Serial.println("SmartConfig 配网成功!已连接到路由器");
if (result != NULL) {
uint8_t *ip = (uint8_t*)result;
Serial.printf("手机端 IP: %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]);
}
smartconfig_stop(); // 停止 SmartConfig,释放资源
Serial.print("设备本地 IP: ");
Serial.println(WiFi.localIP());
}
else {
Serial.printf("未知状态: %d\n", status);
}
}
void setup() {
Serial.begin(115200);
delay(1000);
// We start by connecting to a WiFi network
/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
would try to act as both a client and an access-point and could cause
network-issues with your other WiFi-devices on your WiFi-network. */
WiFi.mode(WIFI_STA);
Serial.println(smartconfig_get_version());
esptouch_set_timeout(30);
if(smartconfig_start(reinterpret_cast<sc_callback_t>(smartConfigCallback), 1))
{
Serial.println("SmartConfig 已启动,等待手机发送配置...");
} else {
Serial.println("SmartConfig 启动失败!");
return;
}
}
void loop() {
delay(5000);
}`
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 13.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from esp8266/Arduino
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
[compiler Warnings]: Compile with `-Wconversion` and `-Wsign-conversion` brings up many Warnings Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·