This inspiration for this project was to help remove the need for an AirThings Hub to collect data from AirThings WavePlus sensors. Instead, we use a Raspberry Pi (RPi) that periodically pings a specified, nearby AirThings device via bluetooth to gather and store data. We can easily access the RPi for data at any point so long as it is connected to WiFi.
This repository was forked from https://github.com/kogant/waveplus-reader
Data are collected via a Python script read_data.py that, once executed, runs indefinitely collecting data at 1-minute intervals and appending these data to a locally-stored daily CSV file within in the /home/pi/DATA
directory.
The libraries needed to run this project as intended are listed in the install.sh script, but we highlight some of the more important ones below:
- python 3.7+
- pip3
- bluepy
- NumPy and Pandas
- On the RPi, install git and clone this repo
sudo apt install git
git clone https://github.com/intelligent-environments-lab/airthings-waveplus-beacon.git
- Run the install shell script with
sh install.sh
- The
read_data.py
script is meant to run indefinitely in the background so we enable it on boot with a service file. First, edit the fileread_data.service
by including the 11-digit serial number of the AirThings Device at the end of theExecStart
line. Then, to create and enable the service, run:
sh services/services.sh
-
Reboot the device and check that data has been added to the
/home/pi/DATA/
directory (you might need to create this location withmkdir DATA
). If no data are available, usesudo journalctl -u read_data.service
to check and debug the errors you see. -
You can also test the script by running the Python script directly from the command line:
sudo python3 /home/pi/airthings-waveplus-beacon/src/read_data.py <airthings_serial_number>