Python package for Environmental NeTworked Sensor (ENTS)
Project description
Soil Power Sensor Python Protobuf Bindings
The soil power sensor protobuf protocol is implemented as a Python package that allows for Measurement messages to be decoded into a dictionary and Response messages to be encoded. The generated files from protobuf are also accessible for more complex use cases.
Installation
Use the following to install the ents package with gui via pip:
pip install ents
You can also install the package from source with the following:
# install package
pip install .
If you are planning to develop the package we recommend you install the package in editable mode with development dependencies. This allows you to make changes to the source code and have them reflected in the package without needing to reinstall it.
# install development dependencies
pip install -e .[dev]
To install the deprecated user config gui, use the following: =
pip install -e ents[gui]
Simulator (New)
The webserver tools/http_decoder.py can be used to decode uploaded measurements.
CLI Usage
usage: ents sim_generic [-h] [-v] [--url URL] --sensor SENSOR [SENSOR ...] [--min MIN] [--max MAX] --cell CELL --logger LOGGER [--start START] [--end END] [--freq FREQ] {batch,stream}
positional arguments:
{batch,stream} Upload mode
options:
-h, --help show this help message and exit
-v, --verbose Print addiitional request information.
--url URL URL of the dirtviz instance (default: http://localhost:8000)
--sensor SENSOR [SENSOR ...]
Type of sensor to simulate
--min MIN Minimum sensor value (default: -1.0)
--max MAX Maximum sensor value (default: 1.0)
--cell CELL Cell Id
--logger LOGGER Logger Id
Batch:
--start START Start date
--end END End date
Stream:
--freq FREQ Frequency of uploads (default: 10s)
Examples
You can find the available sensors in the sensors.proto file.
Example uploading single measurement
ents sim_generic stream --sensor POWER_VOLTAGE --min 20 --max 30 --cell 1 --logger 1
Example uploading multiple measuremnets
ents sim_generic stream --sensor TEROS12_VWC_ADJ TEROS12_TEMP TEROS12_EC --min 10 --max 100 --cell 1 --logger 1
Example batch uploads
ents sim_generic batch --sensor POWER_CURRENT --cell 1 --logger 1 --start 2026-01-19 --end 2026-01-20 --freq 60
Simulator (Old)
Simulate WiFi sensor uploads without requiring ENTS hardware.
Examples
The examples below can be tested standalone (without ents-backend), by running the http server in tools/http_server.py to see the request format.
Upload a days worth of power measurements on a 60 second interval
ents sim --url http://localhost:3000/api/sensor/ --mode batch --sensor power --cell 200 --logger 200 --start 2025-05-01 --end 2025-05-02 --freq 60
...
total: 1437, failed: 0, avg (ms): 0.10716012526096033, last (ms): 0.0896
total: 1438, failed: 0, avg (ms): 0.10714290681502087, last (ms): 0.0824
total: 1439, failed: 0, avg (ms): 0.10712599027102154, last (ms): 0.0828
total: 1440, failed: 0, avg (ms): 0.10710909722222223, last (ms): 0.0828
total: 1441, failed: 0, avg (ms): 0.10709035392088828, last (ms): 0.08009999999999999
Done!
Upload measurements every 10 seconds
ents sim --url http://localhost:3000/api/sensor/ --mode stream --sensor power --cell 200 --logger 200 --freq 10
Use CTRL+C to stop the simulation
total: 1, failed: 1, avg (ms): 23.386100000000003, last (ms): 23.386100000000003
total: 2, failed: 2, avg (ms): 13.668950000000002, last (ms): 3.9517999999999995
total: 3, failed: 3, avg (ms): 10.795566666666668, last (ms): 5.0488
total: 4, failed: 4, avg (ms): 8.97235, last (ms): 3.5027000000000004
Testing
To run the package tests, create a virtual environment, install as an editable package (if you haven't done so already), and run unittest.
cd python/
python -m unittest
Project details
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 ents-2.3.6.tar.gz.
File metadata
- Download URL: ents-2.3.6.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef331b60a8a62594511727d0bc19d48f5c7556784ddf5f0fcde82462f32aff25
|
|
| MD5 |
07f9ba07bfbad88a37d4a9b8587808ea
|
|
| BLAKE2b-256 |
bb487fcef356603a2b85c2fc9238a58b862d680a5becf2f4e8141383e3866132
|
Provenance
The following attestation bundles were made for ents-2.3.6.tar.gz:
Publisher:
publish-python.yaml on jlab-sensing/ENTS-node-firmware
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ents-2.3.6.tar.gz -
Subject digest:
ef331b60a8a62594511727d0bc19d48f5c7556784ddf5f0fcde82462f32aff25 - Sigstore transparency entry: 845072856
- Sigstore integration time:
-
Permalink:
jlab-sensing/ENTS-node-firmware@c5c7d364068dc00ec7cdce562b29ab6a69ed8ca6 -
Branch / Tag:
refs/tags/2.3.6 - Owner: https://github.com/jlab-sensing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yaml@c5c7d364068dc00ec7cdce562b29ab6a69ed8ca6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ents-2.3.6-py3-none-any.whl.
File metadata
- Download URL: ents-2.3.6-py3-none-any.whl
- Upload date:
- Size: 43.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f86716391fe15587d6a4a392f8687c9454d7a026773f6e0133909a001a954073
|
|
| MD5 |
9408d873d0cea9d4a68c1ed017b08e97
|
|
| BLAKE2b-256 |
2fce04f45196d360bce592f5d226fbf6ce9340b641280b414b8890282e18b2d0
|
Provenance
The following attestation bundles were made for ents-2.3.6-py3-none-any.whl:
Publisher:
publish-python.yaml on jlab-sensing/ENTS-node-firmware
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ents-2.3.6-py3-none-any.whl -
Subject digest:
f86716391fe15587d6a4a392f8687c9454d7a026773f6e0133909a001a954073 - Sigstore transparency entry: 845072862
- Sigstore integration time:
-
Permalink:
jlab-sensing/ENTS-node-firmware@c5c7d364068dc00ec7cdce562b29ab6a69ed8ca6 -
Branch / Tag:
refs/tags/2.3.6 - Owner: https://github.com/jlab-sensing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yaml@c5c7d364068dc00ec7cdce562b29ab6a69ed8ca6 -
Trigger Event:
push
-
Statement type: