I'm trying to connect to my Raspberry Pi Zero over USB. The steps I followed are:
- Added
dtoverlay=dwc2
toconfig.txt
atboot
partition - Added
modules-load=dwc2,g_ether
afterrootwait
tocmdline.txt
atboot
partition - Connected my rpi to my computer through the micro-usb data port.
This results in network manager
from my computer creating a new wired connection, which implies a new network interface with an IPv6 assigned ip.
avahi-daemon
is up and running, but something is failing. My wired connection
disconnects and reconnects all the time.
avahi-browse
returns something like:
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66] Workstation local
A quick fix I found for the disconnections is to go to IPv6 Settings
from my wired connection and select Link-Local Only
as method. Later, to connect to my pi, I ping the whole network to retrieve its IPv6 address $ ping6 -I enp0s26u1u1 ff02::1
. Finally I connect through ssh to the IP I just discovered $ ssh -6 pi@fe80::fa1a:6601:e3a1:4a31%enp0s26u1u1
.
Inside the raspberry pi, running $ ip a s
shows that the rpi has an IPv4 address! So know that I know the network, I can assign an IPv4 address to my workstation.
The problem is that I have to repeat, all this steps each time I connect/disconnect the USB from the rpi.
I was wondering if someone knows how to avoid repeating all the process, because obviously something is failing.
Thanks!
iface usb0 inet dhcp
into/etc/network/interfaces
on the Pi 0 and then un-commenting thetimeout
in/etc/dhcp/dhclient.conf
. However, I had to configure a static IP address on the network interface created in Ubuntu for the Pienp0s29u1u2
to get a reliable connection.