Enabling bluetooth

Is the addon likely to be released soon? I have to say I like OSMC a lot but I’m keen to expand on it…

RetroPie since RetroPlayer seems to be some way off ever happening. I know you say it can break lots of stuff but without any alternative what can we do?

Bluetooth to use RetroPie (gonna have to mess around as above)

Limelight to stream Steam games on a Pi2

Desktop so I can use Chromium or other Linux apps. I know you’re again looking at an addon at some stage.

this does not solve it. bluetooth is disabled in the osmc network settings menu after each reboot… i have to activate it there every single time before i can use my keyboard…

strange… works for me with a ps3 controller.

Hi, I’m stuck too. Everytime I reboot the raspberry in My OSMC > Network > Bluetooth - it’s disabled.

osmc@osmc:~$ rfkill list
0: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

And also when I check:

osmc@osmc:~$ hciconfig
hci0:   Type: BR/EDR  Bus: USB
        BD Address: 00:1A:7D:DA:71:10  ACL MTU: 310:10  SCO MTU: 64:8
        UP RUNNING
        RX bytes:564 acl:0 sco:0 events:29 errors:0
        TX bytes:358 acl:0 sco:0 commands:29 errors:0

Manually checking the “Enable Bluetooth” in GUI works.

Any hints to make the bluetooth enabled after start? I’ve tried adding an udev rule but with no luck:

/etc/udev/rules.d/10-local.rules:

# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"

Thanks!

Please see

for reboot issues

Sam

It works, thanks Sam! :slight_smile:

Hi. Is it possible to add an option to pair with a keyboard without entering a code? I am using FC30 controller and cannot connect it in keyboard mode because osmc asks the keyboard to enter a code. The controller cannot enter the code because it has no numeric buttons. The alternative options (e.g. to use bluez-simple-agent) are not available in osmc so we have to use the OSMC Settings -> Network -> Bluetooth which does not allow for simple pairing mode.

Did you try the Connect option instead of Pair ? Should work…

Hi DBMandrake. Yes. I just tried to connect to it in keyboard mode again. Just says “connection to [controller] failed”. I looked in .kodi/kodi.log but I don’t see any new messages when trying to connect. When I try to pair the controller and it fails I get the following messages in the log:

21:45:41 125.987762 T:1529869344  NOTICE: calling agent "/usr/bin/python /usr/share/kodi/addons/script.module.osmcsetting.networking/resources/lib/osmc_bluetooth_agent.py 64:03:D0:B3:7F:06"

We are currently working on some bluetooth pairing issues and have already fixed one similar problem that might be the issue you’re seeing, in the meantime you could try pairing with ‘bluetoothctl’ from the command line using SSH. Launch bluetoothctl then:

scan on

Then put your device into pairing mode, you should then see it’s name scroll by with a mac address, if not, after a few seconds type:

devices

copy the mac address into your clipboard and issue the following commands:

pair mac
trust mac
connect mac

Replace mac with the actual mac address of your keyboard that you found earlier, and wait between each command making sure that it says it was successful.

Let us know if that works for you and if possible grab the commands and results and post them here. (use the preformatted text tag)

If you want to start over and remove the pairing for a device use:

remove mac

If you want to try to pair a device that does require a PIN then you would use the command:

agent on

immediately before you try to use the pair command.

When you are finished pairing you can disable scan mode:

scan off

You can also check the status of the device you just paired:

info mac

This will let you confirm whether the device is paired, trusted and connected.

Some simpler devices may not actually need to be paired so you might find you need to skip the pairing step and only use trust and connect.

1 Like

Thank you. I will do this tonight and give feedback. Is the feedback you want in a log file or are you looking for the terminal output? Do I need to set any “verbose” flags to give proper output?

If you just copy and paste the commands and response from the terminal session when you find the method that works for your device that will be enough. We just need to see what the device is expecting and needing as not all bluetooth devices pair in the same way.

Hi DBMandrake. Sorry for the late reply. I could not pair the controller as a keyboard. Please see the output below:

osmc@osmc:~$ bluetoothctl
[NEW] Controller 00:11:22:98:76:54 osmc [default]
[NEW] Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:11:22:98:76:54 Discovering: yes
[CHG] Device 64:03:D0:B3:7F:06 LegacyPairing: yes
[CHG] Device 64:03:D0:B3:7F:06 RSSI: 50
[CHG] Device 64:03:D0:B3:7F:06 Class: 0x002540
[CHG] Device 64:03:D0:B3:7F:06 Icon: input-keyboard

