Blufi Sample code Error or Bug??

YutingLin
Posts: 12
Joined: Wed Dec 12, 2018 6:14 am

Blufi Sample code Error or Bug??

Postby YutingLin » Fri Dec 21, 2018 7:16 am

請問!!

在測試 Blufi Sample code 時發現一個問題

就是當我 WiFi 基地台設定好並且也連上線之後
會報 BT 底層錯誤,然後 APP 就無法連上 device

Code: Select all

I (485) boot: Loaded app from partition at offset 0x10000
I (485) boot: Disabling RNG early entropy source...
I (486) cpu_start: Pro cpu up.
I (489) cpu_start: Application information:
I (494) cpu_start: Project name:     blufi_demo
I (500) cpu_start: App version:
I (504) cpu_start: Compile time:     15:02:19
I (509) cpu_start: Compile date:     Dec 21 2018
I (514) cpu_start: ESP-IDF:          v3.3-beta1-44-gda2116f55-dirty
I (521) cpu_start: Starting app cpu, entry point is 0x40081058
I (0) cpu_start: App cpu up.
I (532) heap_init: Initializing. RAM available for dynamic allocation:
I (538) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (545) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (551) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (557) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
I (563) heap_init: At 3FFCB9A0 len 00014660 (81 KiB): DRAM
I (569) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (575) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (582) heap_init: At 400960C8 len 00009F38 (39 KiB): IRAM
I (588) cpu_start: Pro cpu start user code
I (271) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (356) wifi: wifi driver task: 3ffcf0e4, prio:23, stack:3584, core=0
I (356) wifi: wifi firmware version: 328353e
I (356) wifi: config NVS flash: enabled
I (356) wifi: config nano formating: disabled
I (366) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (376) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (406) wifi: Init dynamic tx buffer num: 32
I (406) wifi: Init data frame dynamic rx buffer num: 32
I (406) wifi: Init management frame dynamic rx buffer num: 32
I (406) wifi: Init static rx buffer size: 1600
I (416) wifi: Init static rx buffer num: 10
I (416) wifi: Init dynamic rx buffer num: 32
I (506) phy: phy_version: 4000, b6198fa, Sep  3 2018, 15:11:06, 0, 0
I (506) wifi: mode : sta (24:0a:c4:1c:79:a0)
I (506) BTDM_INIT: BT controller compile version [c6cbbbd]
I (516) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (836) BLUFI_EXAMPLE: BD ADDR: 24:0a:c4:1c:79:a2

I (836) BLUFI_EXAMPLE: BLUFI VERSION 0102

I (836) BLUFI_EXAMPLE: BLUFI init finish

I (12846) wifi: new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
I (13826) wifi: state: init -> auth (b0)
I (13856) wifi: state: auth -> assoc (0)
I (13866) wifi: state: assoc -> run (10)
I (13876) wifi: connected with SmartDesignTest, channel 1, bssid = d2:57:7b:0c:31:22
I (13876) wifi: pm start, type: 1

I (16356) event: sta ip: 192.168.137.108, mask: 255.255.255.0, gw: 192.168.137.1
I (16356) BLUFI_EXAMPLE: SYSTEM_EVENT_STA_GOT_IP

W (16356) BT_GATT: gatt_if out of range [ = 0]
E (16366) BT_APPL: Unknown connection ID: 0 fail sending notification
W (16366) BT_GATT: gatt_if out of range [ = 0]
E (16376) BT_APPL: Unknown connection ID: 0 fail sending notification
W (16386) BT_GATT: gatt_if out of range [ = 0]
E (16386) BT_APPL: Unknown connection ID: 0 fail sending notification
請問這樣是正常的嗎??

YutingLin
Posts: 12
Joined: Wed Dec 12, 2018 6:14 am

Re: Blufi Sample code Error or Bug??

Postby YutingLin » Fri Dec 21, 2018 8:49 am

訊息更正!!

出現上訴底層錯誤時
APP 還是可以看的到 device

但是當我連線設定開始重新設定 WiFi 資料時
會出現下方錯誤

Code: Select all

I (25417) wifi: state: run -> init (0)
I (25417) wifi: pm stop, total sleep time: 22019630 us / 23572255 us

I (25417) wifi: new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
I (25437) wifi: flush txq
I (25437) wifi: stop sw txq
I (25437) wifi: lmac stop hw txq
E (25437) wifi: esp_wifi_connect 951 wifi not start
I (25437) BLUFI_EXAMPLE: BLUFI ble connect

E (28297) BT_BTC: btc_blufi_recv_handler seq 0 is not expect 5

