{"id":28401387,"url":"https://github.com/ctrl-z-dev/raspberry-server","last_synced_at":"2025-06-28T13:31:56.903Z","repository":{"id":257916460,"uuid":"614639548","full_name":"ctrl-z-dev/Raspberry-Server","owner":"ctrl-z-dev","description":"This project is a Node.js server using Socket.IO to control servos and LEDs in real-time via a web interface. Clients send commands to move the servos connected to GPIO pins, making it ideal for IoT applications.","archived":false,"fork":false,"pushed_at":"2024-10-15T16:17:57.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T20:31:06.567Z","etag":null,"topics":["javascript","led","node-js","raspberry-pi","server","servo-motor"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ctrl-z-dev.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":"2023-03-16T02:13:30.000Z","updated_at":"2024-10-15T16:42:01.000Z","dependencies_parsed_at":"2024-10-17T01:23:27.616Z","dependency_job_id":null,"html_url":"https://github.com/ctrl-z-dev/Raspberry-Server","commit_stats":null,"previous_names":["jeypi-official/raspberry-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ctrl-z-dev/Raspberry-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-z-dev%2FRaspberry-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-z-dev%2FRaspberry-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-z-dev%2FRaspberry-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-z-dev%2FRaspberry-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctrl-z-dev","download_url":"https://codeload.github.com/ctrl-z-dev/Raspberry-Server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-z-dev%2FRaspberry-Server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262437914,"owners_count":23311056,"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":["javascript","led","node-js","raspberry-pi","server","servo-motor"],"created_at":"2025-06-01T12:32:49.151Z","updated_at":"2025-06-28T13:31:56.898Z","avatar_url":"https://github.com/ctrl-z-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socket.IO Node.js Server with Servo and LED Control\n\n## Overview\n\nThis project is a Node.js server that facilitates real-time communication between connected clients via Socket.IO. The server interacts with two servo motors (or LEDs) connected to a Raspberry Pi or similar hardware, allowing clients to control the servos remotely by sending specific commands.\n\n### Features:\n- Real-time communication using Socket.IO.\n- Servo motor control through custom class methods.\n- Client connection and disconnection logging.\n- Handles multiple clients simultaneously.\n- Simple web interface that serves static files and can receive commands.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Project Structure](#project-structure)\n- [Socket.IO Events](#socketio-events)\n- [Hardware Requirements](#hardware-requirements)\n- [License](#license)\n\n## Installation\n\n### Prerequisites:\n- Node.js (\u003e= v12)\n- NPM (Node Package Manager)\n- Hardware: Raspberry Pi (or similar) with connected servos or LEDs.\n\n### Steps:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/JeyPi-Official/Raspberry-Server.git\n   cd Server\n   ```\n\n2. Install the required packages:\n   ```bash\n   npm install\n   ```\n\n3. Ensure you have the necessary hardware setup, such as the servos connected to GPIO pins.\n\n4. Start the server:\n   ```bash\n   npm start\n   ```\n\n5. Open your browser and navigate to `http://\u003cserver-ip\u003e:8000/`.\n\n## Usage\n\nOnce the server is up and running, clients can connect via a web interface served by the app. Socket.IO handles real-time communication, and commands can be sent from the client to control the connected hardware (servo motors).\n\n### Example commands:\n- `!PlantOne` - Moves both servo motors to position 0.\n- `!PlantTwo` - Moves the first servo motor to position 1.\n- `!PlantThree` - Moves the first servo motor to position 2.\n- `!PlantFour` - Moves both servo motors to different positions.\n\n## Project Structure\n\n```\nServer/\n│\n├── src/\n│   ├── classes/\n│   │   ├── LED.js          # Controls LED (currently unused in this version)\n│   │   └── Servo.js        # Class for controlling Servo motors\n│   └── index.html          # Web interface for client interaction\n│\n├── index.js                  # Main application logic\n├── package.json            # Project metadata and dependencies\n└── README.md               # This readme file\n```\n\n## Socket.IO Events\n\n### Server-Side Events:\n\n- **`connection`**: Triggered when a new client connects. Adds the client to a list of active clients.\n- **`disconnect`**: Handles client disconnection and removes the client from the active list.\n- **`client`**: Receives messages from the connected client and executes servo control commands based on the received input.\n- **`server`**: Sends a welcome message to newly connected clients.\n\n### Client-Side Commands:\n- `!PlantOne`: Moves both servo motors to position 0.\n- `!PlantTwo`: Moves the first servo motor to position 1.\n- `!PlantThree`: Moves the first servo motor to position 2.\n- `!PlantFour`: Moves both servos to preset positions.\n\n## Hardware Requirements\n\n- **Servo Motors**: The server interacts with two servo motors connected to GPIO pins (9 and 10 in this example).\n- **LED**: Although an LED class is present, it is commented out and not used in the current implementation.\n  \n### Servo Connections:\n- Servo 1 on GPIO pin 10.\n- Servo 2 on GPIO pin 9.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrl-z-dev%2Fraspberry-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctrl-z-dev%2Fraspberry-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrl-z-dev%2Fraspberry-server/lists"}