Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Contains code that displays data from the MiniAQI device. For info on the device, see the accompanying blog post.


This repo uses poetry. You can install poetry globally:

$ pip install poetry


Use poetry to install dependencies:

$ poetry install

Invoke with poetry:

$ poetry run ./

You can get help by passing --help.


By default, this program will scan a few possible tty ports to find a PMS7003. You may wish to pass the location explicitly, by using --port <port>.

Also, by default, the program will print quality measurements to the terminal. It will also print them, in influxdb line protocol format, to measurements.log. You may wish to disable printing to the terminal with --log-only, and customize the location of the log file with --log-path.

Running as a systemd service

On a recent Linux, you can run this as a service. Modify the included mini-aqm.service file, and edit the WorkingDirectory and ExecStart variables. WorkingDirectory should point at the location where you have this repo checked out. ExecStart (and ExecStartPre) should have the path to your poetry binary -- find it with which poetry. You may also wish to customize the arguments to, for instance to set --log-path.

To install the service:

cat mini-aqm.service | sudo tee /etc/systemd/system/mini-aqm.service
sudo systemctl daemon-reload
sudo systemctl start mini-aqm

With telegraf

You might want to pull the measurements into a time series database using telegraf. You can do so by using the tail plugin. The configuration looks like this:

   files = ["/home/igor47/repos/mini-aqm/measurements.log"]

Customize the path where your measurements.log file is found. You may wish to pass an explicit path to using --log-path <path>.