840922704 / BLE_DMM_Client

Bluetooth Multimeter Client
GNU General Public License v3.0
10 stars 3 forks source link

BLE_DMM_Client 蓝牙万用表客户端

An Bluetooth Multimeter Client. Using Pyside6 and bleak.
适配市场主流蓝牙通讯的万用表,使用pyside6和bleak

UI

v3.2 in win11:

image

Support DMM Models

Type: Models Test
1. Multimeter (1): Aneng 9002 BSIDE ZT-300AB ZOYI ZT-300AB Yes
2. Small-Multimeter (2): Aneng V05B BSIDE ZT-5B ZOYI ZT-5B Yes
3. Clamp-Multimeter (3): Aneng ST207 BSIDE ZT-5BQ ZOYI ZT-5BQ Yes
4. Desk-Multimeter (4): Aneng AN999S ZOYI ZT-5566S Not completely

Just tested with ZOYI ZT-300AB. This solution is very cheap, I just bought a new one by ~ 100 RMB (~ 10 + USD).

This is the cheapest with capability to connect with Mobile Phone or Computer. They officially provide Mobile Phone version. So I just open this project for fun.

Supported OS

Operate System Code Version Released Version Test
Windows x86/x64 10 and above* x64 10 and above* Yes
Linux x86/x64 No Not completely
Mac OS x86/x64 No Not completely

* Because the BLE module bleak just support win10 and above in windows platform.
Windows(10 and above), Linux and MAC OS (platform supported by python).
Just tested in Windows and exe release version of Windows.

Achived functions

Development

Requirements

Python 3.8
pyside6 pyqtgraph qt_material bleak
pyinstaller (nuitka not recommend because of seriously memory leak problem)
If using Linux, need BlueZ >= 5.43 (additionally required by bleak)
Whether using conda (or other virtual env management) or not, it's recommended to use 'pip install' to install all packages listed in requirements.txt.
Run:

python main.py

The way to pack for Windows:

Environment:

First install the pyinstaller:
pip install pyinstaller

Pack (Scripts for Windows)

See the files in releases fold for detail.

PyInstaller

Enter your enviroonment (Virtual recommand) -> Install all packages needed -> Run the file: "/Releases/Win64/1.pyinstaller.bat".
Note: All the resource files are included in ./Ui/resources.qrc.

Advanced Installer

Then, for Windows, you can run directly or pack it with NSIS or other pack programs such as advanced installer.
For example, using "BLE DMM Client.aip" in "/Releases/Win64/Advanced_Install".

Zip for Releases

Run "/Releases/Win64/3.Copy_and _Compress.bat".

Known issues

Memory leak

Packing by Nuitka will cause a serious memory leak problem, so PyInstaller is recommended.

Compiled file may get the error below:

File "C:\MAIN~1.DIS\pyqtgraph\graphicsItems\ButtonItem.py", line 19, in __init__
ZeroDivisionError: float division by zero

They just fix this bug in 2022.04, if you use old version, please fix it manually, change line 18 of ButtonItem.py in your env: if width is not None: to if width is not None and self.pixmap.width():
Cross-platform ability in theory, but not tested yet.

qt_material issue

qt_material's dark theme have some issues with pyside6. Current version (2.14) not fixed yet, so manually add part of stylesheet in main.py.

self.apply_stylesheet(self, theme='dark_lightgreen.xml', extra=extra)
tooltip_stylesheet = """
    QToolTip {
        background-color: black;
    }
    QComboBox {
        color: white;
    }
"""
self.setStyleSheet(self.styleSheet()+tooltip_stylesheet)

License

GPL v3.0

References

https://github.com/ludwich66/Bluetooth-DMM
https://github.com/Shiro-Nek0/Bluetooth-DMM.py
https://github.com/webspiderteam/Bluetooth-DMM-For-Windows/tree/master/BluetoothLEExplorer