arduino-XboxSeriesXControllerESP32
arduino-XboxSeriesXControllerESP32 copied to clipboard
Connection is not the first time
Hello! I'm using Xbox Series S controller (1914, version 5.15.3168.0) and an ESP32 dev board. The connection can't be established the first time. Needed a long time for a connection (2-5 attempts). The main error log is:
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
E NimBLEClient: Connection failed; status=574
I read a lot about this problem, but have not found the solution. Can you help with this? logs.txt
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
The error often happens. Basically (about 80%) retrying resolves it but sometimes reset of ESP32 is required to resolve.
The connection can't be established the first time.
Your log seems connected to your controller. Do you want to establish connection without the error? If yes, I also want to know the way.
Related issues. https://github.com/h2zero/NimBLE-Arduino/issues/417 https://github.com/h2zero/NimBLE-Arduino/issues/293
Thanks for the fast answer! Yes, I want to establish a connection without error. I found a lot of GitHub issues with the error (as I understand nobody doesn`t know the true reason for this error):
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
About the Xbox controller
I have a 1914 Xbox controller model. As you can see in the following image this controller has HID over GATT Profile. And I think the model 1914 has a BLE 5.0 or higher version (if you know the BLE version of model 1914 please tell me).
https://en.wikipedia.org/wiki/Xbox_Wireless_Controller
But the ESP32 does not have the BLE 5.0 full support. Maybe our error is related to this.
https://espressif-docs.readthedocs-hosted.com/projects/espressif-esp-faq/en/latest/software-framework/ble-bt.html
I think the ESP32 can properly connect and work with the Xbox controller model 1708 (if you tested this case please tell me).
ESP-IDF Test (examples\bluetooth\esp_hid_host)
Also, I test the basic ESP-IDF example with my Xbox controller. The problem is the same.
esp_gatt_defs.h
My future steps
- In the near future, I can test the ESP32 with Xbox controller model 1708. I know this model uses classic Bluetooth, but I want to try this.
- Also, I want to test the model 1914 with some NRF chips (like nrf52).
Additional info
- Sometimes if call the notify() function in the loop very often I have the same problem with "packet count mismatch". I think this happened because the hardware part of the BLE controller failed to work at high speed.
- The "packet count mismatch" error occurs with the NimBLE and Bluedroid stack.
Thank you very much for the information.
But the ESP32 does not have the BLE 5.0 full support. Maybe our error is related to this.
Oh, I don't care about BLE version. If the reason of problem is difference of version, I need to use different IC as you say.
Xbox controller model 1708 (if you tested this case please tell me).
No, I didn't.
By the way, I'm creating a project that receiver of wireless controller as I2C device. If nrf52 can handle xbox series x controller without error, I want to support it. https://github.com/asukiaaa/arduino-ControllerAsI2c
I will send the results of the test with Xbox controller model 1914 and nRF52832 within a few weeks
If nrf52 can handle xbox series x controller without error, I want to support it.
ESP32-S3 or C3 support BLE 5.0 , it could be a good choice
I tried with using bluefruit feather nrf52832 and it works well than ESP32. https://github.com/asukiaaa/nrf52-bluefluit-xbox-controller-practice
ESP32-S3 or C3 support BLE 5.0 , it could be a good choice
Thank you for the information. I'm happy if some one try.
I have tried with ESP32-C3 and the connection is more stable than ESP32.
Thank you for the information.
Is there no lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
error?
I tried ESP32C3 and it does not occur lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
error so it may problem IC of normal ESP32.
I add comment about this on readme. https://github.com/asukiaaa/arduino-XboxSeriesXControllerESP32/commit/0507c32a3058733df9dddf00eb71cd986f7e5645