乐鑫技术交流
直播中

李梅

8年用户 1440经验值
私信 关注
[问答]

esp_iot_sdk_v1.0.1_15_04_24为什么不能设置softAp ssid和password?

我刚学习esp8266.遇到这个问题请帮忙解决。

使用的是esp_iot_sdk_v1.0.1_15_04_24.zip SDK.

烧录工具是FLASH_DOWNLOAD_TOOLS_v0.9.6_150419.rar。

使用附件的参数,烧录ok.

电脑通过wifi,输入密码:1a:fe:34:fe:41:b4_v*%W>L<@i&Nxe!
连接上softAp.

在windos ,参考 2B-ESP8266__SDK__IOT_Demo_CN_v0.5.pdf
使用curl 命令修改softAp ssid 和密码不成功。

命令使用:
curl -X POST -H "Content-Type:application/json" -d "{/"Request/":{/"
Softap/":{/"Connect_Softap/":{/"authmode/":/"WPAPSK/WPA2PSK/", /"channel/":6, /"
SSID/":/"ESP_IOT_SOFTAP/", /"password/":/"34567890/"}}}}" http://192.168.4.1/con
fig?command=wifi

这个也不行。
curl -X POST -H "Content-Type:application/json" -d "{/"Request/":{/"Softap/":{/"Connect_Softap/":{/"authmode/":/"WPA2PSK/", /"channel/":6, /"SSID/":/"ESP_IOT_SOFTAP/", /"password/":/"34567890/"}}}}" http://192.168.4.1/config?command=wifi


具体log:
命令log:

C:Usersyk>curl -X GET http://192.168.4.1/client?command=info
{
"Version":{
"hardware":"0.3",
"sdk_version":"1.0.1",
"iot_version":"v1.0.2t12335(a)"
},
"Device":{
"product":"Humiture",
"manufacturer":"Espressif Systems"
}
}


C:Usersyk>curl -X GET http://192.168.4.1/config?command=wifi
{
"Response":{
"Station":{
"Connect_Station":{
"ssid":"",
"password":""
},
"Ipinfo_Station":{
"ip":"0.0.0.0",
"mask":"0.0.0.0",
"gw":"0.0.0.0"
}
},
"Softap":{
"Connect_Softap":{
"authmode":"WPAPSK/WPA2PSK",
"channel":1,
"ssid":"ESP_FE41B4",
"password":"1a:fe:34:fe:41:b4_v*%W>L<@i&Nxe!"
},
"Ipinfo_Softap":{
"ip":"192.168.4.1",
"mask":"255.255.255.0",
"gw":"192.168.4.1"
}
}
}
}


C:Usersyk>curl -X POST -H "Content-Type:application/json" -d "{/"Request/":{/"
Softap/":{/"Connect_Softap/":{/"authmode/":/"WPAPSK/WPA2PSK/", /"channel/":6, /"
SSID/":/"ESP_IOT_SOFTAP/", /"password/":/"34567890/"}}}}" http://192.168.4.1/con
fig?command=wifi

C:Usersyk>


串口log:

ets Jan  8 2013,rst cause:1, boot mode:(3,7)

load 0x40100000, len 28304, room 16
tail 0
chksum 0xed
load 0x3ffe8000, len 3252, room 8
tail 12
chksum 0x6d
ho 0 tail 12 room 4
load 0x3ffe8cc0, len 3336, room 12
tail 12
chksum 0x45
csum 0x45

SDK ver: 1.0.1 compiled @ Apr 24 2015 19:31:11
phy ver: 329, pp ver: 8.4

SDK version:1.0.1
IOT VERSION = v1.0.2t12335(a)
addr not ack when tx write cmd
PCB->localport 80
mode : sta(18:fe:34:fe:41:b4) + softAP(1a:fe:34:fe:41:b4)
add if0
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
add 1
aid 1
station: 20:7c:8f:26:3a:ba join, AID = 1
We have a GET request.
webserver's 192.168.4.2:65232 disconnect
We have a GET request.
webserver's 192.168.4.2:65235 disconnect
We have a POST request.
webserver's 192.168.4.2:65240 disconnect
            

回帖(1)

王斌

2024-7-13 17:14:56

在解决这个问题之前,我们需要确保您已经正确设置了ESP8266的SoftAP模式。以下是一些建议和解决方案:

1. 确认您的ESP8266已经成功烧录了固件。您可以使用ESP_iot_sdk_v1.0.1_15_04_24.zip SDK中的示例程序进行测试。

2. 确保您的ESP8266已经处于SoftAP模式。您可以通过以下命令检查ESP8266的当前模式:
   ```
   curl -X GET "http://1a:fe:34:fe:41:b4/v1/status"
   ```
   如果返回的JSON数据中包含"SoftAP"字段,说明您的ESP8266已经处于SoftAP模式。

3. 使用正确的curl命令修改SoftAP的SSID和密码。根据您提供的命令,似乎存在一些格式问题。请尝试以下命令:
   ```
   curl -X POST -H "Content-Type:application/json" -d '{"Request":{"Softap":{"ssid":"new_ssid", "password":"new_password"}}}' "http://1a:fe:34:fe:41:b4/v1/set"
   ```
   请将`new_ssid`和`new_password`替换为您想要设置的SSID和密码。

4. 如果您仍然无法成功修改SoftAP的SSID和密码,请检查您的ESP8266固件是否支持该功能。如果不支持,您可能需要升级到较新的固件版本。

5. 确保您的ESP8266和计算机处于同一局域网内,以便能够通过curl命令进行通信。


举报

更多回帖

发帖
×
20
完善资料,
赚取积分