SSH over USB stops working after Pi reboot
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- linux
- Domain
- embedded-iot, networking, operating-systems
Research direction
Start by comparing the working and failing dmesg output, then review the USB gadget settings in /boot/config.txt, /boot/cmdline.txt, and /etc/dhcpcd.conf. Reproduce the reboot sequence from the linked guide and inspect the host's USB Ethernet and ARP state. Done means identifying and correcting the post-reboot condition that leaves the connection stuck on “Connecting...”.
Written by the indexing model from the issue text.
Description
Describe the bug
I followed the guide to enable SSH over USB: https://artivis.github.io/post/2020/pi-zero/
SSHing into the Pi worked but after rebooting the Pi from the host I cannot SSH into the Pi.
The USB Ethernet connection IPv4 is stuck on "Connecting...".
Looks like the problem is that the Pi can no longer Arp the hardware address of the host.
Steps to reproduce the behaviour
- Install fresh OS on the Pi and a laptop/desktop.
- Follow SSH over UBS instructions https://artivis.github.io/post/2020/pi-zero/
- Run
sudo rebooton the Pi - Try SSH'ing again
On Host Computer:
- Ubuntu 20.04.3 LTS, fresh install
- Ubuntu host has the USB Ethernet connection IPv4 set to "Shared to other computers"
On the Pi:
- Rasbian 11 (bullseye), fresh install
- /boot/config.txt has dtoverlay=dwc2
- /boot/cmdline.txt ends with rootwait modules-load=dwc2,g_ether g_ether.host_addr=82:54:68:48:e4:87
- In /etc/dhcpcd.conf put
interface usb0
static ip_address=10.42.0.42
static routers=10.42.0.1
Device (s)
Raspberry Pi Zero
System
pi@raspberrypi:~ $ cat /etc/rpi-issue
Raspberry Pi reference 2022-01-28
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f01430c9d8f67a4b9719cc00e74a2079d3834d5d, stage2
pi@raspberrypi:~ $ vcgencmd version
Jan 20 2022 13:58:22
Copyright (c) 2012 Broadcom
version bd88f66f8952d34e4e0613a85c7a6d3da49e13e2 (clean) (release) (start)
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.92+ #1514 Mon Jan 17 17:35:21 GMT 2022 armv6l GNU/Linux
Logs
On the Pi (when things work):
dmesg | grep dwc2
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=Composite-1:720x480@60i smsc95xx.macaddr=B8:27:EB:5A:0E:9B vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 dwc_otg.speed=1 console=ttyS0,115200 console=tty1 root=PARTUUID=80be026c-02 rootfstype=ext4 fsck.repair=yes rootwait modules-load=dwc2,g_ether
[ 2.989856] modules-load=dwc2,g_ether
[ 9.655965] dwc2 20980000.usb: supply vusb_d not found, using dummy regulator
[ 9.660432] dwc2 20980000.usb: supply vusb_a not found, using dummy regulator
[ 9.932844] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 9.953381] dwc2 20980000.usb: DWC OTG Controller
[ 9.957344] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 9.961262] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 10.033313] usb usb1: Manufacturer: Linux 5.10.92+ dwc2_hsotg
[ 10.446481] dwc2 20980000.usb: bound driver g_ether
[ 10.574255] dwc2 20980000.usb: new device is high-speed
[ 10.846476] dwc2 20980000.usb: new device is high-speed
[ 10.978497] dwc2 20980000.usb: new device is high-speed
[ 11.051539] dwc2 20980000.usb: new address 9
On the Pi when SSH stops working:
dmesg | grep dwc2
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=Composite-1:720x480@60i smsc95xx.macaddr=B8:27:EB:5A:0E:9B vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 dwc_otg.speed=1 console=ttyS0,115200 console=tty1 root=PARTUUID=80be026c-02 rootfstype=ext4 fsck.repair=yes rootwait modules-load=dwc2,g_ether
[ 2.990618] modules-load=dwc2,g_ether
[ 9.702605] dwc2 20980000.usb: supply vusb_d not found, using dummy regulator
[ 9.707165] dwc2 20980000.usb: supply vusb_a not found, using dummy regulator
[ 9.952832] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 9.966937] dwc2 20980000.usb: DWC OTG Controller
[ 10.006210] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 10.032801] dwc2 20980000.usb: irq 33, io mem 0x20980000
[ 10.063128] usb usb1: Manufacturer: Linux 5.10.92+ dwc2_hsotg
[ 10.456476] dwc2 20980000.usb: bound driver g_ether
[ 10.580662] dwc2 20980000.usb: new device is high-speed
[ 10.848792] dwc2 20980000.usb: new device is high-speed
[ 10.976975] dwc2 20980000.usb: new device is high-speed
[ 11.053953] dwc2 20980000.usb: new address 11
The Ubuntu host where the Pi is plugged in as a USB gadget shows:
[ 1799.836438] usb 1-4: new full-speed USB device number 8 using xhci_hcd
[ 1800.520438] usb 1-4: new high-speed USB device number 9 using xhci_hcd
[ 1800.669903] usb 1-4: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 5.10
[ 1800.669908] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1800.669911] usb 1-4: Product: RNDIS/Ethernet Gadget
[ 1800.669914] usb 1-4: Manufacturer: Linux 5.10.92+ with 20980000.usb
[ 1800.701969] cdc_ether 1-4:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-4, CDC Ethernet Device, 92:0e:10:16:3d:3e
[ 1800.702072] usbcore: registered new interface driver cdc_ether
[ 1800.702116] usbcore: registered new interface driver cdc_subset
[ 1800.723964] cdc_ether 1-4:1.0 enx920e10163d3e: renamed from usb0
After changing the Ubuntu Settings GUI for the network connection to "IPv4 Shared to Other computers" and turning the connection On and Off:
[ 1893.038229] bpfilter: Loaded bpfilter_umh pid 5030
[ 1893.038664] Started bpfilter
Additional context
I put all the details here: https://raspberrypi.stackexchange.com/questions/136166/ssh-over-usb-stops-working-after-pi-reboot
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·