mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
rpi0w also has bluetooth support
This commit is contained in:
parent
1ff84730d7
commit
016c3407dd
43
board/raspberrypi/overlay/etc/init.d/S13btuart
Executable file
43
board/raspberrypi/overlay/etc/init.d/S13btuart
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
sys_conf="/etc/bluetooth.conf"
|
||||
boot_conf="/boot/bluetooth.conf"
|
||||
conf="/data/etc/bluetooth.conf"
|
||||
|
||||
test -f $conf || test -f $boot_conf || test -f $sys_conf || exit 0
|
||||
|
||||
test -n "$os_version" || source /etc/init.d/base
|
||||
|
||||
function start() {
|
||||
if [ "$(cat /proc/device-tree/aliases/uart0)" = "$(cat /proc/device-tree/aliases/serial1)" ] ; then
|
||||
if [ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = " 16" ] ; then
|
||||
/usr/bin/hciattach -t5 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null
|
||||
else
|
||||
/usr/bin/hciattach -t5 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null
|
||||
fi
|
||||
else
|
||||
/usr/bin/hciattach -t5 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
msg_begin "Attaching UART bluetooth modem"
|
||||
# for some reason, sometimes the hciattach command needs to be run twice
|
||||
(start || start) &>/dev/null &
|
||||
msg_background
|
||||
;;
|
||||
|
||||
stop)
|
||||
msg_begin "Detaching UART bluetooth modem"
|
||||
killall hciattach &>/dev/null
|
||||
test $? == 0 && msg_done || msg_fail
|
||||
;;
|
||||
|
||||
*)
|
||||
echo $"Usage: $0 {start}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
32
board/raspberrypi/overlay/etc/udev/rules.d/99-com.rules
Normal file
32
board/raspberrypi/overlay/etc/udev/rules.d/99-com.rules
Normal file
@ -0,0 +1,32 @@
|
||||
SUBSYSTEM=="input", GROUP="input", MODE="0660"
|
||||
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
|
||||
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
|
||||
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
|
||||
|
||||
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
|
||||
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
|
||||
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
|
||||
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
|
||||
'"
|
||||
|
||||
KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
|
||||
ALIASES=/proc/device-tree/aliases; \
|
||||
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
|
||||
echo 0;\
|
||||
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
|
||||
echo 1; \
|
||||
else \
|
||||
exit 1; \
|
||||
fi\
|
||||
'", SYMLINK+="serial%c"
|
||||
|
||||
KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
|
||||
ALIASES=/proc/device-tree/aliases; \
|
||||
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
|
||||
echo 0; \
|
||||
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
|
||||
echo 1; \
|
||||
else \
|
||||
exit 1; \
|
||||
fi \
|
||||
'", SYMLINK+="serial%c"
|
BIN
board/raspberrypi/overlay/lib/firmware/BCM43430A1.hcd
Normal file
BIN
board/raspberrypi/overlay/lib/firmware/BCM43430A1.hcd
Normal file
Binary file not shown.
BIN
board/raspberrypi/overlay/usr/bin/hciattach
Executable file
BIN
board/raspberrypi/overlay/usr/bin/hciattach
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user