Bluetooth issues with 8BitDo SN30

Hi,

I have 3 of these controllers that I’m trying to use for a project. I’m having major issues trying to get them to consistently connect and stay connected. I’m currently using my Ubuntu workstation (not an rPi) as a development environment.

$ sudo hciconfig
[sudo] password for james: 
hci0:	Type: BR/EDR  Bus: USB
	BD Address: 00:1A:7D:DA:71:13  ACL MTU: 310:10  SCO MTU: 64:8
	UP RUNNING PSCAN 
	RX bytes:676 acl:0 sco:0 events:47 errors:0
	TX bytes:2463 acl:0 sco:0 commands:47 errors:0

   $ sudo bluetoothctl
    [sudo] password for james: 
    [NEW] Controller 00:1A:7D:DA:71:13 james-ws-ubuntu [default]
    [NEW] Device E4:17:D8:7B:0F:75 8Bitdo SN30 GamePad
    [NEW] Device E4:17:D8:56:0B:7B 8Bitdo SN30 GamePad
    [NEW] Device E4:17:D8:04:0B:7B 8Bitdo SN30 GamePad
    [bluetooth]# paired-devices
    Device E4:17:D8:7B:0F:75 8Bitdo SN30 GamePad
    Device E4:17:D8:56:0B:7B 8Bitdo SN30 GamePad
    Device E4:17:D8:04:0B:7B 8Bitdo SN30 GamePad
    [bluetooth]# scan on
    Discovery started

At this point I press Start to power on each of the three controllers

    [CHG] Device E4:17:D8:04:0B:7B RSSI: -53
    [CHG] Device E4:17:D8:56:0B:7B RSSI: -49
    [bluetooth]# connect E4:17:D8:04:0B:7B
    Attempting to connect to E4:17:D8:04:0B:7B
    [CHG] Device E4:17:D8:04:0B:7B Connected: yes
    Failed to connect: org.bluez.Error.Failed
    [CHG] Device E4:17:D8:04:0B:7B Connected: no
    [bluetooth]# connect E4:17:D8:56:0B:7B
    Attempting to connect to E4:17:D8:56:0B:7B
    [CHG] Device E4:17:D8:56:0B:7B Connected: yes
    Failed to connect: org.bluez.Error.Failed
    [CHG] Device E4:17:D8:56:0B:7B Connected: no

As you can see, only two of the three controllers are even detected in the scan and neither of those two are able to be connected.

Trying them one at a time:

    $ sudo bluetoothctl
    [NEW] Controller 00:1A:7D:DA:71:13 james-ws-ubuntu [default]
    [NEW] Device E4:17:D8:7B:0F:75 8Bitdo SN30 GamePad
    [NEW] Device E4:17:D8:56:0B:7B 8Bitdo SN30 GamePad
    [NEW] Device E4:17:D8:04:0B:7B 8Bitdo SN30 GamePad
    [bluetooth]# scan on
    Discovery started

Pressed Start on one controller only

…nothing. No signal.

Putting that controller back into pairing mode by holding Start + B then holding Select:

    bluetooth]# scan on
    Discovery started
    [CHG] Device E4:17:D8:56:0B:7B RSSI: -57
    [CHG] Device E4:17:D8:56:0B:7B RSSI: -47
    [bluetooth]# pair E4:17:D8:56:0B:7B
    Attempting to pair with E4:17:D8:56:0B:7B
    Failed to pair: org.bluez.Error.AlreadyExists
    [bluetooth]# connect E4:17:D8:56:0B:7B
    Attempting to connect to E4:17:D8:56:0B:7B
    [CHG] Device E4:17:D8:56:0B:7B Connected: yes
    Failed to connect: org.bluez.Error.Failed
    [CHG] Device E4:17:D8:56:0B:7B Connected: no

At that time, this is logged to syslog:

    Sep 12 08:13:29 james-ws-ubuntu bluetoothd[4918]: Can't get HIDP connection info
    Sep 12 08:13:32 james-ws-ubuntu bluetoothd[4918]: connect error: Invalid exchange (52)

Tried explicitly trusting it and pressing Start on the controller to power it on - got a signal this time but - still no good, same error logged to syslog:

    [bluetooth]# trust E4:17:D8:56:0B:7B
    [CHG] Device E4:17:D8:56:0B:7B Trusted: yes
    Changing E4:17:D8:56:0B:7B trust succeeded
    [CHG] Device E4:17:D8:56:0B:7B LegacyPairing: yes
    [CHG] Device E4:17:D8:56:0B:7B RSSI: -81
    [bluetooth]# connect E4:17:D8:56:0B:7B
    Attempting to connect to E4:17:D8:56:0B:7B
    [CHG] Device E4:17:D8:56:0B:7B Connected: yes
    Failed to connect: org.bluez.Error.Failed
    [CHG] Device E4:17:D8:56:0B:7B Connected: no
    [CHG] Device E4:17:D8:56:0B:7B LegacyPairing: no
    [CHG] Device E4:17:D8:56:0B:7B RSSI: -47
    [bluetooth]# info E4:17:D8:56:0B:7B
    Device E4:17:D8:56:0B:7B
    	Name: 8Bitdo SN30 GamePad
    	Alias: 8Bitdo SN30 GamePad
    	Class: 0x002508
    	Icon: input-gaming
    	Paired: yes
    	Trusted: yes
    	Blocked: no
    	Connected: no
    	LegacyPairing: no
    	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
    	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    	Modalias: usb:v2DC8p2862d0100
    	RSSI: -47

Any ideas?

As a side note, I’m not 100% committed to using Bluetooth for this project. If I can get some other simpler wireless technology (eg: 433MhZ or even a WiFi feather, provided the rPi’s WiFi NIC can be put into AP mode) with pre-built, or at least easy to build, controllers with 7+ buttons, each button with a unique, easily decodable signal, I’d be open to that.

By contrast, here’s a successful pairing and connection for a Logitech K380 keyboard in the same environment:

[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:13 Discovering: yes
[NEW] Device 34:88:5D:5B:00:E0 34-88-5D-5B-00-E0
[CHG] Device 34:88:5D:5B:00:E0 RSSI: -55
[CHG] Device 34:88:5D:5B:00:E0 RSSI: -47
[CHG] Device 34:88:5D:5B:00:E0 LegacyPairing: no
[CHG] Device 34:88:5D:5B:00:E0 Name: Keyboard K380
[CHG] Device 34:88:5D:5B:00:E0 Alias: Keyboard K380
[bluetooth]# pair 34:88:5D:5B:00:E0
Attempting to pair with 34:88:5D:5B:00:E0
[CHG] Device 34:88:5D:5B:00:E0 Connected: yes
[CHG] Device 34:88:5D:5B:00:E0 Modalias: usb:v046DpB342d4200
[CHG] Device 34:88:5D:5B:00:E0 UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device 34:88:5D:5B:00:E0 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 34:88:5D:5B:00:E0 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 34:88:5D:5B:00:E0 Paired: yes
Pairing successful
[CHG] Device 34:88:5D:5B:00:E0 Connected: no
[CHG] Device 34:88:5D:5B:00:E0 LegacyPairing: yes
[bluetooth]# connect 34:88:5D:5B:00:E0
Attempting to connect to 34:88:5D:5B:00:E0
[CHG] Device 34:88:5D:5B:00:E0 Connected: yes
Connection successful