{"id":21492123,"url":"https://github.com/colddsam/device-fault-detection","last_synced_at":"2026-04-02T02:43:44.469Z","repository":{"id":242019340,"uuid":"808466760","full_name":"colddsam/Device-Fault-detection","owner":"colddsam","description":"One Wire device connection and alert system using SMTP server","archived":false,"fork":false,"pushed_at":"2024-06-10T15:58:09.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-10T18:35:49.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colddsam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-05-31T06:11:23.000Z","updated_at":"2024-06-10T15:58:12.000Z","dependencies_parsed_at":"2024-06-10T18:05:45.532Z","dependency_job_id":null,"html_url":"https://github.com/colddsam/Device-Fault-detection","commit_stats":null,"previous_names":["colddsam/device-fault-detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colddsam%2FDevice-Fault-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colddsam%2FDevice-Fault-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colddsam%2FDevice-Fault-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colddsam%2FDevice-Fault-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colddsam","download_url":"https://codeload.github.com/colddsam/Device-Fault-detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226059006,"owners_count":17567181,"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","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":[],"created_at":"2024-11-23T15:22:35.575Z","updated_at":"2026-04-02T02:43:44.433Z","avatar_url":"https://github.com/colddsam.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lamp Post Fault Detection System\n\nThis project outlines a robust system for detecting and reporting faults in lamp posts using a combination of hardware sensors, a FastAPI backend, and email alerts.\n\n## System Architecture\n\nThe system comprises three main components:\n\n1. **Hardware Sensors:** Deployed on each lamp post, these sensors continuously monitor various parameters like voltage, current, and temperature. They also check for physical tampering or damage.\n\n2. **FastAPI Backend:** This serves as the central communication hub. It receives data from the sensors, processes it to identify potential faults, and triggers alerts when necessary.\n\n3. **Email Alert System:** Upon detecting a fault, the backend sends real-time notifications to designated personnel via email, enabling swift response and maintenance.\n\n## Code Breakdown\n\n### File Structure\n\n| Filename              | Description                                                                        |\n|-----------------------|------------------------------------------------------------------------------------|\n| `.gitignore`         | Lists files and directories to be ignored by Git version control.                  |\n| `README.md`          | This file, providing a comprehensive overview of the project.                     |\n| `main.py`            | Core FastAPI application file handling API endpoints and logic.                 |\n| `requirements.txt`    | Lists Python libraries required for running the project.                          |\n| `secret.py`          | Stores sensitive credentials like email login details.                                |\n| `smtpServer.py`       | Contains the class responsible for sending email alerts.                         |\n\n### Backend (`main.py`)\n\nBuilt using the FastAPI framework, the backend exposes two key endpoints:\n\n| Endpoint       | Method | Description                                                            |\n|----------------|--------|--------------------------------------------------------------------|\n| `/`             | `GET`  | Returns a simple message confirming the API is running.            |\n| `/sendalert/` | `POST` | Accepts a lamp post address and triggers an email alert.             |\n\n**Key Functionality:**\n\n- **Dependency Injection:** Leverages FastAPI's dependency injection system for managing the `SMTPserver` instance.\n- **CORS Support:** Enables cross-origin requests for interaction with various front-end applications.\n\n### Email Alerts (`smtpServer.py`)\n\nThis module handles the email alert functionality using the `smtplib` library. \n\n**Key Features:**\n\n- **Secure Connection:** Employs TLS encryption for secure communication with the SMTP server.\n- **Customizable Alerts:**  Allows modification of email content, subject, and recipient addresses for flexibility.\n\n## Advantages\n\n- **Real-time Monitoring:** Constant sensor data analysis enables immediate fault detection.\n- **Proactive Maintenance:** Timely alerts minimize downtime and reduce maintenance costs.\n- **Improved Safety:**  Early identification of potential hazards enhances public safety.\n- **Scalability:** The system can be easily scaled to accommodate a large number of lamp posts.\n\n## Future Enhancements\n\n- **Data Visualization:**  Integrate a dashboard for visualizing sensor data and fault trends.\n- **Machine Learning:** Implement predictive maintenance models by analyzing historical data.\n- **Mobile App Integration:** Develop a mobile application for real-time alerts and system management.\n\nThis project provides a robust and scalable solution for lamp post fault detection, leading to significant cost savings, improved safety, and increased efficiency in urban lighting infrastructure.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolddsam%2Fdevice-fault-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolddsam%2Fdevice-fault-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolddsam%2Fdevice-fault-detection/lists"}