Automates data collection with Bluetooth sensors from Apogee Instruments, Inc. using a Raspberry Pi
Project description
Apogee Connect for Raspberry Pi
Apogee Connect for Raspberry Pi is a lightweight script intended for automating the data collection process with Apogee's Bluetooth sensors. This command line application will automatically collect data from an Apogee Bluetooth sensor and store the data in a .csv file with various configurable options.
Table of Contents
Installation
Prerequisite
In order to install Apogee Connect for Raspberry Pi, you will need pip (the package installer for Python). Pip is likely already included by default on a Raspberry PI or if you installed Python from source or with an installer from python.org. You can confirm pip is installed by running the command:
pip --version
If pip isn't already installed, visit the following site for instructions on a simple pip installation:
https://pip.pypa.io/en/stable/installation/
Installation
- We recommend installing the app onto a Raspberry Pi using pipx, a tool that uses pip in order to install stand-alone command line applications in an isolated environment that won't affect or be affected by other installations. In terminal, run the following command (It may be necessary to close and restart the terminal after installing pipx for it to be recognized):
sudo apt install pipx
- Install Apogee Connect for Raspberry Pi from the Python Package Index by running the following command in terminal:
pipx install apogee-connect-rpi
- Add the install location to your PATH environment variables so that it can be run from anywhere in the terminal.
pipx ensurepath
- Verify installation by running the following command (It may be necessary to close and restart the terminal first for the changes to take effect):
apogee --version
Update
Whenever updates are available, the app can be updated simply by running the following command in terminal:
pipx upgrade apogee-connect-rpi
Uninstall
To uninstall, run the following command in terminal:
pipx uninstall apogee-connect-rpi
Basic Example
Note: apogee is the command that can be run from the terminal at any location to use the app.
- Scan for nearby Apogee sensors to obtain sensor's MAC address required for connection.
apogee scan
- Start collecting data from the sensor with the MAC address of AA:BB:CC:DD:EE:FF and set a logging interval of 10 minutes.
apogee collect AA:BB:CC:DD:EE:FF --interval 10
- See a list of all currently collecting sensors along with the number of logs currently collected, data file location, start/end time, etc.
apogee list
- Stop data collection from the sensor with the MAC address of AA:BB:CC:DD:EE:FF, but not until the epoch timestamp of 1726247820 (Unix timestamp in seconds).
apogee stop AA:BB:CC:DD:EE:FF --end 1726247820
Commands
Key:
apogee command <required_argument> [--optional_arguments (default: value)]
collect
Usage
Automatically collect data from an Apogee sensor and write the data to a csv file (All data is also logged in the sensor's internal memory and is automatically recovered in the event of an interruption in connection at the time of collection).
Example
apogee collect E8:63:32:06:6D:7D --interval 10 --start 1720647720 --end 1721250915 --file /usr/documents/greenhouse-data.csv --append
Documentation
apogee collect <MAC address> [--interval (default: 5)] [--start (default: Now)] [--end (default: Never)] [--file (default: ./data/MAC_address.csv)] [--append]
| Argument | Default Value | Usage |
|---|---|---|
| Mac Address | N/A (required) | MAC address of sensor in the format of AA:BB:CC:DD:EE:FF |
| -i, --interval | 5 minutes | Collect data every set number of minutes (must be a positive integer) |
| -s, --start | Now | Start time for data collection using epoch time (Unix timestamp in seconds) |
| -e, --end | Never | End time for data collection using epoch time (Unix timestamp in seconds) |
| -f, --file | ./data/MAC_address.csv | File path to write data to csv file. Will create folders and files is they don’t exist. |
| -a, --append | N/A | Add this flag to automatically append data to the file if it exists instead of overwriting. |
config
Usage
Change or view the application settings.
Example
apogee config --filepath /usr/documents/live-data --precision 4 --temp F --par-filtering True
apogee config --reset
Documentation
apogee config [--filepath (default: ./data/)] [--precision (default: 2)] [--temp (default: C)] [--par-filtering (default: False)] [--collection-frequency (default: 5)]
| Argument | Default Value | Usage |
|---|---|---|
| (N/A) | (N/A) | If no optional arguments are provided, the current configuration will be displayed. |
| -f, --filepath | ~/Apogee/apogee-connect-rpi/data/ | The default folder to save collected data. Adjust to avoid needing to specify full filepath every time data collection is initiated. |
| --p, --precision | 2 | Maximum number of decimal places for live data. |
| -t, --temp | C | Change preferred temperature units. Enter “C” for Celsius and “F” for Fahrenheit (without quotations). |
| -pf, --par-filtering | False | Filter negative PAR (PPFD) values to compensate for sensor "noise" in low-light conditions. Enter "True" or "False" (without quotations). |
| -cf, --collection-frequency | 5 | Frequency in minutes to check for new data logs and add to .csv data file (This is different than the data logging interval for the sensor). Must be between 5 - 60 minutes. |
| -r, --reset | N/A | Add this flag to reset configuration back to default values. |
list
Usage
List all the sensors currently collecting data.
Example
apogee list
Documentation
apogee list
scan
Usage
Scan for nearby Apogee sensors
Example
apogee scan --time 10
Documentation
apogee scan [--time (default: 5-20)]
| Argument | Default Value | Usage |
|---|---|---|
| -t, --time | 5-20 | Number of seconds to scan for Apogee Bluetooth sensors. If not set, scanning will continue until no new sensors are being discovered or a maximum of 20 seconds. |
stop
Usage
Stop data collection from an Apogee sensor. Can optionally use the --all flag to stop data collection from all Apogee sensors instead.
Example
apogee stop E8:63:32:06:6D:7D --end 1724428813
apogee stop --all
Documentation
apogee stop <MAC address> [--end (default: now)]
| Argument | Default Value | Usage |
|---|---|---|
| MAC address | N/A (required) | MAC address of sensor in the format of AA:BB:CC:DD:EE:FF (Required unless the '--all' flag is used). |
| -e, --end | Now | End time for data collection using epoch time (Unix timestamp in seconds). Cannot be used when using the '--all' flag. |
| -a, --all | N/A | Stop data collection for all sensors (Can be used instead of the MAC address requirement). |
version
Usage
Show current application version
Example
apogee --version
Documentation
apogee --version
help
Usage
Show help menu for entire application or for specific command, depending on usage
Example
apogee --help
apogee collect --help
Documentation
Entering just --help (or -h) will show a high-level overview of available commands.
Entering a command followed by --help will show a menu with required and optional arguments.
Any unrecognized command will also print the high-level overview help menu.
Contact
For more information or additional help, contact Apogee Instruments at: techsupport@apogeeinstruments.com or +1(435)245-8012
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apogee_connect_rpi-0.2.1.tar.gz.
File metadata
- Download URL: apogee_connect_rpi-0.2.1.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03690499fbdffba912fd4f16fa274ca673e428165549027c356ffdccd79bd37b
|
|
| MD5 |
8f58bd12f4611140c235a1289df25760
|
|
| BLAKE2b-256 |
6dd9b3a7509f8636138b080b5bde30a07529b2dc23c9bb90894e92075a6375d5
|
File details
Details for the file apogee_connect_rpi-0.2.1-py3-none-any.whl.
File metadata
- Download URL: apogee_connect_rpi-0.2.1-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a83c3acbebc1b22b02d04565cbac7d2260a8d5d6065766bdc4b9705aec1fb5dc
|
|
| MD5 |
9b322051c1ce2cb1aad9f94d6b8b13ec
|
|
| BLAKE2b-256 |
73ed7b4302bf510b557871e98b8957422ce26f6c57a304bbe76e1a50ddd7e865
|