-
Notifications
You must be signed in to change notification settings - Fork 2
Embedded code - Complete Implementation of Embedded Code for Plant Water System - 3 #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MayureshMore
wants to merge
181
commits into
main
Choose a base branch
from
embedded-code
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merge pull request #139 from SE4CPS/embedded-code
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…om at an interval of 90 Sec
…er data retrieval.
…er data retrieval.
…er data retrieval.
…er data retrieval.
…ta and weather_fetched timestamp if new fetch fails.
…ta and weather_fetched timestamp if new fetch fails.
…ata transmission, and added raw ADC values to DB/CSV output with complete weather information.
…ata transmission, and added raw ADC values to DB/CSV output with complete weather information.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request marks the completion and full integration of the embedded code for the Plant Water System. The following key components have been implemented and tested:
Sensor Data Acquisition: The system reads sensor data through the ADS1115 and GPIO interfaces on the Raspberry Pi. Sensor readings (analog and digital states) are correctly converted and logged.
Data Storage and Logging: Sensor readings are stored in a SQLite database (plant_sensor_data.db) using the established schema (with data retention and backward compatibility ALTER statements). In addition, the data is concurrently logged into a CSV file (if enabled).
Backend API Communication: The send_data_api.py component has been integrated and thoroughly tested. It retrieves unsent rows from the database, assembles them into the expected JSON payload (wrapped within a "data" key), and sends the data to the backend endpoints (for auto-sending and on-demand current data) using curl. The system processes data in batches and uses persistent tracking (via last_sent_id.txt) to ensure that data is sent every minute without gaps or duplicates.
Error Handling and Scheduling: The system features robust error handling with exponential backoff for transient errors during data transmission. A scheduler continuously triggers the data sending process every minute, ensuring continuous and reliable data delivery to the backend.
Additional Integration: The project includes utility functions, a weather API module to retrieve current weather conditions, and a setup script along with a Dockerfile for streamlined deployment.
All embedded code components have been successfully implemented and tested. Data is transmitted properly every minute without any issues. This pull request is ready for integration into the main branch.
Please review and merge.