0

I need to connect my raspberry Zero to my PC via USB (with my Linux LMDE ), Si i found this instruction.

Firstly i downloaded the Raspbian Stretch with desktop version for my SD card and i use etcher to write Raspbian on my SD card. but when it's done i have two partition in my SD card as seen blown:

SD card two partition

So i do this instructions:

Open the "config.txt" file with Notepad++

Scroll all the way down to the bottom.

Type "dtoverlay=dwc2" in the last line and then add an extra line after that.

Save and close the file.

Open "cmdline.txt" file with Notepad++

Find a section after "rootwait"

Paste "modules-load=dwc2,g_ether" in said section.

Save and close the file.

Create a new file called "ssh"

Eject the MicroSD Card and place it on your Raspberry Pi

finally when I connect my raspberry zero to my pc via USB cable i write this code:

ssh pi@raspberrypi.local

I got this error:

ssh: Could not resolve hostname raspberrypi.local: Name or service not known

my raspberry is working and it's LED is on (Green).

UPADATE:

According to comments,I have installed ssh again with this code sudo apt-get install openssh-server but again that problem exist.

I run lsusb with and without pi conected to USB port and i get this answer:

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

Shown blow: lsusb

when i run ifconfig usb0 I get:

usb0: error fetching interface information: Device not found

but when i write ifconfig -a i get (based of comparing result on with & without pi connected to USB):

enp0s20f0u1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether be:32:12:f4:45:07  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

My solution:

I do this as solution :

solution Thanks a lot.

4
  • "To be able to connect to your Raspberry Pi using Putty in Windows, you need to have Bonjour installed, otherwise you'll get an error" – Milliways May 20 '19 at 9:36
  • Hello, looks like you're on Linux (based on the screenshot anyway) so try avahi-browser or some such from the package manager. Does lsusb or dmesg show the enumerated Pi ethernet gadget? Does the ethernet gadget need a DHCP server to connect? – Roger Jones May 20 '19 at 10:01
  • You also seem to expect SSH to work without enabling it first. – Dmitry Grigoryev May 20 '19 at 13:05
  • This previous answer might help: raspberrypi.stackexchange.com/a/73924/93934 – Roger Jones May 20 '19 at 15:43

Browse other questions tagged or ask your own question.