28 lines
809 B
Markdown
28 lines
809 B
Markdown
# 蓝牙通讯例子
|
||
|
||
### 概述
|
||
希望用于通过蓝牙RSSI值判断距离的研究。
|
||
|
||
### 组件
|
||
- github.com/paypal/gatt
|
||
|
||
### 部署
|
||
- sudo hciconfig hci0 down
|
||
- sudo service bluetooth stop
|
||
|
||
### QA
|
||
- Failed to open device, err:no supported devices available
|
||
> 执行权限不够导致设备找不到,记得sudo
|
||
- 查看raspberrypi几位系统
|
||
> getconf LONG_BIT
|
||
- 查看操作系统信息
|
||
> lsb_release -a
|
||
- 直接查看系统的架构
|
||
> arch
|
||
- gatt supports both Linux and OS X.
|
||
> 不支持windows,不支持windows,不支持windows!
|
||
> 交叉编译为macos,也不支持!!!
|
||
|
||
### 意外收获
|
||
- 在低性能硬件上的程序优化
|
||
golang 中使用channel提高并发能力;influxdb中使用批量写入提高性能,此二项性能提高从原CPU 100%变成小于20% |