diff --git a/gadget.md b/gadget.md index d9a893a..3c75f9d 100644 --- a/gadget.md +++ b/gadget.md @@ -14,41 +14,43 @@ The author discovered the guide was out of date, consulted the [2025 Raspberry P 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. Become root (the superuser) - ``` - 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) ``` echo "dtoverlay=dwc2" >> /boot/firmware/config.txt ``` 1. We add the required module `dwc2` for loading at startup - ``` - echo "dwc2" >> /etc/modules - ``` +``` +echo "dwc2" >> /etc/modules +``` 1. Check that we can load the libcomposite module - ``` - modprobe libcomposite - ``` +``` +modprobe libcomposite +``` 1. Put a copy of this repository in root's home directory using git - ``` - apt install -y git - git clone https://gitea.cs.ru.is/RU-V207/rover-pi.git - ``` +``` +apt install -y git +git clone https://gitea.cs.ru.is/RU-V207/rover-pi.git +``` 1. Go to Scripts and test if the `gadget.sh` runs without errors and hopefully a Serial port appers in Device Manager or equivalent - ``` - cd rover-pi/Scripts/ - ./gadget.sh - ``` -1. Install the systemd script - `cp serial-ether-gadget.service /lib/systemd/system/.` + ``` +cd rover-pi/Scripts/ +./gadget.sh +``` +1. Install the systemd +``` +cp serial-ether-gadget.service /lib/systemd/system/. +``` 1. Enable the service - ``` - systemctl enable serial-ether-gadget.service - ``` +``` +systemctl enable serial-ether-gadget.service +``` 1. Enable the getty (which connects a login terminal to the serial port) - ``` - systemctl enable serial-getty@ttyGS0.service - ``` +``` +systemctl enable serial-getty@ttyGS0.service +``` 1. Reboot and see if the serial port appears # Connecting to the serial terminal