Files
PlantPal/soilReporterNode/README.md
programmingPug 6f9273a902 Update README.md
2025-01-16 15:12:02 -05:00

51 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<br/>
<div align="center">
<a href="https://github.com/programmingPug/plantpal">
<img src="https://imgur.com/BdczfrQ.png" alt="Logo" width="80" height="80">
</a>
<h3 align="center">PlantPal</h3>
<p align="center">
Because knowing when to water your plants is hard
</p>
</div>
## Reporter node's features
### Captive Portal Configuration:
- Uses WiFiManager to allow a user to configure the WiFi credentials, API server URL, and scanning delay via a captive portal.
- A configuration mode is triggered automatically if no valid configuration is available or by user intervention via a dedicated button.
### BLE Scanning:
- Scans for BLE devices advertising a specific service UUID.
- Collects all sensor BLE addresses over a fixed scan period.
### Sequential Sensor Processing:
- Processes each discovered sensor one-by-one.
- For each sensor, the node:
1) Connects to the sensor via its BLE address.
2) Reads the sensor value from a characteristic.
3) Disconnects from the sensor.
### API Reporting:
- Constructs a JSON payload with the sensors BLE address as the device identifier, along with the measured moisture value.
- The payload is formatted according to a flattened model (including fields such as "deviceId", "moistureLevel", and a nested "device" object with "deviceId" and "nickname").
- Sends the payload via an HTTP POST request to your configured API endpoint.
### Configurable Scan Delay:
- Uses a user-configurable delay (default 30 seconds) between scan cycles so that after processing sensors, the node waits before scanning again.
### Robust Error Handling & State Management:
- Employs a simple state machine to manage scanning, connecting, and waiting phases.
- Includes duplicate filtering so the same sensor isnt processed multiple times in one cycle.
- Provides conditional debug logging to aid in troubleshooting and can be disabled for production builds.
### Watchdog Integration:
- Uses built-in ESP32 Wachdog methods to ensure continued device operation.