蓝牙(低功耗蓝牙)实现主从数据收发功能
[TOC]
- ESP32 moudle with bluetooth
- Micropython v1.20 or later
Clone the repo
git clone https://github.com/Aoki-kelley/ESP32-BluetoothSerial.git
ESP32-BluetoothSerial
│ LICENSE
│ README.md
│
└─BluetoothSerial
│ BluetoothSerial.py # the library
│
└─examples
master_test.py
slave_test.py
需要一个ESP32模块做为主机端(master),一个ESP32模块作为从机端(slave),需要注意,开始数据传输之前要让主机端得到正确的从机端的MAC地址。ESP32模块默认使用随机地址,意味着每次重新运行模块或代码时都要重新确定地址
使用上类似Arduino的串口库,见 examples
目前存在一些问题:
- 从机发送,主机接收时,如果蓝牙连接断开将引发 OSError: [Errno 12] 错误
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
该项目使用Git进行版本管理。您可以在repository参看当前可用版本。
您也可以在贡献者名单中参看所有参与该项目的开发者。
该项目遵守 GPL v3 授权许可,详情请参阅 LICENSE.GPL-v3
该 README.md 模板遵守 MIT 协议,详情请参阅 LICENSE.MIT