E (28297) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (28417) BT_BTC: btc_blufi_recv_handler seq 1 is not expect 5

E (28427) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (28507) BT_BTC: btc_blufi_recv_handler seq 2 is not expect 5

E (28517) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (28647) BT_BTC: btc_blufi_recv_handler seq 3 is not expect 5

E (28647) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (29427) BT_BTC: btc_blufi_recv_handler seq 0 is not expect 5

E (29427) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (29457) BT_BTC: btc_blufi_recv_handler seq 1 is not expect 5

E (29457) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (29547) BT_BTC: btc_blufi_recv_handler seq 2 is not expect 5

E (29547) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (29637) BT_BTC: btc_blufi_recv_handler seq 3 is not expect 5

E (29637) BLUFI_EXAMPLE: BLUFI report error, error code 0

I (30757) BLUFI_EXAMPLE: BLUFI ble disconnect
本以為 WiFi 與 BLE 無法同時使用
但是當我在進入 callback BLUFI ble connect event 時將 WiFi Stop 並 disconnect
一樣也不行!!

謝謝!!

YutingLin
Posts: 12
Joined: Wed Dec 12, 2018 6:14 am

Re: Blufi Sample code Error or Bug??

Postby YutingLin » Fri Dec 21, 2018 10:02 am

補充測試說明!!

當設定過一次後 Device 斷電後再上電會自動連線 WiFi
才會出現下列錯誤訊息

Code: Select all

W (20353) BT_GATT: gatt_if out of range [ = 0]
E (20363) BT_APPL: Unknown connection ID: 0 fail sending notification
W (20363) BT_GATT: gatt_if out of range [ = 0]
E (20373) BT_APPL: Unknown connection ID: 0 fail sending notification
W (20383) BT_GATT: gatt_if out of range [ = 0]
E (20383) BT_APPL: Unknown connection ID: 0 fail sending notification
我嘗試 WiFi AP 先關閉
device 上電後先透過 BLE 設定一次
再開啟 WiFi AP 連線後會出現不一樣的錯誤

Code: Select all

E (69353) BT_APPL: Unknown connection ID: 3 fail sending notification
但是當我再次做 BLE 設定後會出現無法設定的錯誤
我再次透過 BLE 設定就會正常,並且不會報錯,而且之後再透過 BLE 設定就都正常不會再有 Error
Log 如下

Code: Select all

I (482) boot: Loaded app from partition at offset 0x10000
I (482) boot: Disabling RNG early entropy source...
I (483) cpu_start: Pro cpu up.
I (486) cpu_start: Application information:
I (491) cpu_start: Project name:     blufi_demo
I (496) cpu_start: App version:
I (501) cpu_start: Compile time:     17:01:14
I (506) cpu_start: Compile date:     Dec 21 2018
I (511) cpu_start: ESP-IDF:          v3.3-beta1-44-gda2116f55-dirty
I (518) cpu_start: Starting app cpu, entry point is 0x40081058
I (0) cpu_start: App cpu up.
I (529) heap_init: Initializing. RAM available for dynamic allocation:
I (535) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (541) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (548) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (554) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM
I (560) heap_init: At 3FFCB988 len 00014678 (81 KiB): DRAM
I (566) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (572) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (579) heap_init: At 400960C8 len 00009F38 (39 KiB): IRAM
I (585) cpu_start: Pro cpu start user code
I (267) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (353) wifi: wifi driver task: 3ffcf0cc, prio:23, stack:3584, core=0
I (353) wifi: wifi firmware version: 328353e
I (353) wifi: config NVS flash: enabled
I (353) wifi: config nano formating: disabled
I (363) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (373) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (403) wifi: Init dynamic tx buffer num: 32
I (403) wifi: Init data frame dynamic rx buffer num: 32
I (403) wifi: Init management frame dynamic rx buffer num: 32
I (403) wifi: Init static rx buffer size: 1600
I (413) wifi: Init static rx buffer num: 10
I (413) wifi: Init dynamic rx buffer num: 32
I (483) phy: phy_version: 4000, b6198fa, Sep  3 2018, 15:11:06, 0, 0
I (483) wifi: mode : sta (24:0a:c4:1c:79:a0)
I (483) BTDM_INIT: BT controller compile version [c6cbbbd]
I (493) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (813) BLUFI_EXAMPLE: BD ADDR: 24:0a:c4:1c:79:a2

I (813) BLUFI_EXAMPLE: BLUFI VERSION 0102

I (813) BLUFI_EXAMPLE: BLUFI init finish

