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

I seem to need a udev rule also to keep bluetooth working - can you review #24

Open
sundarnagarajan opened this issue May 20, 2017 · 0 comments

Comments

@sundarnagarajan
Copy link

I have a laptop - specifically RDP Thinbook
with an Intel Atom X5-Z8300 (Cherry Trail) with a Realtek RTL8723bs chipset that does Wifi and Bluetooth.

Your utility, firmware and systemd startup script work perfectly.

BUT

I find that I need to run the start_bt script every time the Bluetooth interface is brought DOWN. Otherwise, once I turn Bluetooth off, I can never turn it on again, except by rebooting.

I solved the problem by adding a rule in /etc/udev/rules.d that calls a script if SUBSYSTEM=="rfkill" and in this script, I call the start_bt script, but only if the device in question presents itself as the specific platform that needs it.

My udev rule looks like this:

SUBSYSTEM=="rfkill" RUN+="/root/hardware/bluetooth/scripts/bluetooth_udev_rules.sh"

And the script that is called looks like this:

#!/bin/bash

if [ "$RFKILL_TYPE" != "bluetooth" ]; then
	exit 0
fi

EXPECTED_PLATFORM="OBDA8723"
EXPECTED_RFKILL_STATE="0"
PROG=$(basename $0)
BT_START_SCRIPT=/root/hardware/bluetooth/rtl8723bs_bt/start_bt.sh

ACTUAL_PLATFORM=${RFKILL_NAME%:*}

if [ "$ACTUAL_PLATFORM" != "$EXPECTED_PLATFORM" ]; then
  exit 0
fi
if [ "$RFKILL_STATE" != "$EXPECTED_RFKILL_STATE" ]; then
	exit 0
fi
if [ ! -x $BT_START_SCRIPT ]; then
	exit 0
fi

$BT_START_SCRIPT 2>&1 | /usr/bin/logger -t r8723bs_bt_firmware

Have you seen other people complain about this?

Is this the right solution?

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

No branches or pull requests

1 participant