Brikwerk / nxbt

Control your Nintendo Switch through a website, terminal, or macro.
MIT License
815 stars 100 forks source link

Failing to connect on Raspberry #45

Closed Fredi100 closed 2 years ago

Fredi100 commented 2 years ago

I am currently trying to connect my Raspberry with my Switch but I can't get it to work. My Switch is on Version 13.2.0 and i am using a TP-Link UB500 which is using Bluetooth 5.0.

When I am using sudo nxbt test i got following output:

pi@raspberrypi:~ $ sudo nxbt test
[1] Attempting to initialize NXBT...
Successfully initialized NXBT.

[2] Checking for Bluetooth adapter availability...
1 Bluetooth adapter(s) available.
Adapters: ['/org/bluez/hci0']

[3] Please turn on your Switch and navigate to the 'Change Grip/Order menu.'
Press Enter to continue...
Creating a controller with the first Bluetooth adapter...
Successfully created a controller.

[4] Waiting for controller to connect with the Switch...
Connection timeout is 120 seconds for this test script.
Timeout reached, exiting...

I had bluetoothctl open during the test and got following output:

pi@raspberrypi:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# show
Controller E8:48:B8:C8:20:00 (public)
        Name: BlueZ 5.55
        Alias: Pro Controller
        Class: 0x00200000
        Powered: yes
        Discoverable: yes
        DiscoverableTimeout: 0x000000b4
        Pairable: yes
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0537
        Discovering: no
        Roles: central
        Roles: peripheral
Advertising Features:
        ActiveInstances: 0x00 (0)
        SupportedInstances: 0x04 (4)
        SupportedIncludes: tx-power
        SupportedIncludes: appearance
        SupportedIncludes: local-name
        SupportedSecondaryChannels: 1M
        SupportedSecondaryChannels: 2M
        SupportedSecondaryChannels: Coded
[CHG] Controller E8:48:B8:C8:20:00 Discoverable: no
[CHG] Controller E8:48:B8:C8:20:00 Powered: no
[CHG] Controller E8:48:B8:C8:20:00 Discovering: no
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00000000
Agent unregistered
[DEL] Controller E8:48:B8:C8:20:00 Pro Controller [default]
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00000000
Agent registered
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00200000
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 PairableTimeout: 0x00000000
[CHG] Controller E8:48:B8:C8:20:00 DiscoverableTimeout: 0x000000b4
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 Discoverable: yes
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00002508
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00200000
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 Discoverable: no
[CHG] Controller E8:48:B8:C8:20:00 Powered: no
[CHG] Controller E8:48:B8:C8:20:00 Discovering: no
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00000000
Agent unregistered
[DEL] Controller E8:48:B8:C8:20:00 Pro Controller [default]
Agent registered
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00000000
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x00040000
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x000c0000
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 Class: 0x002c0000
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller E8:48:B8:C8:20:00 Name: raspberrypi
Brikwerk commented 2 years ago

From your bluetoothctl log, it seems that the Switch isn't seeing the Bluetooth adapter on your Raspberry Pi. Do you have another adapter you could possibly test? I'm guessing your Raspberry Pi doesn't have an internal bluetooth module?

Could you also re-run sudo nxbt test and have either your phone or laptop scan for bluetooth devices? Eg: on an iPhone, you would go to the Settings app, open the Bluetooth menu, and watch for results there. While sudo nxbt test is running, you should see Pro Controller pop up on either your phone or laptop's bluetooth menu. If it doesn't come up, this might be a case of the adapter being off or another visibility issue.

Fredi100 commented 2 years ago

Thanks for your suggestions. Sadly I dont have another Bluetooth adapter and my Raspberry Pi 3 doesn't have a Bluetooth module. I tried running sudo nxbt test but my phone didn't find any new devices so it seems as if this adapter just doesn't work. But I realized that I also have a Raspberry 4 which should have an integrated module. With my Raspberry 4 the sudo nxbt test actually created a Pro Controller which my phone could find. After bricking the Bluetooth module and having to restart the Pi I even managed to connect to the Switch.