{"id":26665299,"url":"https://github.com/cbaie9/projet72_fruitsec","last_synced_at":"2026-04-12T01:35:10.293Z","repository":{"id":284333561,"uuid":"927599894","full_name":"cbaie9/projet72_fruitsec","owner":"cbaie9","description":"Source code for 72h projet","archived":false,"fork":false,"pushed_at":"2025-05-20T09:06:00.000Z","size":17210,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T18:02:58.094Z","etag":null,"topics":["arduino","mariadb","node-red","node-red-dashboard","raspberry-pi","sql"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbaie9.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-05T08:21:01.000Z","updated_at":"2025-05-20T09:06:04.000Z","dependencies_parsed_at":"2025-10-21T18:02:46.968Z","dependency_job_id":null,"html_url":"https://github.com/cbaie9/projet72_fruitsec","commit_stats":null,"previous_names":["cbaie9/projet72_fruitsec"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cbaie9/projet72_fruitsec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaie9%2Fprojet72_fruitsec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaie9%2Fprojet72_fruitsec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaie9%2Fprojet72_fruitsec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaie9%2Fprojet72_fruitsec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbaie9","download_url":"https://codeload.github.com/cbaie9/projet72_fruitsec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaie9%2Fprojet72_fruitsec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280308521,"owners_count":26308494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","mariadb","node-red","node-red-dashboard","raspberry-pi","sql"],"created_at":"2025-03-25T17:36:38.689Z","updated_at":"2025-10-21T18:03:48.652Z","avatar_url":"https://github.com/cbaie9.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fruit Drying System - Project P72H\n\n## Overview\n\nThis project is a system for monitoring and controlling a fruit drying process. It utilizes an Arduino for collecting temperature and humidity data, a webcam for visual monitoring, Node-RED for data processing and flow management, a MySQL database for data storage, and Discord webhooks for status alerts. The system also integrates external weather data via API.\n\n## Architecture\n\nThe system architecture can be visualized as follows:\n\n```mermaid\nsequenceDiagram\n    participant Arduino\n    participant DHT22 Sensor\n    participant Node-RED\n    participant MySQL Database\n    participant Discord\n    participant OpenWeatherMap API\n    participant Webcam\n\n    Arduino-\u003e\u003eDHT22 Sensor: Request Temp/Humid\n    DHT22 Sensor--\u003e\u003eArduino: Send Temp/Humid Data\n    Arduino-\u003e\u003eNode-RED: Send Temp/Humid Data (Serial)\n    Node-RED-\u003e\u003eMySQL Database: Insert Temp/Humid Data\n    Node-RED-\u003e\u003eDiscord: Send Status Alerts (Webhook)\n    Node-RED-\u003e\u003eOpenWeatherMap API: Request Weather Data\n    OpenWeatherMap API--\u003e\u003eNode-RED: Send Weather Data\n    Node-RED-\u003e\u003eWebcam: Trigger Image Capture\n    Webcam--\u003e\u003eNode-RED: Image Data\n    Node-RED-\u003e\u003eDashboard: Display Data and Image\n```\n\n## Components\n\n- **Arduino**: Reads temperature and humidity from DHT22 sensor and controls a servo motor and NeoPixels.\n  - `arduino/code_read_V1.ino`: Basic DHT22 sensor reading.\n  - `arduino/code_read_V1_1/code_read_V1_1.ino`: Advanced version with servo and NeoPixel control based on sensor data.\n\n- **Node-RED**: Visual tool for wiring together hardware devices, APIs, and online services.\n  - `node_red/flows.json`: Defines the data flow, including data collection, database interaction, and alerts.\n  - [`node_red/insert into mysql.js`](https://github.com/cbaie9/projet72_fruitsec/blob/main/node_red/insert%20into%20mysql.js): Function to format and insert sensor data into the MySQL database.\n  - `node_red/recup_humid.js`, `node_red/recup_temp.js`: Functions to extract humidity and temperature from the database query results.\n  - `node_red/txt_process.js`: Function to process sensor values and determine the system status.\n\n- **MySQL**: Database for storing sensor data.\n  - `sql/P72H_model.mwb`, `sql/P72h_updated.mwb`: MySQL Workbench models of the database schema.\n  - `sql/database_export_prod.sql`, `sql/updated_database_prod.sql`: SQL scripts for creating the database and tables.\n  - `sql/inject_value_into_bdd.sql`: SQL script to insert sample data.\n  - `sql/read_all.sql`: SQL script to read all data from the `capteurs_info` table.\n\n- **Webcam**: Provides visual monitoring of the fruit drying process. Images are captured and displayed on the Node-RED dashboard.\n\n- **Discord**: Used for sending status alerts via webhooks.\n\n- **OpenWeatherMap API**: Retrieves external weather data for additional context.\n\n- **Linux scripts**: Used to set up the server.\n  - `linux/installl.sh`: Installation script.\n  - `linux/vsftpd.conf`: vsftpd configuration file.\n\n## Setup\n\n### Hardware Setup\n\n- Connect the DHT22 sensor to the Arduino.\n- Connect the webcam to the system.\n- (If applicable) Connect servo and NeoPixels to the Arduino.\n\n### Software Installation\n\n1. Install the required software on the Linux system using `linux/installl.sh`.\n2. Configure the MySQL database using the SQL scripts in the `sql/` directory.\n3. Import the Node-RED flows from `node_red/flows.json`.\n4. Configure the serial port in Node-RED to match your Arduino's port (check the serial-port config node).\n5. Add your OpenWeatherMap API key in the Node-RED flow where the \"weather v2\" HTTP request node is.\n6. Add your Discord webhook URL to the \"Discord webhook\" node.\n\n### Arduino Code\n\nUpload the appropriate Arduino code (`arduino/code_read_V1.ino` or `arduino/code_read_V1_1/code_read_V1_1.ino`) to the Arduino board.\n\n## Data Flow\n\n1. The Arduino reads temperature and humidity data from the DHT22 sensor.\n2. The Arduino sends the data to Node-RED via the serial port.\n3. Node-RED parses the data and inserts it into the MySQL database.\n4. Node-RED retrieves weather data from the OpenWeatherMap API.\n5. Node-RED captures images from the webcam.\n6. Node-RED processes the sensor data and sends status alerts to Discord via webhooks.\n7. All data is displayed on a Node-RED dashboard.\n\n## Configuration\n\n- **MySQL Database**: Update the database connection details in Node-RED (in the MySQL database config node) to match your MySQL setup.\n- **Serial Port**: Configure the serial port in Node-RED to match your Arduino's port.\n- **OpenWeatherMap API Key**: Add your API key in the Node-RED flow.\n- **Discord Webhook URL**: Add your Discord webhook URL in the Node-RED flow.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbaie9%2Fprojet72_fruitsec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbaie9%2Fprojet72_fruitsec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbaie9%2Fprojet72_fruitsec/lists"}