[bluetooth]# devices
Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad

[bluetooth]# pair 64:03:D0:B3:7F:06
Attempting to pair with 64:03:D0:B3:7F:06
Failed to pair: org.bluez.Error.AlreadyExists

//remove old controller via OSMC UI
[DEL] Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad

//activated pairing on device
[NEW] Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad

[bluetooth]# pair 64:03:D0:B3:7F:06
Attempting to pair with 64:03:D0:B3:7F:06
[CHG] Device 64:03:D0:B3:7F:06 Connected: yes
Failed to pair: org.bluez.Error.AuthenticationFailed

[bluetooth]# trust 64:03:D0:B3:7F:06
Changing 64:03:D0:B3:7F:06 trust succeeded

[bluetooth]# connect 64:03:D0:B3:7F:06
Attempting to connect to 64:03:D0:B3:7F:06
Failed to connect: org.bluez.Error.Failed

[bluetooth]# devices
Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad
[CHG] Device 64:03:D0:B3:7F:06 RSSI: 34


//Second attempt with agent on
[bluetooth]# agent on
Agent registered
[NEW] Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad
[bluetooth]# info 64:03:D0:B3:7F:06
Device 64:03:D0:B3:7F:06
        Name: 8Bitdo FC30 GamePad
        Alias: 8Bitdo FC30 GamePad
        Class: 0x002540
        Icon: input-keyboard
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: yes
[bluetooth]# trust 64:03:D0:B3:7F:06
[CHG] Device 64:03:D0:B3:7F:06 Trusted: yes
Changing 64:03:D0:B3:7F:06 trust succeeded
[bluetooth]# pair 64:03:D0:B3:7F:06
Attempting to pair with 64:03:D0:B3:7F:06
[CHG] Device 64:03:D0:B3:7F:06 Connected: yes
Failed to pair: org.bluez.Error.AuthenticationTimeout
[bluetooth]# connect 64:03:D0:B3:7F:06
Attempting to connect to 64:03:D0:B3:7F:06
[CHG] Device 64:03:D0:B3:7F:06 Connected: yes
Failed to connect: org.bluez.Error.NotAvailable
[CHG] Device 64:03:D0:B3:7F:06 Connected: no

After playing around in bluetoothctl I came across something odd. I have copied the session below. Note how the device connects, gets UUID and Modalias and then disconnects. I don’t know if this helps, but I thought I would post it here.

[NEW] Device 64:03:D0:B3:7F:06 8Bitdo FC30 GamePad
[bluetooth]# info 64:03:D0:B3:7F:06
Device 64:03:D0:B3:7F:06
        Name: 8Bitdo FC30 GamePad
        Alias: 8Bitdo FC30 GamePad
        Class: 0x002540
        Icon: input-keyboard
        Paired: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: yes

[bluetooth]# trust 64:03:D0:B3:7F:06
[CHG] Device 64:03:D0:B3:7F:06 Trusted: yes
Changing 64:03:D0:B3:7F:06 trust succeeded
[bluetooth]# connect 64:03:D0:B3:7F:06
Attempting to connect to 64:03:D0:B3:7F:06
Failed to connect: org.bluez.Error.Failed
[bluetooth]# connect 64:03:D0:B3:7F:06
Attempting to connect to 64:03:D0:B3:7F:06
[CHG] Device 64:03:D0:B3:7F:06 Connected: yes
[CHG] Device 64:03:D0:B3:7F:06 Modalias: usb:v2810p0009d0100
[CHG] Device 64:03:D0:B3:7F:06 UUIDs:
        00001200-0000-1000-8000-00805f9b34fb
Failed to connect: org.bluez.Error.NotAvailable
[CHG] Device 64:03:D0:B3:7F:06 Connected: no

[bluetooth]# info 64:03:D0:B3:7F:06
Device 64:03:D0:B3:7F:06
        Name: 8Bitdo FC30 GamePad
        Alias: 8Bitdo FC30 GamePad
        Class: 0x002540
        Icon: input-keyboard
        Paired: no
        Trusted: yes
        Blocked: no
        Connected: no
        LegacyPairing: yes
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v2810p0009d0100

