{"id":22650578,"url":"https://github.com/umaarov/bulbe","last_synced_at":"2025-03-29T07:21:58.945Z","repository":{"id":265221116,"uuid":"895167505","full_name":"umaarov/BulbE","owner":"umaarov","description":"A real-time control system that simulates a virtual relay and bulb system using PHP, WebSockets, and a C-based virtual controller. It supports external accessibility through ngrok and delivers instant status updates. Lightweight, modular, and ideal for learning system integration, automation, or IoT basics.","archived":false,"fork":false,"pushed_at":"2024-11-28T10:38:39.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T00:27:59.427Z","etag":null,"topics":["embedded-software","iot","ngrok","open-source","websocket"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/umaarov.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-11-27T17:21:03.000Z","updated_at":"2024-11-28T10:38:42.000Z","dependencies_parsed_at":"2024-11-28T11:38:51.080Z","dependency_job_id":null,"html_url":"https://github.com/umaarov/BulbE","commit_stats":null,"previous_names":["umaarov/bulbe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umaarov%2FBulbE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umaarov%2FBulbE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umaarov%2FBulbE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umaarov%2FBulbE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umaarov","download_url":"https://codeload.github.com/umaarov/BulbE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246151363,"owners_count":20731581,"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":["embedded-software","iot","ngrok","open-source","websocket"],"created_at":"2024-12-09T08:35:00.428Z","updated_at":"2025-03-29T07:21:58.920Z","avatar_url":"https://github.com/umaarov.png","language":"PHP","readme":"# Virtual Controller\nThis project simulates a virtual relay and bulb system, controllable via HTTP requests in real-time. It integrates WebSockets for instant status updates, a PHP server for command processing, and a C-based virtual controller for simulation. \n\n---\n\n## Features\n- **Real-time control and status updates** using WebSockets\n- **PHP server** processes commands (`ON`/`OFF`) via HTTP.\n- Exposes the server to the internet using **ngrok**.\n- Automates setup with shell scripts.\n\n---\n\n## Setup Instructions\n\n### 1. Install Requirements\n- PHP\n- [GCC](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download)\n- [ngrok](https://ngrok.com/download)\n- Composer (for dependency management)\n\n### 2. Prepare Files\n- Place all files in a single directory.\n\n### 3. Install composer\n```bash\ncomposer install\n```\n\n### 4. Compile the C Program\n```bash\ngcc virtual_controller.c -o virtual_controller\n```\n\n---\n\n## How to Run\n\n### 1. Start WebSocket Server\n```bash\nphp server.php\n```\n- Starts the WebSocket server for real-time updates.\n\n### 2. Start the Server and ngrok\n```bash\n./run_server.sh\n```\n- The PHP server and ngrok will start.\n\n### 3. Expose the Server using ngrok\n```bash\nngrok http 8080\n```\n- Use the provided public URL for external access.\n  \n### 4. Run the Virtual Controller\n```bash\n./run_system.sh\n```\n- Starts the virtual controller in sync with the server.\n\n### 5. Test the System\n- Use the ngrok public URL to send commands:\n```bash\nhttps://\u003cyour-ngrok-url\u003e/controller.php?cmd=ON\nhttps://\u003cyour-ngrok-url\u003e/controller.php?cmd=OFF\n```\n- Check the output in the terminal for relay and bulb states.\n\n---\n\n## Conclusion\nThis project simulates a virtual relay and bulb system that you control via HTTP requests. It integrates a PHP server, a C-based virtual controller, and uses ngrok for external accessibility. It's lightweight, cost-free, and sets the foundation for more advanced projects like integration or hardware control. 🚀\nWith everything automated through scripts, you can focus on experimenting and building new features. This project is perfect for learning system integration and handling real-time commands.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumaarov%2Fbulbe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumaarov%2Fbulbe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumaarov%2Fbulbe/lists"}