espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

The connection of the device is lost when the mobile APP is connected (MEGH-4593) #261

Open perseverance51 opened 1 year ago

perseverance51 commented 1 year ago

Answers checklist.

IDF / ESP32-Arduino version.

ESP-IDF v4.4.4-dirty

Operating System used.

Windows

How did you build your project?

Command line with idf.py

Development Kit.

ESP-IDF4.4

What is the expected behavior?

The APP searches for the ESPThe sample project of esp-rainmaker\examples\switch compiled by espidf 4.4 was uploaded to the esp32 devkit v1 device. After searching for the Bluetooth device of ESP32, the mobile APP clicked Connect, but the device disappeared immediately.32 Bluetooth device, clicks Connect, and the device disappears again.

What is the actual behavior?

The APP searches for the ESP32 Bluetooth device, clicks Connect, and the device disappears again.

Steps to reproduce.

When you search for an esp32 Bluetooth device, click on the connected device and it disappears。 Screenshot_2023-04-21-13-28-53

Screenshot_2023-04-21-13-28-37

Debug Logs.

[13:13:37.523] I (1952) app_wifi: If QR code is not visible, copy paste the below URL in a browser.
[13:13:37.523] https://rainmaker.espressif.com/qrcode.html?data={"ver":"v1","name":"PROV_518642","pop":"ed768537","transport":"ble"}
[13:13:37.523] I (1962) app_main: Provisioning QR : {"ver":"v1","name":"PROV_518642","pop":"ed768537","transport":"ble"}
[13:13:37.523] I (1972) app_wifi: Provisioning Started. Name : PROV_518642, POP : ed768537
[13:13:37.523] I (1982) app_wifi: Provisioning will auto stop after 30 minute(s).
[13:13:37.523] 
[13:13:51.060] I (15542) NimBLE: GAP procedure initiated: advertise; 
[13:13:51.082] I (15542) NimBLE: disc_mode=2
[13:13:51.082] I (15542) NimBLE:  adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=256 adv_itvl_max=256
[13:13:51.082] I (15552) NimBLE: 
[13:13:51.082] 
[13:13:51.082] 
[13:13:58.518] I (23002) NimBLE: GAP procedure initiated: advertise; 
[13:13:58.541] I (23002) NimBLE: disc_mode=2
[13:13:58.541] I (23002) NimBLE:  adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=256 adv_itvl_max=256
[13:13:58.541] I (23002) NimBLE: 
[13:13:58.541] 
[13:13:58.541]

More Information.

No response

KhushbuShah25 commented 1 year ago

Hi @perseverance51 , What is the android app version ? Is it possible to share android app logs ?

perseverance51 commented 1 year ago

Hi @perseverance51 , What is the android app version ? Is it possible to share android app logs ?

I tested all of the following apps: ESP_RainMaker_2.10.1, 2.8.0, and ESP_BLE_Prov_2.1.0. I also tested the ESP RainMaker routine burning with the Arduino IDE and connected to the mobile APP.

shahpiyushv commented 1 year ago

@shukur-alom , your query has been answered here. Just as an additional note, please avoid asking questions on issues unrelated to yours. This specific issue is about provisioning itself failing that too with esp-idf. Your issue is about device not reconnecting after losing Wi-Fi, that too (most probably) with Arduino.

shahpiyushv commented 1 year ago

@perseverance51 , can you enable additional debug logs using idf.py menuconfig and retry?

Component Config --> Log Output --> Default Log Verbosity --> Debug

Component Config --> Bluetooth --> NimBLE Options --> NimBLE Host log verbosity --> Debug Logs

Meanwhile, what is your phone model and Android version? Have you tried with a different phone?

perseverance51 commented 1 year ago

@shahpiyushv I can connect to esp32 using other Bluetooth debugging apps. When I disconnected the ESP32 ble device and went back to the ESP RainMaker APP interface to try to connect to esp32, I was able to pull up the connection and successfully connect to the device. I'm not sure if it's because the third-party Bluetooth APP debug assistant successfully logged in or something. Screenshot_2023-04-30-13-24-46

perseverance51 commented 1 year ago

The same thing happens when you add a new esp32 Bluetooth device, so as long as the connected device has been successfully connected before and then re-paired, it won't be disconnected again.

`

perseverance51 commented 1 year ago

Below is the phone and Bluetooth information used

20230430174931

20230430175340

shahpiyushv commented 1 year ago

@perseverance51 , we have never seen this issue and can't even reproduce and so, it is hard to debug. Have you tried changing either the phone or the board?