← 回到文章列表

OpenWRT下使用蓝牙共享网络

除了WIFI 蓝牙也可以用来共享网络 基于蓝牙PAN(蓝牙个人局域网) 只需要插一个USB Bluetooth Dongle就可以使用 操作如下

除了WIFI 蓝牙也可以用来共享网络
基于蓝牙PAN(蓝牙个人局域网)
只需要插一个USB Bluetooth Dongle就可以使用
操作如下

// 更新軟件列表 安裝藍牙相關套件
opkg update
opkg install kmod-bluetooth bluez-libs bluez-utils kmod-usb-core kmod-usb-uhci kmod-usb2 usbutils bluez-daemon bluez-utils kmod-input-uinput
// 查詢設備是否起來
lsusb -t
hciconfig -a
// 自啓動藍牙服務
/etc/init.d/bluetoothd enable
/etc/init.d/bluetoothd start
// 添加NAP支持
echo "[NAP Role]" >> /etc/bluetooth/network.conf
echo "Interface=pan0" >> /etc/bluetooth/network.conf
echo "Script=dhclient" >> /etc/bluetooth/network.conf
/etc/init.d/bluetoothd restart
// 手動啓動藍牙設備
hciconfig -a hci0 up
// 設置藍牙設備爲主模式
hciconfig -a hci0 lm master,accept
// 設置藍牙設備爲可見
hciconfig -a hci0 piscan
// 設置藍牙設備不可見
hciconfig -a hci0 noscan
// 注冊NAP模式 並且綁定到br-lan
dbus-send --system --dest=org.bluez /org/bluez/hci0 --type=method_call org.bluez.NetworkServer1.Register string:"00001116-0000-1000-8000-00805f9b34fb" string:"br-lan"
// 信任設備
bluetoothctl trust C0:E8:62:58:E3:B3

需要注意的是
每次重启路由器后需要重新设置hci0状态
推荐直接加到自启动项目中

在这里找找

输入关键词,找一篇过去的记录。