6

I'm trying to ssh to a Pi Zero via USB link. While this works as expected from my MacBook with OSX 10.10, I'm not able to ssh or ping the raspberry From a Linux Host over USB.

What I did:

On the MicroSD-card: Add "dtoverlay=dwc2" to config.txt

Add "modules-load=dwc2,g_ether" to cmdline.txt

insert a blank file called "ssh" in the same directory as config.txt and cmdline.txt

On the Macbook ssh [email protected]

This works. Then I shut down the zero, add again a file called "ssh" in the directory and connect it to my Ubuntu Machine.

On the Ubuntu 17.04 Desktop machine

ssh [email protected]

Error: Could not resolve hostname

ssh pi@raspberrypi

Error: Could not resolve hostname

lsusb

Bus 001 Device 019: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget

/etc/init.d/avahi-daemon status

Okt 09 10:00:03 ub1704-gerry avahi-daemon[6603]: Joining mDNS multicast group on interface enp0s20f0u12.IPv6…:fe13.

Okt 09 10:00:03 ub1704-gerry avahi-daemon[6603]: New relevant interface enp0s20f0u12.IPv6 for mDNS.

Okt 09 10:00:03 ub1704-gerry avahi-daemon[6603]: Registering new address record for fe80::3c1:11d6:f2aa:fe13…u12.*.

ifconfig

enp0s20f0u12: flags=4163 mtu 1500

  inet6 fe80::3c1:11d6:f2aa:fe13  prefixlen 64  scopeid 0x20<link>
    ether 52:bc:0f:ce:06:90  txqueuelen 1000  (Ethernet)
    RX packets 976  bytes 39264 (39.2 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 468  bytes 85039 (85.0 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Why doesn't the Ubuntu machine assign an IPv4 network address to the Raspberry Pi zero?

ping6 fe80:0000:3c1:11d6:f2aa:fe13

ping: fe80:0000:3c1:11d6:f2aa:fe13: Name or service not known

Thanks for any hints

2 Answers 2

10

Answering to myself: I found the answer now (actually I don't really know, why it works, but it works).

  • Open Network Settings. If the Zero is connected and active, you'll find an entry for "USB Ethernet" Ubuntu network settings

  • Click the Settings-Button on the lower right.

  • Go to the "IPv4" Tab and change "addresses" to "Link Local only"
  • Go to the "IPv6" Tab and turn it "Off".

After a few seconds, the network will say "connected", and then you can ssh to the zero with "ssh [email protected]"

Still, the Pi doesn't have internet connection. A network bridge would be necessary for that.

1
  • Please accept this answer, if a better one doesn't appear. You should be able to do this tomorrow afternoon. Not only will it prevent this from reappearing over and over, but it will increase your reputation.
    – NomadMaker
    Jul 11, 2022 at 18:22
0

I got similar but couldn't switch on the usb ethernet adapter. Ubuntu 22.04.3 and a pi zero w 2 with diy v2 pikvm https://files.pikvm.org/images/v2-hdmi-zero2w-latest.img.xz

enter image description here

lsmod

enter image description here

dmesg

> [3035139.461129] usb 3-2: new high-speed USB device number 48 using
> xhci_hcd [3035139.617150] usb 3-2: New USB device found,
> idVendor=0525, idProduct=a4a2, bcdDevice= 6.01 [3035139.617159] usb
> 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [3035139.617161] usb 3-2: Product: RNDIS/Ethernet Gadget
> [3035139.617164] usb 3-2: Manufacturer: Linux 6.1.61-1-rpi-ARCH with
> 3f980000.usb [3035139.657265] cdc_ether 3-2:1.0 usb0: register
> 'cdc_ether' at usb-0000:04:00.4-2, CDC Ethernet Device,
> b2:fc:14:75:d2:fb [3035139.686090] usbcore: registered new interface
> driver cdc_subset [3035139.689936] cdc_ether 3-2:1.0 enxb2fc1475d2fb:
> renamed from usb0 [3035402.978331] pcieport 0000:00:01.1: PCI bridge
> to [bus 01] [3035402.978342] pcieport 0000:00:01.1:   bridge window
> [mem 0xfcf00000-0xfcffffff] [3036304.039581] UDC core: g_ether:
> couldn't find an available UDC [3036617.116497] pcieport 0000:00:01.1:
> PCI bridge to [bus 01] [3036617.116507] pcieport 0000:00:01.1:  
> bridge window [mem 0xfcf00000-0xfcffffff] [3036960.524158] pcieport
> 0000:00:01.1: PCI bridge to [bus 01] [3036960.524175] pcieport
> 0000:00:01.1:   bridge window [mem 0xfcf00000-0xfcffffff]
> [3037040.867800] usb 3-2: USB disconnect, device number 48
> [3037040.867992] cdc_ether 3-2:1.0 enxb2fc1475d2fb: unregister
> 'cdc_ether' usb-0000:04:00.4-2, CDC Ethernet Device [3037045.854159]
> usb 3-2: new full-speed USB device number 49 using xhci_hcd
> [3037045.986445] usb 3-2: device descriptor read/64, error -71
> [3037046.230434] usb 3-2: device descriptor read/64, error -71
> [3037046.466379] usb 3-2: new full-speed USB device number 50 using
> xhci_hcd [3037046.602210] usb 3-2: device descriptor read/64, error
> -71 [3037058.902009] usb 3-2: new high-speed USB device number 51 using xhci_hcd [3037059.058617] usb 3-2: New USB device found,
> idVendor=0525, idProduct=a4a2, bcdDevice= 6.01 [3037059.058632] usb
> 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [3037059.058639] usb 3-2: Product: RNDIS/Ethernet Gadget
> [3037059.058645] usb 3-2: Manufacturer: Linux 6.1.61-1-rpi-ARCH with
> 3f980000.usb [3037059.114968] cdc_ether 3-2:1.0 usb0: register
> 'cdc_ether' at usb-0000:04:00.4-2, CDC Ethernet Device,
> e6:2e:65:1e:38:d4 [3037059.151160] cdc_ether 3-2:1.0 enxe62e651e38d4:
> renamed from usb0 [3037085.991099] usb 3-2: USB disconnect, device
> number 51 [3037085.991299] cdc_ether 3-2:1.0 enxe62e651e38d4:
> unregister 'cdc_ether' usb-0000:04:00.4-2, CDC Ethernet Device
> [3037101.949087] usb 3-2: new high-speed USB device number 52 using
> xhci_hcd [3037102.104762] usb 3-2: New USB device found,
> idVendor=0525, idProduct=a4a2, bcdDevice= 6.01 [3037102.104806] usb
> 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [3037102.104813] usb 3-2: Product: RNDIS/Ethernet Gadget
> [3037102.104820] usb 3-2: Manufacturer: Linux 6.1.61-1-rpi-ARCH with
> 3f980000.usb [3037102.154759] cdc_ether 3-2:1.0 usb0: register
> 'cdc_ether' at usb-0000:04:00.4-2, CDC Ethernet Device,
> 2e:a2:66:f1:0d:97 [3037102.187152] cdc_ether 3-2:1.0 enx2ea266f10d97:
> renamed from usb0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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