spidermancan0370
Posts: 8
Joined: Wed Jul 29, 2020 6:04 pm

Can't setup raspberry Pi zero W with SSH

Fri Sep 24, 2021 2:00 pm

I recently purchased the Raspberry Pi zero W. I am trying to set it up, all the sources I found (there isn't any official set-up guides) said to go to PuTTY and type

Code: Select all

raspberry pi
into the name. I have tried to troubleshoot, but PuTTY still says "the host does not exist."
Please help me

danjperron
Posts: 3871
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Can't setup raspberry Pi zero W with SSH

Fri Sep 24, 2021 2:33 pm

First you need to set the network and enable ssh on your raspberry PI.
There are multiple documentation to set the PIzerow.

ex: https://core-electronics.com.au/tutoria ... setup.html

After you set the pizero with the wpa_supplicant and add the file ssh into the /boot partition. you need to figure out the IP of your PI.


Now How to get the IP

- If you have an android cell phone use "fing" to figure out the IP.
- On a Mac or linux just "ping raspberrypi.local" it should return the IP. Or just type ssh pi@raspberrypi.local

- On a PC you could install "allo bonjour" from apple
https://support.apple.com/kb/dl999
Once installed your computer will recognize raspberrypi.local
If you have a recent window10 ssh is already included. no need for putty.
just type it from a command prompt -> ssh pi@raspberrypi.local


- Accessing the router you should be able to get the IP via the dhcp client list.


Daniel

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

Re: Can't setup raspberry Pi zero W with SSH

Fri Sep 24, 2021 3:39 pm

spidermancan0370 wrote:
Fri Sep 24, 2021 2:00 pm
I recently purchased the Raspberry Pi zero W. I am trying to set it up, all the sources I found (there isn't any official set-up guides) said to go to PuTTY and type

Code: Select all

raspberry pi
into the name. I have tried to troubleshoot, but PuTTY still says "the host does not exist."
Please help me

These guides look pretty 'official' to me...

https://projects.raspberrypi.org/en/pat ... spberry-pi

https://www.raspberrypi.org/documentati ... arted.html

https://www.raspberrypi.org/documentati ... spberry-pi

https://www.raspberrypi.org/documentati ... ote-access


Any guide that tells you to use a hostname of "raspberry<space>pi" is just plain WRONG, because a hostname cannot contain a <space> character as part of the name.

spidermancan0370
Posts: 8
Joined: Wed Jul 29, 2020 6:04 pm

Re: Can't setup raspberry Pi zero W with SSH

Sun Sep 26, 2021 7:47 pm

B.Goode wrote:
Fri Sep 24, 2021 3:39 pm
spidermancan0370 wrote:
Fri Sep 24, 2021 2:00 pm
I recently purchased the Raspberry Pi zero W. I am trying to set it up, all the sources I found (there isn't any official set-up guides) said to go to PuTTY and type

Code: Select all

raspberry pi
into the name. I have tried to troubleshoot, but PuTTY still says "the host does not exist."
Please help me

These guides look pretty 'official' to me...

https://projects.raspberrypi.org/en/pat ... spberry-pi

https://www.raspberrypi.org/documentati ... arted.html

https://www.raspberrypi.org/documentati ... spberry-pi

https://www.raspberrypi.org/documentati ... ote-access


Any guide that tells you to use a hostname of "raspberry<space>pi" is just plain WRONG, because a hostname cannot contain a <space> character as part of the name.
These are all guides for the newer raspberrypi, also I'm sorry if I said that there was a space in the hostname. The guides didn't have a space

Cloudcentric
Posts: 1277
Joined: Fri Sep 14, 2012 9:13 am

Re: Can't setup raspberry Pi zero W with SSH

Sun Sep 26, 2021 8:02 pm

spidermancan0370 wrote:
Sun Sep 26, 2021 7:47 pm
B.Goode wrote:
Fri Sep 24, 2021 3:39 pm
spidermancan0370 wrote:
Fri Sep 24, 2021 2:00 pm
I recently purchased the Raspberry Pi zero W. I am trying to set it up, all the sources I found (there isn't any official set-up guides) said to go to PuTTY and type

Code: Select all

raspberry pi
into the name. I have tried to troubleshoot, but PuTTY still says "the host does not exist."
Please help me

These guides look pretty 'official' to me...

https://projects.raspberrypi.org/en/pat ... spberry-pi

https://www.raspberrypi.org/documentati ... arted.html

https://www.raspberrypi.org/documentati ... spberry-pi

https://www.raspberrypi.org/documentati ... ote-access


Any guide that tells you to use a hostname of "raspberry<space>pi" is just plain WRONG, because a hostname cannot contain a <space> character as part of the name.

These are all guides for the newer raspberrypi, also I'm sorry if I said that there was a space in the hostname. The guides didn't have a space

Those are guides / documentation written for the supported Raspberry Pi (formerly Raspbian) Buster Operating System, this Operating System is recommended for ALL Raspberry Pi SBC & Compute Module ;)
.
.

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

Re: Can't setup raspberry Pi zero W with SSH

Sun Sep 26, 2021 8:56 pm

spidermancan0370 wrote:
Fri Sep 24, 2021 2:00 pm
I recently purchased the Raspberry Pi zero W. I am trying to set it up...
We need to know exactly what you've done to "set it up" to be able to help you. You gave us no information at all, which makes helping you just a guessing game.

For example, set it up for what, a wireless network, or SSH over USB (USB-Ethernet gadget)?

In addition, information about what OS you are using on the Pi0W and the host computer you are using to set it up would be helpful.
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?

spidermancan0370
Posts: 8
Joined: Wed Jul 29, 2020 6:04 pm

Re: Can't setup raspberry Pi zero W with SSH

Mon Sep 27, 2021 9:59 pm

HawaiianPi wrote:
Sun Sep 26, 2021 8:56 pm
spidermancan0370 wrote:
Fri Sep 24, 2021 2:00 pm
I recently purchased the Raspberry Pi zero W. I am trying to set it up...
We need to know exactly what you've done to "set it up" to be able to help you. You gave us no information at all, which makes helping you just a guessing game.

For example, set it up for what, a wireless network, or SSH over USB (USB-Ethernet gadget)?

In addition, information about what OS you are using on the Pi0W and the host computer you are using to set it up would be helpful.
1. Install raspbian lite'

2. Create blank text document label it "ssh" and remove the .txt extension.

3.create a file called wpa_supplicant.conf
input this code

Code: Select all

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

network={
  ssid="NETWORK-NAME"
  psk="NETWORK-PASSWORD"
}
4. replace SSID and psk with your information

5. eject.

6, install bonjour onto your PC

7 wait for Pi to boot up

8 install PuTTY and input IP

I hope this helps to clarify things!

jbudd
Posts: 1911
Joined: Mon Dec 16, 2013 10:23 am

Re: Can't setup raspberry Pi zero W with SSH

Mon Sep 27, 2021 10:04 pm

The default hostname is "raspberrypi" not "raspberry pi"

Oh B.Goode already said that

ayalin
Posts: 1
Joined: Sat Oct 02, 2021 2:08 am

Re: Can't setup raspberry Pi zero W with SSH

Sat Oct 02, 2021 2:19 am

jbudd wrote:
Mon Sep 27, 2021 10:04 pm
The default hostname is "raspberrypi" not "raspberry pi"

Oh B.Goode already said that
hey, I've been doing that a lot of times and I still can't connect to wifi, I just got the raspberry pi 0 W and I created the files but it doesnt connect.
I plug in the raspberry into a monitor, i put the raspi-config, introduced the SSID and password and still, it doesn't connect, any help with that?

jbudd
Posts: 1911
Joined: Mon Dec 16, 2013 10:23 am

Re: Can't setup raspberry Pi zero W with SSH

Sat Oct 02, 2021 1:29 pm

https://www.raspberrypi.org/documentati ... spi-config

We would need more information about exactly what you have done and exactly what doesn't work to give more specific advice.

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

Re: Can't setup raspberry Pi zero W with SSH

Sat Oct 02, 2021 2:01 pm

ayalin wrote:
Sat Oct 02, 2021 2:19 am
jbudd wrote:
Mon Sep 27, 2021 10:04 pm
The default hostname is "raspberrypi" not "raspberry pi"

Oh B.Goode already said that
hey, I've been doing that a lot of times and I still can't connect to wifi, I just got the raspberry pi 0 W and I created the files but it doesnt connect.
I plug in the raspberry into a monitor, i put the raspi-config, introduced the SSID and password and still, it doesn't connect, any help with that?

{Seems to be a 'highjack' of someone else's issue. A recipe for confusion.}



Presumably you must have a monitor and a keyboard directly connected to your RPiZeroW if you have used the raspi-config utility as part of the setup process. So you can do your debugging directly on the RasPiOS system running on the RPiZeroW hardware. You don't need to 'create the files.'


From a shell prompt (the CLI or Terminal) try -

Code: Select all

ssh pi@localhost
That should generate a prompt to enter the password for the pi user on the system, as a 'loopback' test. That will reassure you that the sshd server has been enabled. This is independent of any external network connection.

Then turn your attention to the WiFi configuration. There is a WiFI icon on the Raspberry Desktop GUI that will allow you to configure the association with your local Access Point / Hotspot. You need to be sure that your chosen Access Point is one that does NOT impose 'WiFi Client Separation' - a security measure that prevents WiFi clients from being attacked or exploited by other devices on the WiFi network.



{In case it is what you need to hear, and no-one has specifically said: associating an RPiZeroW with a WiFi hotspot and logging into the RPi via ssh from a Windows PC over that WiFi connection is an entirely normal thing to do, and something I do regularly. I am not aware of any error or omission in the official Raspberry Pi documentation I have provided links for in response to the initial query.}

drgeoff
Posts: 12244
Joined: Wed Jan 25, 2012 6:39 pm

Re: Can't setup raspberry Pi zero W with SSH

Sat Oct 02, 2021 2:13 pm

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
1. Install raspbian lite'

2. Create blank text document label it "ssh" and remove the .txt extension.

3.create a file called wpa_supplicant.conf
input this code

Code: Select all

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

network={
  ssid="NETWORK-NAME"
  psk="NETWORK-PASSWORD"
}
4. replace SSID and psk with your information

5. eject.

6, install bonjour onto your PC

7 wait for Pi to boot up

8 install PuTTY and input IP
1. It isn't "raspbian lite". It is "Raspberry Pi OS Lite". https://www.raspberrypi.org/software/op ... -os-32-bit

2. There is no need to remove the .txt extension. ssh.txt is also accepted. Where have you put that file?

3. Your wpa_supplicant.conf file is missing the key_mgmt=WPA-PSK line.

6 and 8. The reason for installing Bonjour is so that you don't need to know and use the IP address of the RPi.
Quis custodiet ipsos custodes?

drgeoff
Posts: 12244
Joined: Wed Jan 25, 2012 6:39 pm

Re: Can't setup raspberry Pi zero W with SSH

Sat Oct 02, 2021 2:16 pm

B.Goode wrote:
Sat Oct 02, 2021 2:01 pm
There is a WiFI icon on the Raspberry Desktop GUI that will allow you ....
Not the case for the lite OS. :(
Quis custodiet ipsos custodes?

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

Re: Can't setup raspberry Pi zero W with SSH

Sat Oct 02, 2021 2:25 pm

drgeoff wrote:
Sat Oct 02, 2021 2:16 pm
B.Goode wrote:
Sat Oct 02, 2021 2:01 pm
There is a WiFI icon on the Raspberry Desktop GUI that will allow you ....
Not the case for the lite OS. :(
True. But @ayalin, the cuckoo in the nest to whom I inadvertently replied, hasn't specified the use of RasPiOS Lite. We'll see...

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

Re: Can't setup raspberry Pi zero W with SSH

Mon Oct 04, 2021 3:35 am

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
1. Install raspbian lite'
How are you installing the OS?

If you are using Raspberry Pi Imager there is a hidden menu that will simplify a lot of configuration options (Control+Shift+x). Using the Advanced options menu alleviates a lot of common first boot setup problems.

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
2. Create blank text document label it "ssh" and remove the .txt extension.
No need to remove the .txt extension (either ssh or ssh.txt will work).

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
3. create a file called wpa_supplicant.conf
input this code

Code: Select all

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

network={
  ssid="NETWORK-NAME"
  psk="NETWORK-PASSWORD"
}
4. replace SSID and psk with your information
That looks correct.

Although it's easy to create an invalid wpa_supplicant.conf with the wrong text editor. What are you using to edit the file?

Using the Raspberry Pi Imager Control+Shift+x Advanced options menu resolves formatting problems.

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
5. eject.

6. install bonjour onto your PC
With recent versions of Windows 10 mDNS hostname resolution is included and Bonjour is not necessary.

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
7. wait for Pi to boot up
This can take awhile with the Pi Zero. How long are you waiting?

spidermancan0370 wrote:
Mon Sep 27, 2021 9:59 pm
8. install PuTTY and input IP
Why install Bonjour if you know the IP, and how are you determining the IP address of your Pi0W?

Bonjour/mDNS hostname resolution is normally used with ssh pi@raspberrypi.local and is not used or needed if you know the IP address of your Pi (which can normally be found in your router's connected client list, or with a network scanner like fing).

Note that recent versions of Windows 10 also have SSH functionality built-in to PowerShell and the command prompt (cmd.exe), although PuTTY can still be used (I still use PuTTY for the convenience of Saved Sessions).

Oh, and don't forget, the Pi Zero W is 2.4GHz only (you cannot connect to a 5GHz network). I also seem to remember something about your router's wireless mode needing to be set to Mixed or Auto, and not N-only.
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?

Return to “General discussion”