Skip to content
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

[EE 4.4+ Fix] Better Game Controller Bluetooth Support. #1201

Merged
merged 11 commits into from Aug 11, 2023

Conversation

Langerz82
Copy link
Collaborator

@Langerz82 Langerz82 commented Jun 17, 2023

[EE 4.4+ Fix] Better Game Controller Bluetooth Support.

To test on a current build just copy the emuelec-bluetooth file to /emuelec/scripts and give it execution priviledges. In SSH do:

cd /emuelec/scripts
wget https://raw.githubusercontent.com/EmuELEC/EmuELEC/a2f815bb3ea4039a58260e1c5798ab3f4ceae0b0/packages/sx05re/emuelec/bin/batocera/emuelec-bluetooth
chmod +x /emuelec/scripts/emuelec-blueooth

reboot.

By default like during boot it will run for 1 minute at 5 second intervals. It will not start a new scan during an emulator launch, this is automatic, unless there is zero wireless connected devices.

This is a revised version that relies on blueooth notifications rather than polling every second or so, so it should perform much faster than its predicessor. Special thanks goes to @ebeem for working hard on this python script.

Credits info:

################################################################################
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023-present ebeem (https://github.com/ebeem)
# Modifications made by:
#   Langerz82 (https://github.com/Langerz82)
#   wang80919 (https://github.com/wang80919)
# Testing done by:
#   junm6802030 (https://github.com/junm6802030)
# Special thanks to everyone who worked on this.
################################################################################

refs:
#1194
#783
#1076
#1072
#1083
#877

Langerz82 added a commit to Langerz82/EmuELEC that referenced this pull request Jul 15, 2023
@qphoria
Copy link

qphoria commented Jul 30, 2023

Hi. I tried running this on my 4.4 install and I get the following when I try to run it manually via terminal session

EMUELEC:~ # emuelec-bluetooth
Traceback (most recent call last):
  File "/emuelec/scripts/emuelec-bluetooth", line 58, in <module>
    class BluetoothCTL:
  File "/emuelec/scripts/emuelec-bluetooth", line 59, in BluetoothCTL
    async_bluetooth_process: Popen | None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

@qphoria
Copy link

qphoria commented Jul 30, 2023

Ok looks like emuelec 4.4 has python 3.8 which didn't support pipe without quotes.
So change this
async_bluetooth_process: Popen | None
to this:
async_bluetooth_process: "Popen | None"

@Langerz82 Langerz82 marked this pull request as ready for review August 11, 2023 00:30
@Langerz82
Copy link
Collaborator Author

ready to commit

@shantigilbert shantigilbert merged commit 476628c into EmuELEC:dev Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants