收藏官网首页
查看: 39133|回复: 3

[求助] esp8266-12f soc固件 通电和复位后运行模式的问题

3

主题

6

帖子

80

积分

注册会员

Rank: 2

积分
80
跳转到指定楼层
楼主
发表于 2017-7-18 16:10:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
校园创客福利
背景:1. esp8266-12f soc方案

2.模块已经配置网络连接,并能正常连接云

现象:
通电之后,模块会进入 Test Mode, 一段时间之后,会自动转入正常工作模式;
复位之后,模块会直接进入正常工作模式;

问题:
如何使模块通电之后 跳过 Test Mode, 直接进入 正常工作模式?

以下是打印信息:
connected with TP-LINK_4A2EBA, channel 11
dhcp client start...
[WiFiEvent] connect to ssid TP-LINK_4A2EBA, channel 11
ip:192.168.2.104,mask:255.255.255.0,gw:192.168.2.1
[WiFiEvent] ip:192.168.2.104,mask:255.255.255.0,gw:192.168.2.1
[NWK] NWK_WIFI_STA_CONNECTED
[FR]  Cancle router connect monitor.
[NWK]  haiNwkStatus: 0x001A, GAgentStatus: 0x101A
[Lan] startupBroadCastTime:29
[Local] GAgentStatus change, lastGAgentStatus:0x100A, newGAgentStatus:0x131A
@@@@ GAgentStatus[hex]:131a | [Bin]:0,1,1,0,1,0
OnBoarding: Station mode
WiFi status: connected router
RSSI 3
[WiFiEvent]  IN Test Mode. cnt: 2
[Lan] startupBroadCastTime:28
[Lan] startupBroadCastTime:27
[Lan] startupBroadCastTime:26
scandone
[Lan] startupBroadCastTime:25
[Lan] startupBroadCastTime:24
pm open,type:0 0
[Lan] startupBroadCastTime:23
[Lan] startupBroadCastTime:22
[Lan] startupBroadCastTime:21
[Lan] startupBroadCastTime:20
[Lan] startupBroadCastTime:19
[WiFiEvent]  IN Test Mode. cnt: 3
sl
[Lan] startupBroadCastTime:18
[Lan] startupBroadCastTime:17
[Lan] startupBroadCastTime:16
scandone
usl
[Lan] startupBroadCastTime:15
[Lan] startupBroadCastTime:14
[Lan] startupBroadCastTime:13
[Lan] startupBroadCastTime:12
[Lan] startupBroadCastTime:11
[Lan] startupBroadCastTime:10
[Lan] startupBroadCastTime:9
[WiFiEvent]  IN Test Mode. cnt: 4
sl
[Lan] startupBroadCastTime:8
[Lan] startupBroadCastTime:7
[Lan] startupBroadCastTime:6
scandone
usl
[Lan] startupBroadCastTime:5
[Lan] startupBroadCastTime:4
[Lan] startupBroadCastTime:3
[Lan] startupBroadCastTime:2
[Lan] startupBroadCastTime:1
[Lan] startupBroadCastTime:0
[Dev]  Save gagent config data
[WiFiEvent]  IN Test Mode. cnt: 5
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 6
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 7
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 8
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 9
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 10
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 11
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 12
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 13
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 14
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 15
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 16
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 17
sl
scandone
usl
[WiFiEvent]  IN Test Mode. cnt: 18
sl
scandone
usl
[WiFiEvent] Exit Test Mode...
[Timer] gagentTimerDel System has been locked.
[WiFiEvent] restore to connect cache router
state: 5 -> 0 (0)
rm 0
pm close 7
[WiFiEvent] disconnect from ssid TP-LINK_4A2EBA, reason 8
[NWK] NWK_WIFI_STA_DISCONNECTED
[Timer]  gagentTimerDel startupUdpBroadcastTick has not linked.
[Timer]  gagentTimerDel <null> has not linked.
[NWK]  haiNwkStatus: 0x000A, gagentStatus: 0x030A
[Timer]  gagentTimerDel <null> has not linked.
[Local] GAgentStatus change, lastGAgentStatus:0x131A, newGAgentStatus:0x030A
@@@@ GAgentStatus[hex]:30a | [Bin]:0,0,1,0,1,0
OnBoarding: Station mode
WiFi status: disconnected router
WiFi status: out test mode
RSSI 3
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt

connected with TP-LINK_4A2EBA, channel 11
dhcp client start...
[WiFiEvent] connect to ssid TP-LINK_4A2EBA, channel 11
ip:192.168.2.104,mask:255.255.255.0,gw:192.168.2.1
[WiFiEvent] ip:192.168.2.104,mask:255.255.255.0,gw:192.168.2.1
[NWK] NWK_WIFI_STA_CONNECTED
[NWK] GAgent_CreateUDPServer creat success
[GServer]  Not ip, Go to GServer DNS.
[FR]  dns: api.gizwits.com found null obj. idex: 0
[Dev]  Save gagent config data
[FR]  Cancle router connect monitor.
[NWK]  haiNwkStatus: 0x001A, gagentStatus: 0x031A
[FR]  frDnsIpFound dns ip found: 119.29.47.111
[FR]  frFaultProgress FR_DNS_RESULT.
[GServer]  DNS GServer ip is change. old GServer_ip : 0.0.0.0
[Dev]  Save gagent config data
[GServer]  DNS result GServer_ip : 119.29.47.111
[Timer]  gagentTimerDel <null> has not linked.
[GServer] Had did,did = gG9nSDMGpHvABpsaMybBHV!!!!go to provision.
[GServer] http connect succeed !!!
[Local] GAgentStatus change, lastGAgentStatus:0x030A, newGAgentStatus:0x031A
@@@@ GAgentStatus[hex]:31a | [Bin]:0,1,1,0,1,0
OnBoarding: Station mode
WiFi status: connected router
RSSI 3
[GServer] Provision OK!
[GServer] M2M host:sandbox.gizwits.com port:1883
[GServer] GAgent go to login M2M!
[M2M]  flash m2m domain: sandbox.gizwits.com, now domain: sandbox.gizwits.com
[M2M]  Not ip, Go to M2M DNS.
[FR]  dns: sandbox.gizwits.com found null obj. idex: 0
[GServer] GAgent Provision BizLogLev:00,SysLogLev:00
[GServer] Do not need to disable did,start check ota!
[GServer] Start check ota!!
[LogServer]  ip: w0?9.48.145, port: 1884
[LogServer]  Socket: logServer connect ret = 0
[FR]  frDnsIpFound dns ip found: 203.195.142.207
[FR]  frFaultProgress FR_DNS_RESULT.
[M2M]  DNS M2M ip is change. old m2m_ip : 0.0.0.0
[Dev]  Save gagent config data
[M2M]  DNS result m2m_ip : 203.195.142.207
[M2M] Delete all m2m nodes!
[LogServer]  Socket: logServer connect succeed !!!
[LogServer]  login logServer. ret:0
[LogServer]  Login res ...
[M2M] Req to connect m2m !
[M2M] username: gG9nSDMGpHvABpsaMybBHV password: EBUGPWSHCN
[M2M] M2M ip:203.195.142.207 port:1883
[LogServer]  Login logServer success.
[OTA] OTA http connect success !!!
[Timer]  gagentTimerDel <null> has not linked.
[OTA] GAgent WIFI OTA failed.
[OTA] go to check MCU OTA!
[OTA] ota finish free buf
[Timer]  gagentTimerDel ReConn_Tick has not linked.
[Timer]  gagentTimerDel waitRes_Tick has not linked.
[Timer]  gagentTimerDel <null> has not linked.
[OTA] responsCode fail , responsCode 400
[M2M] Receive mqtt packet is 1
[OTA] OTA http disconnect success !!!
[M2M] GAgent do req connect m2m OK !
[M2M] Go to MQTT_STATUS_REQ_LOGINTOPIC1.
[OTA] OTA http connect success !!!
[M2M] Receive mqtt packet is 1
[M2M] Go to MQTT_STATUS_RES_LOGINTOPIC2.
[M2M] Receive mqtt packet is 1
[M2M]  Go to MQTT_STATUS_RES_LOGINTOPIC3.
[OTA] GAgent MCU OTA failed.
[OTA] ota finish free buf
[Timer]  gagentTimerDel ReConn_Tick has not linked.
[Timer]  gagentTimerDel waitRes_Tick has not linked.
[Timer]  gagentTimerDel <null> has not linked.
[OTA] responsCode fail , responsCode 400
[OTA] OTA http disconnect success !!!
[M2M] Receive mqtt packet is 1
[M2M] GAgent Cloud Working...

0

主题

3

帖子

131

积分

注册会员

Rank: 2

积分
131
沙发
发表于 2017-7-18 21:00:19 | 只看该作者
请问ESP8266进入airlink模式怎么设置啊

点评

SOC开发方案下: 在 user_main.c 中使用 : gizwitsSetMode(WIFI_AIRLINK_MODE); 设置为AirLink模式, 但是,不能在 user_init(void) 方法中调用 该方法,模块会初始化失败,并死循环; 也不能 在 system_init_done_  详情 回复 发表于 2017-7-18 22:19

3

主题

6

帖子

80

积分

注册会员

Rank: 2

积分
80
板凳
 楼主| 发表于 2017-7-18 22:19:51 | 只看该作者
本帖最后由 元源 于 2017-7-18 22:32 编辑
wudi 发表于 2017-7-18 21:00
请问ESP8266进入airlink模式怎么设置啊

SOC开发方案下:

在 user_main.c 中使用 : gizwitsSetMode(WIFI_AIRLINK_MODE); 设置为AirLink模式,
但是,不能在 user_init(void) 方法中调用 该方法,模块会初始化失败,并死循环;
也不能 在 system_init_done_cb 注册的回调方法中调用该方法,模块也无法正常初始化。

目前我只在定时器回调方法 userTimerFunc 内调用 gizwitsSetMode(WIFI_AIRLINK_MODE); 成功设置为AirLink模式!!!

(我并不了解固件内核初始化运行逻辑,ESP8266官网文档 和 机智云官网文档 上没有说明固件初始化逻辑顺序,也有可能我没有找到这些文档!)

模块初始化时,使用定时器回调修改模式,本人认为不是正途。模块可能跑飞!

(就是因为不了解逻辑顺序,所以才处处小心!)

还有一种方式就是使用 任务事件,比如向 gizwitsUserTask(任务,我理解为线程) 发送一个自定义 事件,然后再在gizwitsUserTask 中响应该事件时,调用gizwitsSetMode(WIFI_AIRLINK_MODE) 修改模式,这个方法我还没有试过。

等候官方回复 ESP8266通电时如何直接进入 AirLink 模式,而不是进入 Test 模式!


0

主题

3

帖子

131

积分

注册会员

Rank: 2

积分
131
地板
发表于 2017-7-19 20:54:49 | 只看该作者
恩恩谢谢 再问一下 你是用的什么开发环境 eclipse吗
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

加入Q群 返回顶部

版权与免责声明 © 2006-2024 Gizwits IoT Technology Co., Ltd. ( 粤ICP备11090211号 )

快速回复 返回顶部 返回列表