{"id":20245431,"url":"https://github.com/letsmakecakes/protocol-bridge","last_synced_at":"2025-07-18T11:07:34.594Z","repository":{"id":172757070,"uuid":"642371784","full_name":"letsmakecakes/protocol-bridge","owner":"letsmakecakes","description":"Joystick Drone Control Protocol Bridge. Control a drone using a joystick via a client-server connection.","archived":false,"fork":false,"pushed_at":"2023-06-05T14:13:01.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T15:35:32.642Z","etag":null,"topics":["client-server","drone","joystick","mavlink","pygame","pymavlink","python","websocket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letsmakecakes.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":"2023-05-18T12:23:31.000Z","updated_at":"2025-02-27T08:12:28.000Z","dependencies_parsed_at":"2023-12-31T20:15:09.010Z","dependency_job_id":null,"html_url":"https://github.com/letsmakecakes/protocol-bridge","commit_stats":null,"previous_names":["letsmakecakes/protocol-bridge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/letsmakecakes/protocol-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fprotocol-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fprotocol-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fprotocol-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fprotocol-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsmakecakes","download_url":"https://codeload.github.com/letsmakecakes/protocol-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fprotocol-bridge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265746690,"owners_count":23821715,"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":["client-server","drone","joystick","mavlink","pygame","pymavlink","python","websocket"],"created_at":"2024-11-14T09:20:55.742Z","updated_at":"2025-07-18T11:07:34.549Z","avatar_url":"https://github.com/letsmakecakes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protocol Bridge for Joystick Drone Control\n\nThis repository contains a protocol bridge for controlling a drone using a joystick. The bridge allows communication between a client, which reads input from a joystick and sends control commands to the drone, and a server, which receives the commands and sends them to the flight controller.\n\n## Requirements\n\nTo use this protocol bridge, you need the following:\n\n- Python 3.x\n- [Pygame](https://www.pygame.org) library\n- [websockets](https://pypi.org/project/websockets/) library\n- [pymavlink](https://pypi.org/project/pymavlink/) library\n\n## Installation\n\n1. Clone this repository:\n\n   ```bash\n   git clone https://github.com/letsmakecakes/protocol-bridge.git\n   ```\n\n2. Install the required libraries. Run the following command:\n\n   ```bash\n   pip install pygame websockets pymavlink\n   ```\n\n## Usage\n\n### Client\n\n1. Open the `client.py` file in a text editor.\n\n2. Modify the following line to match the address and port of the server:\n\n   ```python\n   async with websockets.connect('ws://localhost:8765', ping_interval=None) as websocket:\n   ```\n\n3. Connect your joystick to the computer.\n\n4. Run the client script using the following command:\n\n   ```bash\n   python client.py\n   ```\n\n### Server\n\n1. Open the `server.py` file in a text editor.\n\n2. Modify the following line to match the connection string of your flight controller:\n\n   ```python\n   master = mavutil.mavlink_connection('\u003cyour-system-ip-address\u003e:14550')\n   ```\n\n3. Run the server script using the following command:\n\n   ```bash\n   python server.py\n   ```\n\n## Communication Protocol\n\nThe client reads input from the joystick and sends control commands to the server using a WebSocket connection. The server receives the commands and sends them to the flight controller using the MAVLink protocol.\n\nThe control commands include the following parameters:\n\n- `arm`: Arm the flight controller (value: `1` to arm, `0` to disarm).\n- `disarm`: Disarm the flight controller (value: `1` to disarm, `0` to keep armed).\n- `mode`: Set the flight mode of the drone (value: `1` to set mode, `0` to keep the current mode).\n- `yaw`: Yaw control value (-1.0 to 1.0).\n- `throttle`: Throttle control value (-1.0 to 1.0).\n- `roll`: Roll control value (-1.0 to 1.0).\n- `pitch`: Pitch control value (-1.0 to 1.0).\n\nThe server receives the control commands and processes them accordingly:\n\n- If `arm` is set to `1`, the server arms the flight controller.\n- If `disarm` is set to `1`, the server disarms the flight controller.\n- If `mode` is set to `1`, the server sets the flight mode of the drone to the specified mode.\n\nThe server then sends the control commands to the flight controller using the MAVLink protocol. The control values for yaw, throttle, roll, and pitch are scaled and sent as manual control commands.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nFeel free to contribute to this project by submitting issues or pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsmakecakes%2Fprotocol-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsmakecakes%2Fprotocol-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsmakecakes%2Fprotocol-bridge/lists"}