Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.77 KB

project_structure_README.md

File metadata and controls

60 lines (38 loc) · 2.77 KB

BLE GATT Client (Send/Receive Data)

Installing Requirements (pip)

The requirements needed to run this project were automatically generated by using pipreqs. The following process was used to generate the list of required Python dependencies.

  1. In the base project dir, install the package using: pip install pipreqs

  2. To generate a Python dependencies list, enter cmd: pipreqs . --ignore ".venv"

    1. This command generates a "requirements.txt" file with the required dependencies.
  3. Install the list of dependencies using: pip install -r requirements.txt

If using PyCharm, these dependencies are only installed within the scope of the (venv).

Pysetupdi

To use the Bleak (BLE) Library, it was necessary to manually download a Python library called pysetupdi.

The Project Page for this Library can be found here: https://github.com/gwangyi/pysetupdi

This ZIP file has also been locally stored as part of this repo (including the embedded .git folder). Once the contents of the ZIP have been extracted, you can begin the installation process using the following command:

python .\setup.py install

Folder Structure

The repo is divided into the following structure:

  • debugging_utilities: Files that were useful while developing the early stages of the code.
  • pyinstaller-build: The files that were generated by the PyInstaller Build. These files are overwritten when a new build is started (using the recommended pyinstaller command).
  • pyqt5-tools: The files which were downloaded locally to this repo to use the Qt5 framework.
  • pysetupdi: A library that was required for using the Bleak (BLE) Library for Python.
  • src: Contains the entirety of the application files (except for main.py).
  • tests: Automated unit tests for some of the functions (some of the tests require ESP32-BLE-Server to work).

Executable Artifact Build (.EXE)

The PyInstaller tool (v6.6.0) was used to produce the final (.EXE) artifact.

To install the PyInstaller tool, use the following command in the terminal: pip install pyinstaller

Note: The PyInstaller package is not listed in the "requirements.txt" file because it was not imported into any of the packages in the code.

To produce the build artifacts, the following command was used in the terminal:

pyinstaller -F --noconsole --distpath pyinstaller-build --workpath pyinstaller-build --specpath pyinstaller-build --name BLE_GATT_Client_for_Windows .\main.py

All the artifacts from the build are stored in the pyinstaller-build directory.

System Logs

The EXE file is designed to create a logs directory at (C:\BLE_Client_Logs). This directory would normally contain a single log file corresponding to the latest execution of the (.EXE) app.

Every time we open this app, that Log file is overwritten.