I (23013) BLUFI_EXAMPLE: BLUFI ble connect

I (33273) BLUFI_EXAMPLE: BLUFI Set WIFI opmode 1

I (33543) BLUFI_EXAMPLE: Recv STA SSID SmartDesignTest

I (33633) BLUFI_EXAMPLE: Recv STA PASSWORD 28216728

I (33723) BLUFI_EXAMPLE: BLUFI requset wifi connect to AP

I (60143) BLUFI_EXAMPLE: BLUFI ble disconnect

I (65853) wifi: new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (66833) wifi: state: init -> auth (b0)
I (66843) wifi: state: auth -> assoc (0)
I (66853) wifi: state: assoc -> run (10)
I (66863) wifi: connected with SmartDesignTest, channel 6, bssid = d2:57:7b:0c:31:22
I (66863) wifi: pm start, type: 1

I (69353) event: sta ip: 192.168.137.253, mask: 255.255.255.0, gw: 192.168.137.1
I (69353) BLUFI_EXAMPLE: SYSTEM_EVENT_STA_GOT_IP

E (69353) BT_APPL: Unknown connection ID: 3 fail sending notification
I (113103) BLUFI_EXAMPLE: BLUFI ble connect

E (124173) BT_BTC: btc_blufi_recv_handler seq 0 is not expect 5

E (124173) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (124253) BT_BTC: btc_blufi_recv_handler seq 1 is not expect 5

E (124263) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (124343) BT_BTC: btc_blufi_recv_handler seq 2 is not expect 5

E (124353) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (124483) BT_BTC: btc_blufi_recv_handler seq 3 is not expect 5

E (124483) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (133313) BT_BTC: btc_blufi_recv_handler seq 0 is not expect 5

E (133313) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (133393) BT_BTC: btc_blufi_recv_handler seq 1 is not expect 5

E (133393) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (133483) BT_BTC: btc_blufi_recv_handler seq 2 is not expect 5

E (133483) BLUFI_EXAMPLE: BLUFI report error, error code 0

E (133573) BT_BTC: btc_blufi_recv_handler seq 3 is not expect 5

E (133573) BLUFI_EXAMPLE: BLUFI report error, error code 0

I (134693) BLUFI_EXAMPLE: BLUFI ble disconnect

I (175653) BLUFI_EXAMPLE: BLUFI ble connect

I (186083) BLUFI_EXAMPLE: BLUFI Set WIFI opmode 1

I (186353) BLUFI_EXAMPLE: Recv STA SSID SmartDesignTest

I (186493) BLUFI_EXAMPLE: Recv STA PASSWORD 28216728

I (186583) BLUFI_EXAMPLE: BLUFI requset wifi connect to AP

I (186583) wifi: state: run -> init (0)
I (186583) wifi: pm stop, total sleep time: 112974651 us / 119724629 us

I (186593) wifi: new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
I (187323) wifi: new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
I (188313) wifi: state: init -> auth (b0)
I (188323) wifi: state: auth -> assoc (0)
I (188333) wifi: state: assoc -> run (10)
I (188393) wifi: connected with SmartDesignTest, channel 6, bssid = d2:57:7b:0c:31:22
I (188393) wifi: pm start, type: 1

I (189853) event: sta ip: 192.168.137.253, mask: 255.255.255.0, gw: 192.168.137.1
I (189853) BLUFI_EXAMPLE: SYSTEM_EVENT_STA_GOT_IP

I (190993) BLUFI_EXAMPLE: BLUFI ble disconnect
因為這些 Error 都是底層無法 trace
所以不知該如何解決!!

也或許是我不孰悉的關係
所以有那邊的操作錯誤
還請知道的人指繳
謝謝!!

Weijian-Espressif
Posts: 29
Joined: Wed Aug 09, 2017 6:16 am

Re: Blufi Sample code Error or Bug??

Postby Weijian-Espressif » Mon Dec 24, 2018 7:49 am

1. send notification 报错是因为wifi 状态发生了改变, blufi 会将report 发送给手机, 如果此时蓝牙已经断开, 会出现这个错误
2. blufi 每发送一条指令, 序列号会自动加1, 蓝牙断开会把序列号清零. btc_blufi_recv_handler seq 0 is not expect 5 出现这种错误是因为序列号错误, 之前已经有设备连接上blufi,没有断开, 又有新的设备连接上blufi. 新的设备发送指令序列号是从0开始的, 这就导致序列号不匹配报错

Who is online

Users browsing this forum: No registered users and 53 guests