This GUI Application allows for processing and display of data generated from the car. It is broken down into a series of Windows, each with different types of connections. These include:
- Vehicle Window: Processes data in real time from the car (usually using data from XBee wireless modules)
- SD Window: Processes log files saved to an SD card on the car
- Database Window: Allows interaction with data from hostorical vehicle sessions
It is written Python using the PyQt GUI framework for the frontend.
The pipenv library is used to extablish a virtual project environment. The only prerequisite is that you have python version 3.10 installed (here).
Follow the steps below to run the project:
- Clone the repo (Navigate to your desired directory and run
git clone https://github.com/Northeastern-Electric-Racing/Telemetry-Hub.git
) - Install pipenv globally (
pip install --user pipenv
) - Navigate into the main directory (/Telemetry-Hub) and run
pipenv install
to install all project dependencies - Run
pipenv shell
to activate the virtual environment - Start the app with the command
python start.py
After the inital run, only steps 4/5 will be needed to run the app again (enter the environment and start the app).
NOTE: If any of the commands in steps 2-5 fail, prepend them with python -m
and try again.
If data is not being received from the XBee via the serial port, install the correct driver found here. This should only be an issue on Mac computers. Here is a guide with more information on installing the required drivers on a Mac.
NOTE: There is no current driver for Apple Silicon Macs, so these cannot be used to view live XBee data.
The application is written in python using the PyQt GUI toolkit. The following resources are good for an introduction to PyQt:
Python resources:
We're using autopep8 to automatically fix style errors with the code. Run using:
autopep8 -iraa ner_telhub
To run on any other directory, just swap the name with ner_telhub
.
It is also recommended to install a Python linting tool (if using VSCode you can easily install an extension).
To avoid the overhead of the GUI on large files, the ner_processing library can be run seperately. Follow the below steps:
- Create a directory called
logs
in the project root (same level asner_processing
), and place the log files to process - Start using the command
python -m ner_processing
. The output file will be written tooutput.csv
in the project root
In order to generate an executable, we are using pyinstaller. Follow these steps to generate the executable file:
- Build with the provided spec file depending on your OS by running
pyinstaller telhub_[platform].spec
(win for windows, mac for mac) - A folder located at
dist/telhub/
is generated. This is what's needed to run the app. To run, execute thetelhub.exe
executable in this folder
In order to install the app on a specific OS, follow directions here.
We shouldn't have to regenerate the spec files, but if needed, the following commands generated them:
- Windows:
pyinstaller -n "telhub" --add-data "resources/*;./resources" -i "resources/ner_logo.ico" -p "ner_processing" start.py
- Mac:
pyinstaller -n "telhub" -w --add-data "resources/*:./resources" -i "resources/ner_logo.icns" -p "ner_processing" start.py