Compare commits

..
4 Commits
Author SHA1 Message Date
foley 7fa93735bd wlan power save 2026-09-24 22:35:24 +00:00
foley a4d28d02f7 more about gadget mode 2026-09-24 22:00:20 +00:00
foley b0d632f0c5 rpi-usb-gadget works better but needs an offline-switch 2026-09-06 20:07:41 +00:00
foley 39c0f158fe switch to logger (more POSIX) 2026-07-02 11:04:19 +00:00
2 changed files with 17 additions and 4 deletions
+7 -1
View File
@@ -12,7 +12,8 @@ Scripts and documentation for setting up a Raspberry Pi (Zero W 1 or 2) for use
sudo apt-get -y upgrade
```
1. [Gadget Mode to setup a network connection over USB](https://github.com/raspberrypi/rpi-usb-gadget)
1. [Gadget Mode to setup a network connection over USB](https://github.com/raspberrypi/rpi-usb-gadget). A more explanatory version in the [Raspberry Pi Newsletter](https://www.raspberrypi.com/news/usb-gadget-mode-in-raspberry-pi-os-ssh-over-usb/)
* If you don't have Internet Connection Sharing, th pi will show up as 10.12.194.1
1. [Setup the OLED screen to print the IP](oled-display/README.md)
Based upon [Marcel's script on github to show the IP address on the OLED screen](https://github.com/mkyas/cpsy-display-ip)
1. Install Blinka by following the guide [CircuitPython Libraries on Linux and Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi)]
@@ -48,3 +49,8 @@ Credit: Daníel Bjartur Guðmundsson, transcribed by Joseph T. Foley
1. Show details of "preconfigured" network: nmcli connection show preconfigured
1. Change the SSID (which wireless network you will connect to) in the "New_SSID": nmcli connection modify preconfigured wifi.ssid "New_SSID"
1. Change the wireless access password in the "New_Password": nmcli connection modify preconfigured wifi-sec.psk "New_Password"
## Wifi keeps dropping out. What do I do?
1. `sudo raspi-config`
1. Advanced Options > A12 WLAN Power Save
1. Yes to disabling
+10 -3
View File
@@ -18,20 +18,27 @@ else
fi
# Is the dwc2 overlay installed? Nothing will work if it isn't.
<<<<<<< HEAD
if lsmod | grep -q "dwc2"; then
echo "DWC2 module loaded, setting up OTG gadget serial and ethernet" | logger -t $0 -p info
echo "DWC2 module loaded"
=======
if [ -d /sys/class/udc ] && [ -n "$(ls -A /sys/class/udc)" ]; then
systemd-cat -t gadget.sh -p info echo "DWC2 precompiled, setting up OTG gadget serial and ethernet"
elif lsmod | grep -q "dwc2"; then
systemd-cat -t gadget.sh -p info echo "Pre 6.18.39 kernel. DWC2 module loaded, setting up OTG gadget serial and ethernet"
>>>>>>> master
else
systemd-cat -t gadget.sh -p warning echo "DWC2 module missing. Aborting OTG setup."
echo "DWC2 module missing. Aborting OTG setup." | logger -t $0 -p info
echo "DWC2 module missing"
systemctl disable serial-getty@ttyGS0.service
exit 1
fi
sudo modprobe libcomposite
modprobe libcomposite
cd /sys/kernel/config/usb_gadget
if [ -d "MyGadget" ]; then
systemd-cat -t gadget.sh -p warning echo "MyGadget already exists. Aborting OTG setup."
echo "MyGadget already exists. Aborting OTG setup." | logger -t $0 -p info
exit 1
fi