树莓派开始,玩转Linux

📅 2026/7/8 1:39:40
树莓派开始,玩转Linux
​蓝牙通信对象外设主动发起广播的设备。比如蓝牙耳机。中心设备扫描设备。比如手机。服务器上蓝牙命令bluetooth查看版本$bluetoothd-V查看状态$systemctlstatus bluetooth服务启动# 开启蓝牙服务$sudosystemetl start bluetooth# 关闭蓝牙服务$sudosystemetl stop bluetooth# 蓝牙服务随系统启动$sudosystemetlenablebluetooth使用bluetooth进入命令行# 显示可用的蓝牙模块list# 开启扫描scan onhciconfig服务器上也可以使用hciconfig来控制蓝牙服务下面的hci0指的是0好HCI设备即树莓派的蓝牙适配器。# 启动蓝牙模块$sudohciconfig hci0 up# 关闭蓝牙模块$sudohciconfig hci0 down实例准备操作:安装node.js外设安装bleno中心设备安装noble例子pizza$sudonodenode_modules/bleno/examples/pizza/peripheral$sudonodenode_modules/noble/examples/pizza/peripheral​