RetroPie / RetroPie/RetroPie-Setup

bluetooth issue if controller die during pairing

Open
#3,198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Shell
Stars
10.4k
Forks
1.4k
Avg merge
2d 12h
Merged PRs (30d)
11

Description

Hello devs,

I had an issue with the current bluetooth script when pairing a ds4 over bluetooth.

my controller died during the pairing after the Yes/No prompt.

the result was this output :

^[[CTraceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 604, in msg_reply_handler
reply_handler(*message.get_args_list(**get_args_opts))
File "/home/pi/RetroPie-Setup/scriptmodules/supplementary/bluetooth/bluez-simple-agent", line 118, in pair_reply
dev_connect(dev_path)
File "/home/pi/RetroPie-Setup/scriptmodules/supplementary/bluetooth/bluez-simple-agent", line 38, in dev_connect
dev.Connect()
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in call
return self._proxy_method(*args, **keywords)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in call
**keywords)
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.bluez.Error.Failed: Host is down

And then the script just hang forever without returning to the menu.

Easy workaround is doing CTRL+C a couple of times to kill the script. But I feel after a timeout (host is down) it should return to the retropie cli menu.

I know c0d3h4x0r is trying to modify the script already in pull https://github.com/RetroPie/RetroPie-Setup/pull/3193
maybe this is something that could be done at the same time if he would be willing to have a look.

Thanks and have a good day !

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in scriptmodules/supplementary/bluetooth/bluez-simple-agent, especially dev_connect at line 38 and pair_reply at line 118, and review pull request 3193 for related changes. Reproduce or trace the DS4 pairing path when the controller dies after the prompt; done means a Host is down failure returns to the RetroPie CLI menu instead of hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, raspberry-pi
Domain
cli, embedded-iot, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.