clockworkPi

Bluetooth device on gameshell

hardware
bluetooth
tinkering

#21
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)

#22

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


#23

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


#24

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?


#25

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