The SnifferBuddy project comes with software that listens for the SnifferBuddy readings coming in over mqtt and:
- calculates the vpd.
- stores the reading into a DuckDB database.
This way, any UI that can read/write DuckDB tables can be used to view the data. The software is designed to be run on a Raspberry Pi.
The workflow for handling SnifferBuddy readings involves the following steps:
-
Starting the Workflow
The process begins with thestart_capture.py
script, which initializes the capture and processing of readings. -
Listening for Readings
Themqtt_code.py
script uses MQTT to listen for SnifferBuddy readings. It receives the data and processes it. -
Processing the Readings
The readings are transformed into aSCD4XSensorReading
Pydantic model, which includes the calculation ofvpd
(vapor pressure deficit).- VPD Calculation: The
vpd
is derived using the temperature and relative humidity from the reading. - Assumption: Leaf temperature is assumed to be 2°C lower than the air temperature.
- VPD Calculation: The
-
Storing the Processed Data
The processed reading is passed todatabase_code.py
, which saves it into thesniffer_data.duckdb
database file.
The schema consists of one table, the readings
table.
Below is a detailed description of each column in the schema:
Column Name | Data Type | Description |
---|---|---|
timestamp |
TIMESTAMP |
The primary key. Indicates the time the reading was taken. |
device_name |
TEXT |
The name or identifier of the SnifferBuddy device providing the reading. |
light_on |
BOOLEAN |
Indicates whether the light was on (TRUE ) or off (FALSE ) during the reading. |
CO2 |
INTEGER |
The CO2 concentration level measured in parts per million (ppm). |
temperature |
REAL |
The air temperature at the time of the reading. |
humidity |
REAL |
The relative humidity percentage recorded. |
vpd |
REAL |
The calculated vapor pressure deficit (in kPa). |
dew_point |
REAL |
The dew point temperature. |
temp_unit |
TEXT |
The unit of the temperature reading, "C" (Celsius) or "F" (Fahrenheit). |
sudo apt update && sudo apt install pipx
pipx install --force git+https://github.com/solarslurpi/snifferbuddy
go to: /lib/systemd/system
copy the snifferbuddy service file:
sudo wget https://raw.githubusercontent.com/solarslurpi/snifferbuddy/main/snifferbuddy.service
sudo systemctl enable snifferbuddy