sudo apt install python3-pyqt5
sudo apt install python3-pyqt5.qtbluetooth
sudo hcitool lescan
https://www.jaredwolff.com/get-started-with-bluetooth-low-energy/
sudo gatttool -b E5:76:86:2B:B4:F8 -I
[E5:76:86:2B:B4:F8][LE]> connect
Attempting to connect to E5:76:86:2B:B4:F8
Connection successful
[E5:76:86:2B:B4:F8][LE]> primary
attr handle: 0x0001, end grp handle: 0x0005 uuid: b2bbc642-46da-11ed-b878-0242ac120002
[E5:76:86:2B:B4:F8][LE]> char-desc
handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0003, uuid: c9af9c76-46de-11ed-b878-0242ac120002
handle: 0x0004, uuid: 00002902-0000-1000-8000-00805f9b34fb
[E5:76:86:2B:B4:F8][LE]> char-write-req 0x0003 hi
Characteristic value was written successfully
[E5:76:86:2B:B4:F8][LE]> char-read-hnd 0x0003
Characteristic value/descriptor: 49 20 61 6d 20 63 68 61 72 61 63 74 65 72 69 73 74 69 63 20 76 61
[E5:76:86:2B:B4:F8][LE]> disconnect
(gatttool:59038): GLib-WARNING **: 12:23:05.002: Invalid file descriptor.
[E5:76:86:2B:B4:F8][LE]>
[E5:76:86:2B:B4:F8][LE]> help
help Show this help
exit Exit interactive mode
quit Exit interactive mode
connect [address [address type]] Connect to a remote device
disconnect Disconnect from a remote device
primary [UUID] Primary Service Discovery
included [start hnd [end hnd]] Find Included Services
characteristics [start hnd [end hnd [UUID]]] Characteristics Discovery
char-desc [start hnd] [end hnd] Characteristics Descriptor Discovery
char-read-hnd <handle> Characteristics Value/Descriptor Read by handle
char-read-uuid <UUID> [start hnd] [end hnd] Characteristics Value/Descriptor Read by UUID
char-write-req <handle> <new value> Characteristic Value Write (Write Request)
char-write-cmd <handle> <new value> Characteristic Value Write (No response)
sec-level [low | medium | high] Set security level. Default: low
mtu <value> Exchange MTU for GATT/ATT
sudo systemctl restart bluetooth
udo hciconfig hci0 reset
sudo systemctl status bluetooth
- Scan BLE
- https://github.com/bryanodonoghue/artisan/blob/f417c409b52c124ac187c3e24e0aeea24ef17af1/src/artisanlib/ble.py
- https://github.com/Scummer/carrera-rms/blob/fa155dc7f75df8ad77c18d34c3563bc8d6f8d516/rms_UDP.py
- https://github.com/msstate-athlete-engineering/soft-sensors-research/blob/5f9b7fd3737d5c27029751453411f4f5c558d05b/openSRS-manager/SSTK-lab-manager/drivers/AthEngDCMk1.py
- https://github.com/JanCBrammer/OpenHRV/blob/42434bff8753bfc6b284643ac6b0c99f2e504673/openhrv/sensor.py
- https://github.com/artisan-roaster-scope/artisan/blob/c63ae3a497b023c0704e3d2799cdd670c02b3f37/src/artisanlib/ble.py
- https://github.com/search?q=QLowEnergyController+language%3APython&type=code&l=Python