Skip to content

FastAPI Dashboard showing USB co2 Meter Measurements

Notifications You must be signed in to change notification settings

sorgmi/co2meter-fastapi

Repository files navigation

CO2meter with FastAPI

Show a Dashboard with Co2 level and temperature readings from a USB Co2 Meter

This code is based on https://github.com/vfilimonov/co2meter. The Code is migrated to FastAPI (instead of Flask).

Download

You can download the windows executable here: https://github.com/sorgmi/co2meter-fastapi/releases

Installation

pip install -r requirements.txt

Usage

First test if the co2 meter is connected and we can get measurements. If your device sends encrypted data set bypass_decrypt=False

python test_device_connection.py  

    {'vendor_id': 1241, 'product_id': 41042, 'path': b'\\\\?\\HID#VID_04D9&PID_A052#7&393b50b7&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}', 'manufacturer': 'Holtek', 'product_name': 'USB-zyTemp', 'serial_no': '2.00'}
                        co2    temp
    2022-12-27 17:59:46  857  20.225

If this works, start the web server with:

python server.py  # add option -b if your device sends unencrypted data

If you downloaded the .exe file you can start it directly under Windows:

.\server.exe  # add option -b if your device sends unencrypted data

Create Executable (with Pyinstaller)

pyinstaller server.spec
.\server.exe 

Screenshot

Screenshot - dash web-server taken from https://github.com/vfilimonov/co2meter

About

FastAPI Dashboard showing USB co2 Meter Measurements

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published