Closed an-erd closed 5 years ago
Check disconnect reason (62 = 0x3e): https://github.com/chegewara/esp32-ble-wiki/issues/5
@chegewara Ok, I saw that's 0x3E Connection Failed to be Established
With the other devices it works fine, but with the M5Stack devices I got this problems. I currently have no idea where to start looking for differences and how to maybe debug the lower level communication.
M5-stack is enclosed, it can be problem. Start with testing m5-stack with nRF connect. Check RSSI value, check if you have problem to connect m5-stack from other than esp32 device.
PS As you can see its not easy to write ble app if your device does not cooperate.
I made some more tests and moved the client and server devices. I see an impact. Also, as you mentioned, the enclosure seems to have a significant impact, too. On top there's a display, and then there is a (removable) bottom plate, battery and lot of other stuff inside. Without bottom plate its much better, but still not good enough. Ok, issue is resolved for the moment since I don't have a 95% failure rate anymore.
@chegewara Thanks!
Environment
Development Kit: WEMOS LOLIN32 w/display and M5Stack-FIRE
Module or chip used: ESP32, for all boards
ESP32D0WDQ6 (revision 1)
is usedBuild System: Make
Compiler version: xtensa-esp32-elf-gcc.exe (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 5.2.0
Operating System: Windows
Power Supply: USB
Problem Description
I used the code from the IDF from
esp-idf/examples/bluetooth/gatt_client/main/
and only made the following changes:service UUID
notify char
complete code used
When I use the
WEMOS LOLIN32
boards, everything is fine. I can connect to the service and get notifications. This works in about 99% of the trials. Only sometimes connecting to the service or finding the device does not work. Log file from this successful runs look like:When I used the M5Stack-FIRE device, I experience an issue for almost every try (~90-95%):
Complete Log
I don't now to follow up on this issue. It works with 5 different WEMOS LOLIN boards, and I experience the problem with the M5Stack-FIRE device, which is my target device.
Any ideas?