ghile
Posts: 19
Joined: Thu Jun 15, 2017 9:52 am

raspberry pi zero and ssh

Mon May 18, 2020 4:14 pm

Hi,

I would like to connect my raspberry pi zero on Lan to connect via ssh.
I connected a usb ethernet adapter dongle to the usb port and connected it directly to the router. however, the raspberry does not surf the internet and is not visible via ssh.
Can you help me?

Thanks !

User avatar
mooblie
Posts: 218
Joined: Fri Oct 14, 2016 2:07 pm
Location: The Scottish Highlands

Re: raspberry pi zero and ssh

Mon May 18, 2020 4:20 pm

Did you put an empty file named "ssh" in the /boot/ root folder before you tried this?

Easiest to do this with the PC when you first burn the SD card.

Also: does a network monitor program (from another device on the network) show the Pi Zero as having been issued with an IP address?

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: raspberry pi zero and ssh

Mon May 18, 2020 5:08 pm

ghile wrote:
Mon May 18, 2020 4:14 pm
Hi,

I would like to connect my raspberry pi zero on Lan to connect via ssh.
I connected a usb ethernet adapter dongle to the usb port and connected it directly to the router. however, the raspberry does not surf the internet and is not visible via ssh.
Can you help me?

Thanks !

The very first thing you need to do is install an Operating System. Raspbian would be a good choice. Your Raspberry Pi Zero board will not connect to your network until it is running an Operating System.

ghile
Posts: 19
Joined: Thu Jun 15, 2017 9:52 am

Re: raspberry pi zero and ssh

Mon May 18, 2020 5:23 pm

Hi,
thanks for reply,

yes, I put ssh in / boot / root
no ip is assigned from router (dhcp auto). If I connect the raspberry pi 3, ip is assigned and it connects on ssh

help ! :lol:

User avatar
mooblie
Posts: 218
Joined: Fri Oct 14, 2016 2:07 pm
Location: The Scottish Highlands

Re: raspberry pi zero and ssh

Mon May 18, 2020 5:33 pm

I guess it's not a Pi Zero W? so you could try WiFi instead of wired?

Maybe you'll have to connect a keyboard and screen directly to the Pi Zero, at least temporarily, to see what's going on.

Maybe the USB-to-Ethernet dongle you have is not compatible with the Pi's OS?

You haven't got the power input and the Ethernet dongle in the wrong micro-USB sockets? Not swapped over accidentally?

(Looks like we've all got the same ideas below! :) )
Last edited by mooblie on Mon May 18, 2020 5:40 pm, edited 3 times in total.

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: raspberry pi zero and ssh

Mon May 18, 2020 5:34 pm

usb ethernet adapter dongle
Is that usb ethernet adapter dongle known to be compatible with the Operating System you are using? [Also suggested above as I was originally typing this... ]

Does it work if you use it with your RPi3 board in place of the built-in ethernet interface on that model? (You might need an appropriate adapter to check this.)
Last edited by B.Goode on Mon May 18, 2020 5:36 pm, edited 2 times in total.

W. H. Heydt
Posts: 13601
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: raspberry pi zero and ssh

Mon May 18, 2020 5:35 pm

ghile wrote:
Mon May 18, 2020 5:23 pm
Hi,
thanks for reply,

yes, I put ssh in / boot / root
no ip is assigned from router (dhcp auto). If I connect the raspberry pi 3, ip is assigned and it connects on ssh

help ! :lol:
A Pi0 has two micro USB-B ports. One of them only has the power lines connected. The other has power and data lines connected. Be sure your Ethernet dongle is connected to the correct micro USB-B port.

ghile
Posts: 19
Joined: Thu Jun 15, 2017 9:52 am

Re: raspberry pi zero and ssh

Mon May 18, 2020 6:44 pm

Thanks for reply !
Be sure your Ethernet dongle is connected to the correct micro USB-B port.
Yes, sure !
I guess it's not a Pi Zero W? so you could try WiFi instead of wired?
I Raspberry Pi Zero, 1.3 not W.

I tried to connect it to the monitor. I also connected a usb wifi edimax (compatible with raspberry pi 2), raspian detects it. but message is
no wirless interfaces found and
wlan0 not associated.
I simply connected it, maybe there is something to do?

User avatar
HawaiianPi
Posts: 5988
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: raspberry pi zero and ssh

Mon May 18, 2020 6:52 pm

ghile wrote:
Mon May 18, 2020 6:44 pm
I tried to connect it to the monitor. I also connected a usb wifi edimax (compatible with raspberry pi 2), raspian detects it. but message is wlan0 not associated.
I simply connected it, maybe there is something to do?
Not associated means it's not connected to your router (but likely working).

With a WiFi adapter you'll need a file called wpa_supplicant.conf with the following info inside:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
	ssid="WiFi SSID"
	psk="WPA/WPA2 passphrase"
}
Edit country=, ssid= and psk= with your information and save the file. Place that on the "boot" partition (like the ssh file). Be sure you use your country's 2 letter abbreviation.

With wpa_supplicant.conf and the ssh file, and a compatible WiFi adapter, you can do a completely headless boot of your Pi0v1.3. Remember that the Pi0 is slow, so it could take a couple of minutes to boot (depending on OS version and SD card speed). Be sure to give it enough time before you try an SSH login.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

ghile
Posts: 19
Joined: Thu Jun 15, 2017 9:52 am

Re: raspberry pi zero and ssh

Mon May 18, 2020 6:59 pm

I restarted and everything works!
So the problem seems to be the usb dongle. Is there a list of usable usb-network dongles?

Thank you very much !

User avatar
mooblie
Posts: 218
Joined: Fri Oct 14, 2016 2:07 pm
Location: The Scottish Highlands

Re: raspberry pi zero and ssh

Mon May 18, 2020 9:20 pm

https://elinux.org/RPi_USB_Ethernet_adapters

...and of course, if you look through the reviews of the cheap adapters on Amazon, the successful use on a Pi is often confirmed.

If you can identify the chip used inside a working adapter, then find a cheap no-name model with the same chip (on eBay or AliExpress for example?) then you're done!

Like this for example:

https://www.ebay.co.uk/itm/254228080000

(which even has the micro-USB plug you'll need, without an adapter!)

Return to “Beginners”