Problem pairing Bluetooth keyboard, authentication fails as no pin is shown
-
Hello everyone!
I have set up RetroPie on my Raspberry Pi 4 from the official retropie-buster-4.7.1-rpi4_400 image (DL from this website). So far I got everything to work (except for the Xbox one controller), but now I want to get rid of the usb keyboard and switch to a bluetooth one. I had this very keyboard running on this same RasPi with Raspbian, where it paired without issue. Usually I put it in pairing mode, I get a popup with a pin to enter on the keyboard, and once I press enter it's paired.
- I put the keyboard in pairing mode (it has a button for that), the "pairing" led starts flashing
- In Retropie I go to the RetroPie Settings/Configuration-tools/Bluetooth/Pair and connect to Bluetooth Device
- The keyboard does show up after a few seconds (MAC address and Name)
- I press "OK" and get to the "security mode"
That's where it starts to fail. I wait patiently for some 10-15 seconds and then get an error message stating
An error occurred connecting to the bluetooth device (Creating device failed: org.bluez.Error.AuthenticationTimeout: Authentication Timeout)
What I tried:
- tested all security mode options, result was the same
- updating via RetroPie Setup/Update
- updating via sudo apt-get update/upgrade in the console
- asking google and searching the forum, this could be related https://retropie.org.uk/forum/topic/19106/cannot-connect-bluetooth-le-keyboard-logitech-k830, but I don't get exactly what Zerojay recommends
I'm not using any other bluetooth devices currently (no game controllers or anything), so there should be no interference there. To me it looks like the authentication times out because the pin required for pairing is not shown anywhere, hence I cannot enter it and the pairing attempt is closed by the keyboard after a while, as it doesn't ever receive the pin. I'm not sure if this is uncommon for bluetooth keyboards, but as Retropie is based on Rasbian (at least I think I read that somewhere), there should be a way to get this set up.
Another thing I could think of: When trying (and failing) to set up the Xbox controller I have followed some tutorials instructing me to turn off ERTM, and I instaled Xpadneo (https://github.com/atar-axis/xpadneo). It's just supposed to be a driver, but maybe that messed up some settings in the bluetooth configuration?
I'm kind of new to Linux/Retropie, so please have patience and explain it to the noob ;-)
-
@sergorov said in Problem pairing Bluetooth keyboard, authentication fails as no pin is shown:
Another thing I could think of: When trying (and failing) to set up the Xbox controller I have followed some tutorials instructing me to turn off ERTM, and I instaled Xpadneo (https://github.com/atar-axis/xpadneo). It's just supposed to be a driver, but maybe that messed up some settings in the bluetooth configuration?
It might have an impact, you could try removing
xpadneo
and the ETRM settings and try again pairing.
You can also try pairing the device manually, viabluetoothctl
- see an example here.The pairing dialog in RetroPie expects usually a gamepad, which has no PIN requirements, so it may also fail because of this.
-
@mitu I finally got round to try this, and just to make sure I have done a fresh install from scratch. It still didn't work. I then installed "pixel desktop" from the retropie_setup.sh menu, and started this. From the GUI here I could actually pair my keyboard and I can use it in the pixel environment. But it still does not work at all in Emulation Station. It just doesn't react to the keyboard input at all. A wired usb keyboard works in both worlds. But it shouldn't be two worlds at all, as the OS running is the same raspbian, right?
-
@sergorov said in Problem pairing Bluetooth keyboard, authentication fails as no pin is shown:
But it shouldn't be two worlds at all, as the OS running is the same raspbian, right?
Yes, it should. If you exit the desktop and EmulationStation, is the keyboard still working ?
EDIT: do you have both keyboards connected in EmulationStation when you try configuring the BT keyboard ?
-
@mitu Thank you for your input! I really appreciate it.
Question 1: No, the keyboard does not seem to work outside of Pixel. When in ES I tried to open the console by pressing f4/shift-f4, but it does not work. I connected the usb keyboard, opened the console and tried to type something on the bt keyboard, but that didn't work either. I rebooted (without the USB kb plugged in) and ran evtest via ssh, and the bt-keyboard is actually listed (as keyboard, system control, consumer control and mouse.... is this normal?)
Question 2: No, I actually only had the USB mouse plugged in at first, then connected my bt-mouse, unplugged the USB mouse and connected the bt-keyboard.In case that's of interest: it is not an option to just use Pixel when I want to use the keyboard. The main reason why I want the keybaord to run is that I do a lot of game-streaming via moonlight with my RasPi. That's where I need the keyboard to run, and as I start moonlight from ES it would need to work without Pixel. The bt-mouse actually works without any problem by the way.
-
I don't know why - once paired - the keyboard doesn't work outside of the desktop. Once paired, the connection to the device is handled by the OS (bluetooth service), so it should work like any gamepad or (in your case) mouse.
The reason I asked about the other keyboard is that SDL (which is used behind the scenes by EmulationStation) doesn't support multiple keyboards, so it might have been the case of USB keyboard works (1st keyboard) while the BT doesn't (2nd keyboard).
.. and ran evtest via ssh, and the bt-keyboard is actually listed
Does testing the input with
evtest
shows anything being sent by the keyboard, if you're typing on it ? -
@mitu Sorry for the late response!
There were indeed no events when I tested with evtest.
I completely removed the keyboard again, rebooted and started Pixel. I again paired the keyboard, and made sure it worked in Pixel. Then I rebooted into ES again, again no keyboard..... some kind of weird inspiration made me go to the Retropie Config (you know, where the setup.sh is started) and, much to my surprise, I found that after a few button pushes the keyboard started working! I have no idea what went on and why it worked, because apart from opening setup I did nothing differently from the first time. After leaving the config I started evtest again (via the remote console) and actually this time around the events were showing up! The keyboard actually started to work!
Soooo happy now, as after adding the proper event source to the moonlight config I actually have full keyboard support there as well!!!
Thank you again for your help and patience @mitu !
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.