bluepad32 icon indicating copy to clipboard operation
bluepad32 copied to clipboard

[Bug]: Joy con left and Joy con right cannot be connected at the same time.

Open LSatan opened this issue 7 months ago • 10 comments

What happened?

The Nintendo Switch Joycons cannot be connected at the same time. individually it works e.g. only Joy Con Left or only Joy Con Right. When I have connected the Joy Con Left and then I want to connect the Joy Con Right, it comes:

uni_hid_device_disconnect: Unknown GAP connection type: 0 Failed to inquiry name for 50:23:6D:B9:78:44, using a fake one

Bluepad32 Version

4.1.0

Platform version

Arduino IDE 2.3.2

Controller

Nintendo Switch JoyCon (Original)

Microcontroller

ESP32

Microcontroller board

ESP32-WROOM-32

Relevant sketch

Controller.ino

LSatan avatar May 02 '25 23:05 LSatan

Generally, multiple devices can be connected. For example, a Bluetooth keyboard, an Xbox One controller, and one of the two Joy-Cons. It seems to me that it doesn't work with devices that have the same vendor ID.

LSatan avatar May 03 '25 18:05 LSatan

You might be triggering this bug: https://gitlab.com/ricardoquesada/bluepad32/-/issues/12

TL;DR: Probably an ESP32 bug.

Do you have any other ESP32 module to try with ?

ricardoquesada avatar May 04 '25 01:05 ricardoquesada

You might be triggering this bug: https://gitlab.com/ricardoquesada/bluepad32/-/issues/12

TL;DR: Probably an ESP32 bug.

Do you have any other ESP32 module to try with ?

I tested it with a node 32 S with the same result. The guys from bug #12 were apparently able to connect both controllers, but the watchdog hung up. What the serial monitor spits out is more similar to the error from: https://github.com/ricardoquesada/bluepad32/issues/135#issuecomment-2576274636 unfortunately I am not familiar with ESP-IDF to test it with it. But I could also order another esp32 to test it. Can you recommend one? In bug #12 you wrote at the end that you were able to connect 4 joycons without any problems. Did you also try it with Arduino Ide or was it with a different platform?

LSatan avatar May 04 '25 02:05 LSatan

yes, if you try esp-idf, it will be easier to debug it. since we have the logs.

You can try PlatformIO, which is easy easier to use the regular esp-idf. instructions here: https://github.com/ricardoquesada/esp-idf-arduino-bluepad32-template

ricardoquesada avatar May 04 '25 04:05 ricardoquesada

I'll test the Visual Studio Code example. I've already worked with it. Thanks for the support. Great project. I'll give you feedback on whether it worked.

LSatan avatar May 04 '25 13:05 LSatan

Unfortunately, it's all very frustrating at the moment. I'll try the first example with platform io. I have done everything as described in the instructions. But somehow it keeps complaining that it can't find the main folder for the project. But actually it is there. I wonder what's going wrong. I'll knock everything down tomorrow and redo it. Too bad it doesn't run on the Arduino IDE. Should actually be possible. I wonder if it is due to BTStack or components of the integrated esp lib (with Arduino IDE)?

LSatan avatar May 05 '25 00:05 LSatan

ARduino IDE should not affect this bug. From my experience, not all ESP32 modules are "created equal".

Try to remove all previous installations of platformio, and the platformio cached files... and start again from step 1. It should work.

ricardoquesada avatar May 05 '25 03:05 ricardoquesada

Yes, it may be that not all esp modules are the same. But if it works with another platform and not with Arduino, then it should be a software and not a hardware problem. At whatever point. But I will try to get it working on the other platform first.

LSatan avatar May 05 '25 07:05 LSatan

Just ran into this same identical problem with the same error messages.

Individually JoyCon Left is VID=0x057e, PID=0x2006, JoyCon Right is VID=0x057e, PID=0x2007

Arduino IDE 2.3.6, Bluepad32 4.1.0 M5Stack Atom Lite, which should be a Pico-D4 ESP32. Using the example Controller code

Turning the connected controller off first allows connection to the second controller after disconnection, i.e.,

uni_hid_device_disconnect: Unknown GAP connection type: 0 uni_hid_device_disconnect: Unknown GAP connection type: 0 uni_hid_device_disconnect: Unknown GAP connection type: 0 CALLBACK: Controller disconnected from index=0 CALLBACK: Controller is connected, index=0 Controller model: Switch JoyCon Left, VID=0x057e, PID=0x2006 idx=0, dpad: 0x00, buttons: 0x0000, axis L: -9, 11, axis R: 0, 0, brake: 0, throttle: 0, misc: 0x00, gyro x: 23973 y: 13000 z:-18015, accel x: 562 y: -4072 z: -332 idx=0, dpad: 0x00, buttons: 0x0000, axis L: -9, 11, axis R: 0, 0, brake: 0, throttle: 0, misc: 0x00, gyro x: 8990 y: 3000 z:-10008, accel x: 556 y: -4044 z: -359

madoxnet avatar Jul 02 '25 11:07 madoxnet

I have the same issue with the Dualsense controllers

20:40:34.921 -> CALLBACK: Controller is connected, index=0
20:40:34.921 -> DConStrol5ler :mode l: DFualSaensei, VIlD=0xe054cd, PI D=0xt0ce6o
20:40:34.921 ->  create virtual device
20:40:46.409 -> uni_hid_device_disconnect: Unknown GAP connection type: 0
20:40:51.009 -> Failed to inquiry name for AC:36:1B:53:48:14, using a fake one

Dendrowen avatar Oct 06 '25 18:10 Dendrowen