{"id":24544194,"url":"https://github.com/loguecow/rpi-usb-headless","last_synced_at":"2025-03-16T08:10:08.593Z","repository":{"id":228880872,"uuid":"775149341","full_name":"loguecow/rpi-usb-headless","owner":"loguecow","description":"setup usb headless","archived":false,"fork":false,"pushed_at":"2025-02-11T13:56:14.000Z","size":1,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T14:42:27.824Z","etag":null,"topics":["headless","raspberry-pi","raspberry-pi-4","raspberry-pi-zero","raspberry-pi-zero-2","raspberry-pi-zero-2-w","raspberry-pi-zero-w"],"latest_commit_sha":null,"homepage":"","language":null,"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/loguecow.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}},"created_at":"2024-03-20T21:10:12.000Z","updated_at":"2025-02-11T13:56:19.000Z","dependencies_parsed_at":"2024-03-20T23:43:20.060Z","dependency_job_id":null,"html_url":"https://github.com/loguecow/rpi-usb-headless","commit_stats":null,"previous_names":["loguecow/rpi-usb-headless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loguecow%2Frpi-usb-headless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loguecow%2Frpi-usb-headless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loguecow%2Frpi-usb-headless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loguecow%2Frpi-usb-headless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loguecow","download_url":"https://codeload.github.com/loguecow/rpi-usb-headless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841223,"owners_count":20356446,"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":["headless","raspberry-pi","raspberry-pi-4","raspberry-pi-zero","raspberry-pi-zero-2","raspberry-pi-zero-2-w","raspberry-pi-zero-w"],"created_at":"2025-01-22T20:16:37.010Z","updated_at":"2025-03-16T08:10:08.587Z","avatar_url":"https://github.com/loguecow.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi USB Headless Setup\n\nThis guide explains how to set up a Raspberry Pi for headless operation over USB, enabling SSH access without the need for an external monitor, keyboard, or network connection.\n\n## Prerequisites\n- A Raspberry Pi (Zero, Zero W, or other models supporting USB gadget mode)\n- A microSD card with Raspberry Pi OS installed\n- A computer with an available USB port\n\n## Steps to Configure Headless USB Access\n\n### 1. Modify `cmdline.txt`\nEdit the boot configuration file on the SD card:\n```sh\nsudo nano /boot/cmdline.txt\n```\nAdd the following before `rootwait`:\n```\nmodules-load=dwc2,g_ether\n```\nSave and exit.\n\n### 2. Modify `config.txt`\nEdit the Raspberry Pi configuration file:\n```sh\nsudo nano /boot/config.txt\n```\nAdd the following line at the end:\n```\ndtoverlay=dwc2,dr_mode=peripheral\n```\nSave and exit.\n\n### 3. Configure Network Interface\nEdit the network interfaces file:\n```sh\nsudo nano /etc/network/interfaces\n```\nAdd the following:\n```\nallow-hotplug usb0\niface usb0 inet static\n    address 192.168.7.2\n    netmask 255.255.255.0\n    network 192.168.7.0\n    broadcast 192.168.7.255\n    gateway 192.168.7.1\n```\nSave and exit.\n\n### 4. Enable SSH\nTo enable SSH, create an empty file named `ssh` in the `/boot` directory:\n```sh\ntouch /boot/ssh\n```\n\n### 5. Connect and Access via SSH\n- Connect the Raspberry Pi to your computer using a USB cable.\n- Wait for the Pi to boot up.\n- SSH into the Raspberry Pi using:\n```sh\nssh pi@192.168.7.2\n```\n(Default password: `raspberry`)\n\n## Troubleshooting\n- Ensure your computer recognizes the Raspberry Pi as a network device.\n- Try restarting both the Raspberry Pi and your computer.\n- Use `ifconfig` or `ip a` to check the USB interface status.\n\n## References\n- Raspberry Pi USB Gadget Mode Documentation\n- Official Raspberry Pi OS Setup Guide\n\nEnjoy your headless Raspberry Pi setup!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floguecow%2Frpi-usb-headless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floguecow%2Frpi-usb-headless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floguecow%2Frpi-usb-headless/lists"}