espressif / esp-idf-provisioning-android

Android Provisioning application for ESP-IDF Unified provisioning
Apache License 2.0
202 stars 133 forks source link

Intermitent issue when try to provision device #79

Closed puma-neivor closed 1 year ago

puma-neivor commented 1 year ago

On some devices sometimes the provisioning process gets stuck on the connectBLEDevice call, when I debug my device I got this error stacktrace:

I (0) cpu_start: App cpu up.
I (504) cpu_start: Pro cpu start user code
I (504) cpu_start: cpu freq: 160000000
I (504) cpu_start: Application information:
I (508) cpu_start: Project name:     wifi_prov_mgr
I (514) cpu_start: App version:      1
I (518) cpu_start: Compile time:     Dec 28 2022 13:29:18
I (524) cpu_start: ELF file SHA256:  041cdda80acaa3e2...
I (530) cpu_start: ESP-IDF:          v4.4.1-dirty
I (536) heap_init: Initializing. RAM available for dynamic allocation:
I (543) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (549) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (555) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (561) heap_init: At 3FFC8F18 len 000170E8 (92 KiB): DRAM
I (567) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (574) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (580) heap_init: At 4009CD8C len 00003274 (12 KiB): IRAM
I (588) spi_flash: detected chip: generic
I (591) spi_flash: flash io: dio
I (596) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (708) wifi:wifi driver task: 3ffce024, prio:23, stack:6656, core=0
I (708) system_api: Base MAC address is not set
I (708) system_api: read default base MAC address from EFUSE
I (738) wifi:wifi firmware version: 63017e0
I (738) wifi:wifi certification version: v7.0
I (738) wifi:config NVS flash: enabled
I (738) wifi:config nano formating: disabled
I (738) wifi:Init data frame dynamic rx buffer num: 32
I (748) wifi:Init management frame dynamic rx buffer num: 32
I (748) wifi:Init management short buffer num: 32
I (758) wifi:Init dynamic tx buffer num: 32
I (758) wifi:Init static rx buffer size: 1600
I (758) wifi:Init static rx buffer num: 10
I (768) wifi:Init dynamic rx buffer num: 32
I (768) wifi_init: rx ba win: 6
I (778) wifi_init: tcpip mbox: 32
I (778) wifi_init: udp mbox: 6
I (778) wifi_init: tcp mbox: 6
I (788) wifi_init: tcp tx win: 5744
I (788) wifi_init: tcp rx win: 5744
I (798) wifi_init: tcp mss: 1440
I (798) wifi_init: WiFi IRAM OP enabled
I (798) wifi_init: WiFi RX IRAM OP enabled
I (808) wifi_prov_scheme_ble: BT memory released
I (848) app: Starting provisioning
I (858) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (958) wifi:mode : sta (30:c6:f7:b4:57:58)
I (958) wifi:enable tsf
I (958) BTDM_INIT: BT controller compile version [5688ed5]
I (1208) protocomm_nimble: BLE Host Task Started
I (1208) wifi_prov_mgr: Provisioning started with service name : PROV_B45758 
I (1208) app: Provisioning started

This happens all the time when i provision success, then fails, then success, then fail.

Also i have a ANR on the BleScanner, and maybe is relatd.


tid=1 systid=31299
com.espressif.provisioning.device_scanner.BleScanner$2.onScanResult (BleScanner.java:183)
android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run (BluetoothLeScanner.java:558)
android.os.Handler.handleCallback (Handler.java:942)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:201)
android.os.Looper.loop (Looper.java:288)
android.app.ActivityThread.main (ActivityThread.java:7872)
java.lang.reflect.Method.invoke (Native method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)```