2

I followed the guide to enable SSH over USB: https://artivis.github.io/post/2020/pi-zero/

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
  • /etc/dhcpcd.conf has
interface usb0
static ip_address=10.42.0.42
static routers=10.42.0.1

First, I reboot my Ubuntu host, plug in the Pi. Everything works great:

  • I can ssh in like this ssh pi@10.42.0.42
  • Ubuntu host has:
$ ifconfig usb0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::51a6:b324:a028:10d2  prefixlen 64  scopeid 0x20<link>
        ether ee:9b:bb:8a:fa:dd  txqueuelen 1000  (Ethernet)
        RX packets 320  bytes 45573 (45.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 407  bytes 38339 (38.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.42.0.0       0.0.0.0         255.255.255.0   U     101    0        0 usb0

$ sudo arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.42.0.42               ether   d6:bc:a0:7d:1e:e1   C                     usb0

The Pi has:

$ ifconfig usb0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.42  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::acff:803:1fa3:f65  prefixlen 64  scopeid 0x20<link>
        ether d6:bc:a0:7d:1e:e1  txqueuelen 1000  (Ethernet)
        RX packets 395  bytes 31955 (31.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 310  bytes 48465 (47.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.42.0.1       0.0.0.0         UG    202    0        0 usb0
10.42.0.0       0.0.0.0         255.255.255.0   U     202    0        0 usb0

$ sudo arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.42.0.1                ether   ee:9b:bb:8a:fa:dd   C                     usb0

Yet after I do sudo reboot on the Pi, and wait for 5 minutes, from the Ubuntu host I cannot SSH into the Pi.

The USB Ethernet connection IPv4 is stuck on "Connecting...". Then I set it to "Shared to other computers" and turn-off / turn-on the network connection. It’s says “Connected”.

And on the Ubuntu host I get:

$ ifconfig
enx82546848e487: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::b6b3:cbe4:b286:815a  prefixlen 64  scopeid 0x20<link>
        ether 82:54:68:48:e4:87  txqueuelen 1000  (Ethernet)
        RX packets 78  bytes 4168 (4.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3  bytes 788 (788.0 B)
        TX errors 120  dropped 0 overruns 0  carrier 0  collisions 0

When I ssh over wifi, I can see that Pi's arp table cannot resolve to the host's Mac address.

$ sudo arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.42.0.1                        (incomplete)                              usb0

How can I make SSH over USB work even after Pi is rebooted?

enter image description here enter image description here Overview of all my networks


It works on Debian 11.

(Both work: reboot and yanking out the USB cord)

Don’t know what causes it to break on Ubuntu

3
  • No, /boot/ is on the Pi. Ubuntu is the host computer (where the Pi is being plugged in as a USB gadget) Feb 14, 2022 at 3:38
  • I need developers to look at this, filed a request github.com/raspberrypi/linux/issues/4890 Feb 14, 2022 at 21:32
  • 1
    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 Feb 20, 2022 at 19:22

1 Answer 1

0

Which Pi is?

I had some problems with Pi Zero and a USB modem, because it didn't turn off the USB power. It happen something similar to me and the only way to solve it was unplug and plug again. You can try that, after reboot when is hang, unplug and plug. My only way of make the modem work again was unplug and plug the modem when the pi zero was turned off.

  • Turn off only the Pi zero didn't work.
  • Turn off only the modemd didn't work.
  • Turn off both, the pi zero and the modem also didn't work.

The only way was unplug and plug the modem when the pi zero was turned off.

1
  • It's a Pi Zero. I'm plugging into the USB port in a desktop or a laptop, maybe related but I don't know of a way to reset the USB port. Feb 26, 2022 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.