fix: add automatic rfkill unblocking to installer
Automatically detect and unblock soft-blocked Bluetooth adapters during installation, preventing "Failed to set power on" errors on Raspberry Pi and other systems where rfkill may block the adapter by default. Changes: - Add rfkill soft-block detection in install.sh Step 5B - Automatically run 'sudo rfkill unblock bluetooth' when needed - Verify unblock succeeded before attempting power-on - Provide clear feedback during unblock process Fixes the root cause of power-on failures when adapter is soft-blocked, which was discovered during testing on Raspberry Pi Zero 2 W. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a0f361a3f4
commit
d46ee840b0
1 changed files with 18 additions and 0 deletions
18
install.sh
18
install.sh
|
|
@ -624,6 +624,24 @@ print_header "Bluetooth Adapter Power State"
|
|||
if command -v bluetoothctl &> /dev/null; then
|
||||
print_info "Checking Bluetooth adapter power state..."
|
||||
|
||||
# Check for rfkill blocks first (must be unblocked before power-on works)
|
||||
if command -v rfkill &> /dev/null; then
|
||||
if rfkill list bluetooth | grep -q "Soft blocked: yes"; then
|
||||
print_warning "Bluetooth adapter is soft-blocked by rfkill"
|
||||
print_info "Unblocking Bluetooth adapter..."
|
||||
sudo rfkill unblock bluetooth
|
||||
sleep 1
|
||||
|
||||
# Verify unblock succeeded
|
||||
if rfkill list bluetooth | grep -q "Soft blocked: yes"; then
|
||||
print_error "Failed to unblock Bluetooth adapter"
|
||||
print_warning "You may need to check hardware switch or BIOS settings"
|
||||
else
|
||||
print_success "Bluetooth adapter unblocked successfully"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if adapter is powered
|
||||
if bluetoothctl show | grep -q "Powered: yes"; then
|
||||
print_success "Bluetooth adapter is powered on"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue