This repository contains source code for the Environmental Monitoring Toolkit.
The result is a CLI utility (called enmon) that reads hardware sensor data via HARDWARIO Bridge Module such as:
- Temperature (from Humidity Tag or Climate Module)
- Humidity (from Humidity Tag or Climate Module)
- Illuminance (from Lux Meter Tag or Climate Module)
- Pressure (from Barometer Tag or Climate Module)
- Altitude (from Barometer Tag or Climate Module)
The read values are printed to the console (via stdout) and can be easily piped to other tools.
This tool is also integrated with HARDWARIO Playground so you can easily use it altogether with Node-RED.
HARDWARIO Bridge Module does not need any drivers as it uses USB HID for communication.
- Host with Windows, macOS, or Linux operating system
- HARDWARIO Bridge Module
- Micro USB cable
You will need CMake + C compiler (GCC, LLVM Clang, or MSVC) to build the binary.
Just follow these steps:
-
Open the Terminal app or Command Prompt.
-
Clone the repository:
$ git clone https://github.com/hardwario/enmon.git -
Go to the repository:
$ cd enmon -
Create the
builddirectory:$ mkdir build -
Go to the
builddirectory:$ cd build -
Let CMake create the build script:
$ cmake .. -
Start the actual build:
$ cmake --build .
The result is the single enmon (or enmon.exe) executable in the build directory. Feel free to copy it where you want.
You can invoke the help:
$ ./enmon --help
Run without arguments will read the sensor data, print them, and exit:
$ ./enmon
@SENSOR: "Temperature",27.20
@SENSOR: "Humidity",50.2
@SENSOR: "Illuminance",25
@SENSOR: "Pressure",95306
@SENSOR: "Altitude",514.2
You can force the program to continuously read the sensors with a specified delay:
$ ./enmon --loop --delay=5
@SENSOR: "Temperature",27.20
@SENSOR: "Humidity",50.2
@SENSOR: "Illuminance",25
@SENSOR: "Pressure",95306
@SENSOR: "Altitude",514.2
@SENSOR: "Temperature",27.20
@SENSOR: "Humidity",50.2
@SENSOR: "Illuminance",25
@SENSOR: "Pressure",95306
@SENSOR: "Altitude",514.2
On Linux, it is important to get the udev properly configured so you won't need the admin right to access the device. Please, follow these steps:
-
Install the dependencies:
# apt install -y build-essential cmake libudev-dev -
Create the file
/etc/udev/rules.d/99-enmon.rules:SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6030", MODE="0666" -
Reload the
udevrules:# udevadm control --reload
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by HARDWARIO a.s. in the heart of Europe.