EerieLeap is an open-source sensor monitoring system built with .NET Core. It provides a robust platform for reading, processing, and managing sensor data with support for both physical ADC sensors and virtual calculated sensors.
- 🔌 ADC Integration: Direct interface with ADC hardware for real-time sensor readings
- 🔄 Virtual Sensors: Create derived measurements using mathematical expressions
- 🌐 RESTful API: Full HTTP API for configuration and data access
- ⚡ Real-time Updates: Continuous sensor monitoring with configurable sampling rates
- 📊 Flexible Configuration: JSON-based configuration for ADC and sensor settings
- 🧮 Expression Engine: Advanced mathematical expressions for sensor value conversion and virtual sensor calculations
- .NET 6.0 or later
- Compatible ADC hardware
- Clone the repository:
git clone https://github.com/yourusername/eerie_leap.git
cd eerie_leap
- Build the solution:
dotnet build
- Run the application:
dotnet run --project EerieLeap
To build deb package, install dotnet-packaging globaly:
dotnet tool install --global dotnet-deb
Then run, from project root:
dotnet deb ./EerieLeap/EerieLeap.csproj --runtime linux-x64 --output ../build/linux_x64
The resulting package can be found in the build/linux_x64
directory.
To debug the code generated by Metalama aspects, use:
dotnet build ./EerieLeap -p:MetalamaDebugTransformedCode=True
This will enable debugging of the transformed source code. The transformed files are written to obj/Debug/metalama
(or obj/Release/metalama
for release builds).
For more information about the Metalama compiler and its capabilities, see the Metalama Compiler documentation.
The system uses several configuration files:
The appsettings.json
file in the EerieLeap project contains application-level settings:
ConfigurationPath
: Path to the directory containing sensor and ADC configurations- Standard ASP.NET Core settings (logging, etc.)
The Properties/launchSettings.json
file configures the application's runtime environment:
- HTTP/HTTPS URLs and ports
- Environment variables
- Runtime profile settings
These files are stored in the directory specified by ConfigurationPath
:
The adc.json
file contains device-specific settings that control how the ADC hardware operates, including sampling rates, conversion modes, and power settings. The configuration structure depends on the specific ADC hardware being used.
The sensors.json
file defines two types of sensors:
Physical sensors represent direct connections to ADC channels. Their configuration includes:
- Channel assignment
- Voltage ranges for input
- Value ranges for output
- Units and sampling rates
- Custom conversion expressions using NCalc (voltage value referenced as 'x')
Both physical and virtual sensors use the NCalc expression evaluation engine:
- For physical sensors: transforms raw voltage readings ('x') into final values
- For virtual sensors: combines readings from other sensors (referenced as {sensor_id})
- Supports arithmetic operations, mathematical functions (Sin, Cos, Log, etc.), and constants (PI, E)
For detailed expression syntax and capabilities, refer to the NCalc documentation.
Virtual sensors perform calculations based on readings from other sensors.
GET /config
- Get complete configurationGET /config/adc
- Get ADC configurationPOST /config/adc
- Update ADC configurationGET /config/sensors
- Get all sensor configurationsPOST /config/sensors
- Update sensor configurationsGET /sensors/{id}
- Get specific sensor configuration
GET /readings
- Get all current sensor readingsGET /readings/{id}
- Get reading for specific sensor
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.