debian13+山泽USB蓝牙适配器5.3-成功

在 Debian 上使用蓝牙适配器连接手机(如 Android 或 iPhone)的步骤如下:


1. 准备工作

1.1 确保蓝牙适配器正常工作

lsusb | grep -i bluetooth   # 确认设备被识别
hciconfig -a                # 检查状态是否为 "UP RUNNING"
sudo systemctl status bluetooth  # 确保服务已启动

1.2 安装必要工具(如果未安装)

sudo apt update
sudo apt install bluez bluez-tools pulseaudio-module-bluetooth

2. 手机端准备

  • Android/iPhone
    1. 打开 设置 > 蓝牙
    2. 确保蓝牙可见性已开启(如“可被附近设备检测到”)。

3. 在 Debian 上连接手机

方法 1:使用 bluetoothctl(命令行)

  1. 进入交互模式:
    bluetoothctl
    
  2. bluetoothctl 中依次执行:
    power on                  # 打开蓝牙电源
    agent on                  # 启用代理
    default-agent             # 设置默认代理
    scan on                   # 扫描设备(约 10 秒)
    
  3. 找到手机的蓝牙名称和 MAC 地址(如 12:34:56:78:9A:BC My_Phone),然后:
    pair 12:34:56:78:9A:BC    # 配对设备
    trust 12:34:56:78:9A:BC   # 信任设备(下次自动连接)
    connect 12:34:56:78:9A:BC # 连接设备
    
  4. 手机端:确认配对请求(点击“配对”)。

方法 2:使用图形界面(推荐新手)

  1. 安装图形化管理工具:
    sudo apt install blueman
    
  2. 打开蓝牙管理器:
    blueman-manager
    
  3. 点击 搜索 > 选择手机 > 点击 配对,并在手机上确认。

4. 常见用途配置

4.1 传输文件(Android)

  • 安装文件传输支持
    sudo apt install obexftp obex-data-server
    
  • 使用 bluetoothctl 发送文件
    bluetoothctl
    connect 12:34:56:78:9A:BC
    quit
    obexftp --bluetooth 12:34:56:78:9A:BC -p /path/to/file.txt
    

4.2 共享网络(USB 网络共享)

  1. 手机端:启用“蓝牙网络共享”(Android:设置 > 网络共享)。
  2. Debian 端
    sudo apt install network-manager-gnome
    nm-connection-editor  # 添加蓝牙 DUN 连接
    

4.3 连接蓝牙耳机/音箱

pactl list sinks | grep -i blue  # 检查音频设备
pavucontrol                     # 在界面中选择蓝牙音频输出

5. 故障排除

5.1 配对失败

  • 删除旧配对记录
    bluetoothctl
    remove 12:34:56:78:9A:BC
    
  • 重启服务
    sudo systemctl restart bluetooth
    

5.2 连接不稳定

  • 编辑 /etc/bluetooth/main.conf
    ControllerMode = bredr  # 传统模式更稳定
    
  • 关闭低功耗模式:
    sudo btmgmt le off
    

5.3 权限问题

sudo usermod -aG bluetooth $USER
newgrp bluetooth

6. 验证连接

  • 查看已连接设备
    bluetoothctl info 12:34:56:78:9A:BC
    
  • 测试文件传输:通过 blueman 右键菜单发送文件。

总结流程图

1. 插适配器 → lsusb 确认
2. 启动服务 → systemctl start bluetooth
3. 扫描手机 → bluetoothctl scan on
4. 配对连接 → pair/connect MAC地址
5. 手机确认 → 点击“配对”

遇到具体错误时,请提供以下命令输出:

dmesg | grep -i blue
bluetoothctl show
posted @ 2025-07-14 14:48  黛色星霜  阅读(251)  评论(0)    收藏  举报