Closed totti2 closed 4 years ago
I have worked around the sound issue on Bluetooth by automatically disabling wlan0 when a device is connected. Wifi is then enabled again when the device is disconnected again.
Simply create a script called /home/pi/bt-audio-disable-wlan0.sh
with the following content:
#!/bin/bash
while true; do
RES=$(/usr/bin/inotifywait -q -e CREATE,DELETE /dev/input/)
case "$RES" in
"/dev/input/ DELETE event0")
ifconfig wlan0 up
service shairport-sync start
;;
"/dev/input/ CREATE event0")
service shairport-sync stop
ifconfig wlan0 down
;;
esac
done
Then run:
sudo apt-get install inotify-tools
chmod +x /home/pi/bt-audio-disable-wlan0.sh
Now add /home/pi/bt-audio-disable-wlan0.sh &
to /etc/rc.local
before exit 0
Without wifi I cannot control the snapcast server. Plus, all airplay-devices will lose connection. I'd rather keep those functions.
But thanks for your action-on device-change approach. One could use that for an audio signal, indicating when a new bt-device has connected.
@totti2 then the best solution would probably be to use a separate dongle for WiFi. That is what I have done myself.
Alright. Then maybe this would be a good start. dependencies are not corrected yet. Bridge not integrated. So still incomplete, but it's using dnsmasq instead isc-dhcp-server in the AP_config.sh
I tried this with a dedicated dongle and the initial bandwidth issue is gone (more testing need for snapserver, though).
My smartphone doesn't get an IP when the Pi isn't connected to a LAN. The moment I plug in the ethernet-cable, I get an IP for my smartphone. If I had to guess, I would suspect the dhcpcd not to work properly with both with and without ethernet-connection.
OFF: When using the integrated bluetooth-device I experience a lot of hick-ups and interruptions.
Finished. If someone could please check this. to sum up:
@totti2 I can confirm that script is working. However I made a few changes: https://gist.github.com/Lauszus/47e673e60e7f15d41f5c8b680abefe9e/revisions:
Should have been done some days ago..
environment: stretch lite, raspberry pi 3 install choices: bluetooth, airplay, snapserver and -client
In order to get the acces point mode running again in a stretch install, I just followed this how-to: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md
What works:
Experiencing bandwidth issues:
I will try the same setup with an extra wifi-dongle. Or...
Someone with more than my noobish copy-paste-expertise can help me (, please!).