clockworkpi

Bluetooth device on gameshell

Once I turned off Wi - Fi, I could not scan. I can use USB-ETH…

Sorry, “sudo rfkill unblock wifi” I can connect Wi-Fi again.
Is the setting item of the launcher not following it?

I follow the wiki on https://github.com/clockworkpi/bluetooth, but when i use “connect xx:xx:xx:xx:xx:xx” command, i got “Failed to connect: org.bluez.Error.Failed” …
“pair xx:xx:xx:xx:xx:xx” is ok.
I donnot know why…

xx: xx: xx: xx: xx: xx is same value?
Is not it connected?

xx: xx: xx: xx: xx: xx is my wifi mac address…
After I install pulseaudio pulseaudio-module-bluetooth, now gameshell can connect my Bluetooth headset, but there is no sound.

Hello.
I am trying to connect the game pad 2 days ago, but it will not work.
Like a movie, the D-Pad moves, but the button does not work.

The game pad is 8 Bitdo Zero.

Bluetooth connection is done.

There seems to be a driver for this pad in retroarch.


I changed the setting-Driver-Joypad Driver to “udev”.

Add /etc/udev/rules.d/10-local.rules file,
SUBSYSTEM == “input”, ATTRS {name} == “8 Bitdo Zero GamePad”, MODE = “0666”, ENV {ID_INPUT_JOYSTICK} = “1”.

Add /etc/udev/rules.d/99-evdev.rules file,
KERNEL == “event *”, NAME = “input /% k”, MODE = “666”.
https://docs.libretro.com/guides/input-joypad-drivers/

User “cpi” has not been added to “input” group. Do I need it?
Please let me know if there is anything else I can do.

maybe this will be useful …

input_select_btn = "Space"
input_start_btn = "Enter" 
input_x_btn = "U"
input_y_btn = "I"
input_a_btn = "J"
input_b_btn = "K"
input_l_btn = "Home"
input_r_btn = "End"
1 Like
sudo su

cat <<EOF >/etc/rc.local
#!/bin/sh -e
sleep 15
brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &
EOF
chmod +x /etc/rc.local
systemctl daemon-reload
systemctl start rc-local
systemctl status rc-local

systemctl enable bluetooth
reboot

use rc.local to auto set bluetooth everytime rebooted

add two lines in /etc/systemd/system/dbus-org.bluez.service

Restart=always
RestartSec=3

under [Service] section
after line ProtectSystem=full

to prevent bluetoothd unexpected crash

As I was told, I rewrote 8 Bitdo_Zero_BT.cfg but it did not work. I tried sudo apt-get install joystick, but it did not change. / dev has no joystick directory, is that something like that?

I did it!

But, This is recognized as 1 controller. purpose as a 2 controller.

2 Likes

Hello.
I finally decided how to use 2 con with Bluetooth, so I will write down.

* We strongly recommend RetroArch’s Bluetooth controller described here.
https://github.com/libretro/RetroArch-joypad-autoconfig/tree/master/udev
Perhaps it will not work well unless you set the pad to “Windows mode”.
(Fanny suffered by the D-pad operation of the controllers 1 and 2?)

1.Change the kernel so that Bluetooth can be used.
2. Pair the Bluetooth once. At that time refrain from recognizing names.
After refraining from the recognition name, turn off the pad power.

3.Add your user to the group “input” with the command:
sudo usermod -a -G input whoami

4.Add “etc / udev / rules.d / 10-local.rules”.
SUBSYSTEM == “input”, ATTRS {name} == “device recognition name in Bluetooth”, MODE = “0666”, ENV {ID_INPUT_JOYSTICK} = “1”
ex.SUBSYSTEM == “input”, ATTRS {name} == “8 Bitdo Zero GamePad”, MODE = “0666”, ENV {ID_INPUT_JOYSTICK} = “1”

sudo udevadm control --reload-rules

5.Start RetroArch and change options.

Settings

  • Driver
    Joypad Driver - udev

  • Inputs
    Max Users - 2

  1. End RetroArch.

  2. Pair with the pad

  3. Start RetroArch
    * At this time, if the pad recognizes it, Autoconfg should display the name of the pad with yellow letters at the bottom of the screen

Setting

  • Inputs
    Input User 2 Bind
    User 2 Bind All

Change button assignment
Set buttons one by one.

9.Let’s start the game and check the operation!
A fun game with a girl (or boy?) Friends!
I do not have her…

Thanks.

2 Likes

bluetooth in launcher alpha now

check out the newest code of launcher then you will see it

use git pull to update launcher, for now ,there is no update in launcher's UI

and make sure you enabled bluetooth by

bluetooth wiki

and also could add auto-run for bluetooth by

sudo su

cat <<EOF >/etc/rc.local
#!/bin/sh -e
sleep 15
brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &
EOF
chmod +x /etc/rc.local
systemctl daemon-reload
systemctl start rc-local
systemctl status rc-local

systemctl enable bluetooth
reboot

add two lines in /etc/systemd/system/dbus-org.bluez.service to prevent blueZ unexpected crash

Restart=always
RestartSec=3

[Service] section
after this line ProtectSystem=full

Currently I only tested with my two bluetooth devices:

  • logitech k480 keyboard
  • 8bitdo game pad

so you may met bugs ,dont panic

PS:
I accepted the re-order pull-request to re-order icons, so PowerOff will be in the last position of launcher’s Menu
so you may find out double PowerOFF, Music Player ,TinyCloud Icons after git pull
just remove the duplicates

  • PowerOFF became 99_PowerOFF
  • Music Player became 97_Music Player
  • TinyCloud became 98_TinyCloud

Happy Hacking

1 Like

Good!
I hope I can turn Bluetooth on / off from the launcher.

Right now
the Airplane mode will do the trick of turning on/off bluetooth ,because airplane mode is just
rfkill block all
rfkill unblock all

But I guess It’s not perfect enough

can anyone explain how the rc-local.service content look like, i did manage to add the the rc.local but failed to get the service start with bluetooth on.

cpi@clockworkpi:~$ systemctl status rc-local
● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
  Drop-In: /lib/systemd/system/rc-local.service.d
           └─debian.conf
   Active: active (running) since Sun 2018-10-21 06:26:17 UTC; 22h ago
   CGroup: /system.slice/rc-local.service
           └─753 brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no
lines 1-7/7 (END)

thx U. I am not a linux expert, but will the rc.local.service config like below:
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

I am not a linux expert,either :slight_smile:

why you look into rc.local.service, I think rc.loal.service is fine with default content

just run systemctl start rc-local will enable rc.local.service at boot so that /etc/rc.local will be invoked at boot,too,

in ssh ,just run the scripts below, maybe copy and paste all into ssh

cat <<EOF >/etc/rc.local
#!/bin/sh -e
sleep 15
brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &
EOF
chmod +x /etc/rc.local
systemctl daemon-reload
systemctl start rc-local
systemctl status rc-local

systemctl enable bluetooth
reboot

and just in case

if you did not see the launcher up but only a loading…

into ssh

cd ~/launcher <- or cd ~/apps/launcher
DISPLAY=:0 ./load.sh

see if there are other problems

1 Like

it seems that after running systemctl start rc-local, it doesn’t enable rc.local.service. at boot. but probably I need to figure it out. do we need to run the bluetoothctl to connect device everytime we start the clockworkpi?

The launcher can connect bluetooth devices now ,but without pair code
it seems bluetooth > 2.1 can pair without code

But every time you connect to a Bluetooth device, you need to connect it again with launcher or bluetoothctl

right now I don’t know how to make a bluetooth device auto-reconnect efficiently