Skip to content

SSH over USB stops working after Pi reboot #4890

Open
@alevchuk

Description

@alevchuk

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

  1. Install fresh OS on the Pi and a laptop/desktop.
  2. Follow SSH over UBS instructions https://artivis.github.io/post/2020/pi-zero/
  3. Run sudo reboot on the Pi
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions