Repository navigation
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
Activity
pelwell commentedon Feb 14, 2022
Does unplugging the USB cable and reconnecting it make the interface work again?
Perhaps the problem is with the host computer not handling the reboot of the Zero.
alevchuk commentedon Feb 15, 2022
Yes, same issue when unplugging and reconnecting the USB cable.
alevchuk commentedon Feb 16, 2022
It works on Debian 11.
(Both work: reboot and yanking out the USB cord)
pelwell commentedon Feb 16, 2022
On the host PC or the Zero?
pelwell commentedon Feb 16, 2022
Probably a duplicate of #4872. Try updating the kernel to 5.15. 24 with
sudo rpi-update.macmpi commentedon Feb 17, 2022
unfortunately available firmware from yesterday is only @.23 for now
raspberrypi/rpi-firmware@9e99d81
alevchuk commentedon Feb 17, 2022
@pelwell it works for Debian on host PC. Yet, a problem with Ubuntu on the host PC. On the Pi Zero I always have Rasbian 11 (bullseye)
pelwell commentedon Feb 17, 2022
That's true, but a comment in #4872 suggests it might be worth updating anyway.
alevchuk commentedon Feb 17, 2022
I did the Pi Zero kernel update. Same problem.
before:
Linux raspberrypi 5.10.92+ #1514after:
Linux raspberrypi 5.15.23+ #1525macmpi commentedon Feb 18, 2022
Lucky you.
For me 5.15.18 fixed it, then 5.15.21 & 5.15.23 broke it again, but I'm hopeful 5.15.24 may fix it again...
pelwell commentedon Feb 19, 2022
5.15.24 is now in rpi-firmware and available for rpi-update.
alevchuk commentedon Feb 19, 2022
Sorry my last comment was incorrect, updating to 5.15.23 does not work after rebooting Pi and host PC. The usb0 interface does not have an IP address.
I'm going to try re-running
sudo rpi-updatewhich will bring me to 5.15.24alevchuk commentedon Feb 19, 2022
5.15.24 has the same issue. The host PC no longer sees the USB Ethernet connection
macmpi commentedon Feb 19, 2022
some progress with 5.15.24 (xhci USB ok now, no more crash), but still some issue when starting
bpfilter: Hostdmesgbelow.alevchuk commentedon Feb 20, 2022
Summary: upgrading the Pi Zero kernel to 5.15.23 Or 5.15.24 does not fix the issue. It makes it worse. After rebooting the host PC the network interface no longer shows up on the host PC.
macmpi commentedon Feb 23, 2022
Interestingly it works fine with my Host on Mint 19.2, kernel 4.15.0-167
But still issue remains with Host on Ubuntu 20.04.1, kernel 5.13.0-30 (elementary 6.1).
Not same PC hardware either in both case btw...
macmpi commentedon Mar 2, 2022
5.15.26 seems to have yet-a-further fix for the issue:
macmpi commentedon Mar 5, 2022
I confirm 5.15.26 with todays
rpi-updatedoes fix the issue: I hope it will last for a good while now...EzYDark commentedon Mar 15, 2022
I can also confirm 5.15.26 works, but version 5.15.27 and 5.15.28 no longer work...
I tested with the help of this tutorial: https://www.isticktoit.net/?p=1383
and then updated the kernel with
rpi-update.EzYDark commentedon Mar 15, 2022
Never mind. I just had broken cable... I guess...