Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1dbbbb
commit 644b4d1
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#!/bin/bash -x | ||
|
||
ogg123 /usr/share/sounds/freedesktop/stereo/service-login.oga | ||
ogg123 /usr/share/sounds/freedesktop/stereo/service-login.oga | ||
|
||
# disconnect wifi to prevent dropouts - TODO: check what permissions bt-speaker might need for this (netdev group?) | ||
# ifconfig wlan0 down & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#!/bin/bash -x | ||
|
||
ogg123 /usr/share/sounds/freedesktop/stereo/service-logout.oga | ||
ogg123 /usr/share/sounds/freedesktop/stereo/service-logout.oga | ||
|
||
# reenable wifi - TODO: check what permissions bt-speaker might need for this (netdev group?) | ||
# ifconfig wlan0 up & |
644b4d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly it looks like root is required for this. Maybe an addition to install script that mentions or prompts for edit to pi's /boot/config.txt to add dtoverlay=pi3-disable-wifi? (Any ifconfig up or down will require root so unless script wants to be run as root this is only feasible option I see)
Edit: This likely only affects Pi 3 and maybe current Pis. It's in raspian master boot firmware as a flag. Maybe other routes for Pi Zero or earlier Pis? Running raspi-config interactively on any should let you disable wifi though, maybe just better to put a warning on install like "bt-speaker installed. If you notice wifi causing disconnects, please run raspi-config to disable wifi." Other route is editing bt-speaker user for those permissions with similar passwd edits:
bt-speaker ALL = (ALL) NOPASSWD: /sbin/ifup wlan0, /sbin/ifdown wlan0
644b4d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on my pi I do something like:
btspeaker ALL = (ALL) NOPASSWD: /etc/bt_speaker/hooks/connect, /etc/bt_speaker/hooks/disconnect
... it works well for me but it is not ideal
644b4d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have just applied this :
root# visudo
add under # User privilege specification , after root line :
btspeaker ALL=(root) NOPASSWD :/sbin/ifconfig *
and then in /etc/bt_speaker/hooks/connect
it's :
sudo ifconfig wlan0 down
in /etc/bt_speaker/hooks/disconnect
it's :
sudo ifconfig wlan0 up
thanks for this great project, too bad even with raspberry 3b, wifi and bluetooth are still not friends.