At the point where you tried to connect to the device, was the device still in pairing mode ? Make sure it hadn’t timed out and gone out of pairing mode due to taking too long between each step.

Try repeating the process but without using “remove” - leave the device as already trusted, then put the device in pairing mode and try pair, then connect, or just connect on its own.

We have found that with some simple devices such as my Fire TV Stick remote, that it is enough to trust and then connect with the remote while it is in pairing mode - the remote will then attempt to pair back to osmc in the other direction and provided it is already trusted this will succeed. So you don’t always have to initiate pairing from the osmc end and perhaps with some devices this would not work.

There seems to be a lot of variations of the pairing procedures for different devices and we are still learning how some devices handle this. Fortunately bluetoothctl is a good tool for testing this out, then when we know what is needed we can incorporate it into the GUI.

1 Like

Hi DBMandrake. I tried again last night to get the gamepad connected in keyboard mode. It looks like I got it to connect (after unsuccessfully pairing, disconnecting, and reconnecting), however, I could not get any input from the device. I copy the log below for reference. I will continue to try different combinations until I succeed. At least this is appears to be a step in the right direction.

osmc@osmc:~$ bluetoothctl

[bluetooth]# scan on
Discovery started
[CHG] Controller 00:11:22:98:76:54 Discovering: yes
[NEW] Device 64:03:E1:A4:7F:06 8Bitdo FC30 II
[bluetooth]# pair 64:03:E1:A4:7F:06
Attempting to pair with 64:03:E1:A4:7F:06
[CHG] Device 64:03:E1:A4:7F:06 Connected: yes
Failed to pair: org.bluez.Error.AuthenticationFailed
//device still has flashing light and is not connected

[bluetooth]# trust 64:03:E1:A4:7F:06
[CHG] Device 64:03:E1:A4:7F:06 Trusted: yes
Changing 64:03:E1:A4:7F:06 trust succeeded

[bluetooth]# pair 64:03:E1:A4:7F:06
Attempting to pair with 64:03:E1:A4:7F:06
Failed to pair: org.bluez.Error.AuthenticationFailed

[bluetooth]# connect 64:03:E1:A4:7F:06
Attempting to connect to 64:03:E1:A4:7F:06
Failed to connect: org.bluez.Error.Failed

[bluetooth]# connect 64:03:E1:A4:7F:06
Attempting to connect to 64:03:E1:A4:7F:06
Failed to connect: org.bluez.Error.NotAvailable

[bluetooth]# connect 64:03:E1:A4:7F:06
Attempting to connect to 64:03:E1:A4:7F:06
Failed to connect: org.bluez.Error.NotAvailable

[bluetooth]# info 64:03:E1:A4:7F:06
Device 64:03:E1:A4:7F:06
        Name: 8Bitdo FC30 II
        Alias: 8Bitdo FC30 II
        Class: 0x002540
        Icon: input-keyboard
        Paired: no
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: yes

[bluetooth]# pair 64:03:E1:A4:7F:06
Attempting to pair with 64:03:E1:A4:7F:06
Failed to pair: org.bluez.Error.AuthenticationFailed

[bluetooth]# agent on
Agent registered

[bluetooth]# disconnect 64:03:E1:A4:7F:06
Attempting to disconnect from 64:03:E1:A4:7F:06
Successful disconnected
[CHG] Device 64:03:E1:A4:7F:06 Connected: no

[bluetooth]# connect 64:03:E1:A4:7F:06
Attempting to connect to 64:03:E1:A4:7F:06
[CHG] Device 64:03:E1:A4:7F:06 Connected: yes
[CHG] Device 64:03:E1:A4:7F:06 UUIDs:
        00001124-0000-1000-8000-00805f9b34fb
Connection successful
[CHG] Device 64:03:D0:B3:7F:06 Connected: yes
[CHG] Device 64:03:D0:B3:7F:06 Connected: no
//At this stage the device had a solid blue light indicating that it was connected.
//I could not get any input from the device even though it was connected.

How do you find that? I have the latest version on a Pi3, and there is no bluetooth option under Network. Does it have to be enabled somewhere else before it appears there?

The Bluetooth module for Raspberry Pi 3 is not ready yet and won’t be ready for a while yet.

This post is four months old, it predates Pi 3. The poster is using an external dongle.

Sam

Thanks. I’ll find another OS and media server then.

Bluetooth in :osmc: works pretty well now on rpi3