{"id":25020875,"url":"https://github.com/abhigyan126/state","last_synced_at":"2026-01-24T17:33:33.816Z","repository":{"id":244432241,"uuid":"787357026","full_name":"Abhigyan126/state","owner":"Abhigyan126","description":" This project demonstrates a fault detection mechanism on a state machine using a server-client architecture .","archived":false,"fork":false,"pushed_at":"2024-10-13T10:39:44.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T14:46:15.644Z","etag":null,"topics":["emulation","fault-detection","health-monitoring","sensor","server-client","socket","state-machine"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Abhigyan126.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}},"created_at":"2024-04-16T11:22:19.000Z","updated_at":"2024-10-13T10:45:08.000Z","dependencies_parsed_at":"2024-06-14T17:58:58.688Z","dependency_job_id":"38676fe0-7220-4c6e-8863-adbe947b8508","html_url":"https://github.com/Abhigyan126/state","commit_stats":null,"previous_names":["abhigyan126/state"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abhigyan126/state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhigyan126%2Fstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhigyan126%2Fstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhigyan126%2Fstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhigyan126%2Fstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abhigyan126","download_url":"https://codeload.github.com/Abhigyan126/state/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhigyan126%2Fstate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28732633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["emulation","fault-detection","health-monitoring","sensor","server-client","socket","state-machine"],"created_at":"2025-02-05T12:18:03.229Z","updated_at":"2026-01-24T17:33:33.793Z","avatar_url":"https://github.com/Abhigyan126.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fault Detection System on State Machines\n\nThis project demonstrates a fault detection mechanism on a state machine using a server-client architecture, where sensor states are monitored and evaluated. The system reads sensor configurations from an XML file and processes real-time sensor inputs, sending out corresponding outputs and warnings when certain conditions are met.\n\n## Features\n- **Sensor Input Handling**: Processes input data from sensors and evaluates their states (e.g., `active`, `inactive`, `true`).\n- **State Machine Management**: Triggers appropriate outputs based on the sensor state and predefined transitions.\n- **Output Listener**: Listens for outputs triggered by the sensors and logs or handles the events.\n- **Fault Detection**: Detects input failures and generates warnings if sensor health degrades or becomes inactive.\n- **Multithreading**: Utilizes multithreading to handle sensor input processing, output monitoring, and fault degradation simultaneously.\n\n## Architecture\n\nThe project consists of two main components:\n\n1. **Sensor Server**: Listens for sensor state updates from clients, processes the inputs, and triggers the corresponding outputs.\n2. **Client Simulation**: Simulates sensor state generation and sends them to the server. This includes logic for degrading sensor output over time.\n\n### Main Classes\n\n- **SensorServer**:\n    - Handles incoming sensor states from clients.\n    - Parses the sensor configuration from an XML file to determine state transitions.\n    - Sends output data or warnings when specific conditions are triggered.\n    \n- **Client Simulation**:\n    - Generates random sensor states and sends them to the server.\n    - Simulates output degradation and sends warnings if output health drops below 40%.\n    \n- **Listener and Output Handling**:\n    - A listener that accepts output data from the server, handling various actions such as triggering alarms, sprinklers, etc.\n    - Degradation of outputs over time to simulate faults or wear and tear of components.\n\n## File Structure\n\n/project-root  \n├── data.xml              # XML file containing sensor configurations and triggers  \n├── server.py             # Contains the SensorServer class, which processes sensor inputs  \n├── client.py             # Simulates the client that generates and sends sensor states to the server  \n├── README.md             # Project documentation\n\n\n### Example `data.xml` Structure\n\n```xml\n\u003csensors\u003e\n    \u003csensor\u003e\n        \u003cname\u003esensor_1\u003c/name\u003e\n        \u003ctriggers\u003e\n            \u003ctrigger\u003eoutput1\u003c/trigger\u003e\n            \u003ctrigger\u003eoutput2\u003c/trigger\u003e\n        \u003c/triggers\u003e\n    \u003c/sensor\u003e\n    \u003csensor\u003e\n        \u003cname\u003esensor_2\u003c/name\u003e\n        \u003ctriggers\u003e\n            \u003ctrigger\u003ealarm\u003c/trigger\u003e\n        \u003c/triggers\u003e\n    \u003c/sensor\u003e\n\u003c/sensors\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhigyan126%2Fstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhigyan126%2Fstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhigyan126%2Fstate/lists"}