Ubuntu Pastebin

Paste from ogra at Mon, 8 May 2017 16:08:10 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ogra@pi3:~$ cat /etc/systemd/system/pi3-init-bt.service 
[Unit]
Description=Init LowLevel Bluetooth

[Service]
Type=forking
ExecStart=/home/ogra/bt-init.sh

[Install]
WantedBy=multi-user.target
ogra@pi3:~$ cat bt-init.sh 
#! /bin/sh

set -e

MYHW="$(cat /proc/cpuinfo |grep ^Hardware|sed 's/^.*: //')"
HCIATTACH="/snap/bin/hciattach"
DEVICE=""

[ -x "$HCIATTACH" ] || exit 0

case "$MYHW" in
    BCM2709)
        DEVICE="Pi3"
        OPTS="/dev/ttyAMA0 bcm43xx 921600 noflow -"
    ;;
    *)
        exit 0
    ;;
esac

echo "Initializing $DEVICE Bluetooth: "

$HCIATTACH $OPTS

echo "done ..."
ogra@pi3:~$ 
Download as text