-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bugs][Bluetooth] Post all Bluetooth Controller Bugs Here!! #1194
Comments
patch works s905x4+ Fake PS4 Controller After the device is restarted, turn on the SHARE + PS button to pair successfully instantly. God worked hard |
@junm6802030 the advantage of pairing over just connecting is that you can auto connect later. Can you let us know if you're able to reconnect after you put your controller to sleep? Or in other words, if you pair using the script and get connected, then you disconnect the controller and try to connect it again, does that work without needing to pair again? btw, emuelec-bluetooth is executed on boot |
@Langerz82 can you explain more please? i am not sure if I can see the failure in forgetting. I am checking on my phone screen so the output might not look great. The first pairing attempt failed because the controller is probably already paired using some other script, the fact that a try again message was printed indicates an execution of the BluetoothCTL forget command. The second attempt succeeded, which means that the device was successfully removed from trusted and paired devices and was paired again, if it wasn't the case it will not be able to pair and it will fail. |
@ebeem In your script just after the device found you check for a pre-existing pair, and call forget, couldnt you just add the untrust() before forget() and it should pair the 1st time correctly? See:
Is that no good? |
@ebeem I have 2 handles, but both are of the same model, so it's not worth testing. |
@ebeem hey man, the untrust probably does nothing, my bad. If a controller is listed as paired couldn't just directly call connect() ? @junm6802030 - Woah that last output is strange, can you open up the file in /emuelec/scripts/emuelec-bluetooth find near the top:
change to:
Then save, close and repeat test? |
@Langerz82 that will work if it's only trusted I think. It's not gonna work if it's paired. As far as I am concerned, there's no unpair command in bluetoothctl, but maybe they introduced a one recently, I am not sure. But only issuing an untrust command will probably break the code and make pairing impossible if the device is already paired. Applying untrust before forget will do nothing, because forget issues a remove command which will untrust and unpair. |
@Langerz82 regarding issuing a connect command, not a good idea because we want the controller to be able to issue that, not the device itself or bluetoothctl. This code will only be executed by the user after all |
@junm6802030 your controller has 1 of the mac addresses not trusted for some reason. Can you try this after pairing? After that put controller into sleep and try to reconnect |
@junm6802030 Hey, can you remove that long output you added in this post: #1194 (comment) Try downloading and using this script:
edit: shit hang on a sec re-run the commands, I've added a couple lines. |
@junm6802030 I'll do that again.
Then reboot and re-test. |
I tested this and still can't wake up. Does the above one need to be tested? |
@junm6802030 It's the same, can you post the output when calling the command from SSH? |
@junm6802030 Try this:
try and run in SSH and post output. It has a small change to help us debug. |
@junm6802030 One more time, try this hope it works:
try and run in SSH and post output. It has a small change to help us debug. @junm6802030 I updated the script try and re-run the commands above, then run command emuelec-bluetooth. |
@ebeem , @junm6802030 |
@Langerz82 The wake allowed should allow a device to wake the system from suspend/sleep. It should have nothing to do with auto connect. @junm6802030 If you have Android, Windows, or Linux, try to pair the controller and see if it can auto connect. If the problem is with the controller, then I don't think we should try to handle it here. However, if it works on one of the former OSes, then we should investigate more. |
|
Here is what I have so far: It enables the script to enter a loop or just execute once, which will be needed in ES. syntax: |
@Langerz82 |
Yes please, I'll take a look when you are ready. I too can pair anytime with my generic PS3 controller. Not sure if we will need a polling scan mechanism to routinely scan. Latency isnt so important when using ES, but people will definitely be annoyed if it adds lag in-game ha. |
Scan will keep running forever if you don't pass a timeout. If the total scan time is -1 then timeout parameter should be dropped. |
Yes it's designed to always run while the device is on but sleep during a game and not scan. |
We do not need you to translate. |
This version is not easy to use, the first pairing is extremely slow, it takes 5 seconds, and it takes 5 seconds to pair after restarting, which is not a good experience for me personally. |
@junm6802030 I did not change any of the timings from @ebeem 's version. I don't think we can make it run any faster. |
@junm6802030 Terminal output is needed to spot the issue, my guess is the device is already paired. If that's the case and a pairing attempt is made, the script will forget the device so it can pair again. @Langerz82 changing update interval to 1 makes more sense now, and this will improve the re-pairing after forget. However, 5 seconds for pairing isn't bad, because pairing is needed once per device and then you will only reconnect, not re-pair. |
@ebeem would it speed it up though? since it relies on a notification to start the pairing process. |
@Langerz82 You will notice that the scanning will restart after pairing a device (I made it behave that way because of a bluez bug). The scanning will resume based on the update interval, because it will be responsible for running the scan again with the bluetooth scanning and ingame check If we get rid of this part, no one will be and to re-pair unless they restart the script or the device. @junm6802030 are you talking about slowness in pairing or connecting? You should only pair once and then you will be able to reconnect later without pairing |
print("running scan on " + str(SCAN_TIME), flush = True) |
added 1sec update interval. My PS3 Controller re-connected fast and the scan doesnt seem to interfere with the sixaxis pairing. see: |
on update interval 1 my controller took awhile to connect after disconnecting the cable, update interval 2 it's much faster I'll test a bit more. edit: |
That's because you're not returning false on device discovered after pairing ps3 controller (please leave it that way if you're not noticing any re-pairing issues). In the generic bluetooth pairing block, false is returned after successful pairing, which tells the Bluetooth scanning process to terminate so another one is created. So the bug is, after successfully pairing a device, you will stop receiving notifications for that specific device (unless you restart the scan or maybe there's another trick that I am not aware of). |
|
If you don't like the default behaviour of python's prints (which you will want to do only if you want to log into a file I guess). Then just run the python script with -u parameter.
I think you can also add this to the file header, but I haven't tested.
|
@ebeem Will the buffered/unbuffered option affect the bluetooth notifications? If it doesn't I think it's not really needed as the command will run in the background when starting emuelec. |
There should be no side effects, it's probably a good idea to flush, but better try to include the -u parameter in header first, that will be way cleaner if it works. To test, just output the emuelec-bluetooth to a file and check if output the file receives prints immediately |
see: I think it makes the bluetooth notifications faster but I am not sure. |
This header should make tty unbufffered: I checked with "#!/usr/bin/python -u " it doesnt work unfortunately. edit: |
EMUELEC:~ # emuelec-bluetooth @Langerz82 @ebeem The log output by the new code is very concise, and the code seems to be very streamlined. After successfully pairing one handle, a new process is opened to pair another handle. |
Hi, I'm using Emuelec 4.5, along with the script for this version, but Bluetooth controller pairing still fails. Here are the system messages. My controller is an Xbox Series X controller. I'm not sure where the issue might be. Thx for help EMUELEC:~ # emuelec-bluetooth bluetooth-agent.log: |
@natehsu this doesn't look like the latest script. Please check the comments or master branch's script to make sure it's not just an outdated script. |
@ebeem @Langerz82 EMUELEC:~ # emuelec-bluetooth bluetooth-agent.log: |
emuelec-bluetooth |
@wang80919 Thank you for sharing the information. Sharing test information: Later I tried manually pairing the Bluetooth controller using bluetoothctl. Sometimes it succeeds, and other times it fails. When observing failures, I checked the log using "journalctl -f | egrep -i blue" and found the following information: Aug 24 01:59:05 EMUELEC bluetoothd[3660]: src/device.c:load_gatt_db() No cache for 44:16:22:XX:XX:XX When the message "EMUELEC kernel: Bluetooth: SMP security requested but not available" appears, the pairing is unsuccessful. I'm not sure what's causing this issue. |
I do not knwon 2. |
Hello. I have followed the steps in this fix but it didnt work for me. Cant detect xbox one s controller, and Terios T3 controller too. |
一些 python 的版本。无法运行我的 V6 的脚本。 |
Hello! I have emuelec 4.6 on x96 max plus ultra (sc2_s905x4_4g.dtb) and bluetooth does not see any devices on it. I've already tried all the methods. How can I fix it? Here is the error emuelec-bluetoothV7.zip:
|
@jcc113 No default controller available <-- solve that issue first. Then if fixed it should work ok. |
new bluetooth bug thread here: |
Hello,
In an effort to de-clutter the bugs list, post all bugs related to Bluetooth Pairing here thank-you.
Fix for Bluetooth Controllers that cant connect:
edit:
If that does not work in SSH type:
Power on your controller.
If it trusts but not connects you may need to plug in your Controller to your device.
If it does not work either, post the output of the emuelec-bluetooth command.
The text was updated successfully, but these errors were encountered: