Compare commits

..

2 Commits

Author SHA1 Message Date
foley f8dac3c07f Testing code formatting 2026-07-02 09:33:56 +00:00
foley c6f1642209 Ignore generated html files 2026-07-02 09:33:44 +00:00
2 changed files with 11 additions and 5 deletions
+1
View File
@@ -225,3 +225,4 @@ cython_debug/
# PyPI configuration file # PyPI configuration file
.pypirc .pypirc
*.html
+10 -5
View File
@@ -1,11 +1,16 @@
# Gadget Mode to setup a serial connection over USB # Gadget Mode to setup a serial connection over USB
Prepare Raspberry Pi OS connection over a microUSB serial cable Prepare Raspberry Pi OS connection over a microUSB serial cable
Important: You will want to disable the serial console on RX/TX if you are trying to use that serial port for communicating with other devices.
Based upon Adafruit guide: https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/serial-gadget: Based upon Adafruit guide: https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/serial-gadget:
The author discovered the guide was out of date, consulted the [2025 Raspberry Pi whitepaper on OTG](https://pip-assets.raspberrypi.com/categories/685-app-notes-guides-whitepapers/documents/RP-009276-WP/Using-OTG-mode-on-Raspberry-Pi-SBCs), found additional errors, and was finally able to correct them thanks to this blog https://www.isticktoit.net/?p=1383 The author discovered the guide was out of date, consulted the [2025 Raspberry Pi whitepaper on OTG](https://pip-assets.raspberrypi.com/categories/685-app-notes-guides-whitepapers/documents/RP-009276-WP/Using-OTG-mode-on-Raspberry-Pi-SBCs), found additional errors, and was finally able to correct them thanks to this blog https://www.isticktoit.net/?p=1383
## Important :
- **Using the Gadget Mode will make the usb port unable to connect to a mouse or keyboard!!!** You will need to disable it make them work again.
- You will want to disable the serial console on RX/TX in `raspi-config` if you are trying to use that serial port for communicating with other devices.
## Procedure
Make sure you have your USB cable plugged into the left port **USB** and not the right port marked **PWR**. Make sure you have your USB cable plugged into the left port **USB** and not the right port marked **PWR**.
1. Open a connection to the device via ssh or Raspberry Pi Connect 1. Open a connection to the device via ssh or Raspberry Pi Connect
1. Become root (the superuser) 1. Become root (the superuser)
@@ -13,9 +18,9 @@ Make sure you have your USB cable plugged into the left port **USB** and not the
sudo su sudo su
``` ```
1. Enable the DWC version 2 USB peripheral device tree overlay by appending it to the end after the `[all]` category (which is at the end) 1. Enable the DWC version 2 USB peripheral device tree overlay by appending it to the end after the `[all]` category (which is at the end)
``` ```
echo "dtoverlay=dwc2" >> /boot/firmware/config.txt echo "dtoverlay=dwc2" >> /boot/firmware/config.txt
``` ```
1. We add the required module `dwc2` for loading at startup 1. We add the required module `dwc2` for loading at startup
``` ```
echo "dwc2" >> /etc/modules echo "dwc2" >> /etc/modules