DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Headless Zero W - can't connect

Mon Jun 18, 2018 11:55 am

I have installed the latest Raspbian on a Zero W but can't connect by wifi or USB. The files wpa_supplicant and ssh get deleted from /boot directory after reboot.

I'm trying to connect from Xubuntu 17.10.

I have installed another OS on the Zero W and could connect to it by USB, so this is not a hardware problem.

I can't provide any more specific debug information than that it appears like the password is wrong, but the password is "raspberry" - isn't it?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 12:17 pm

Maybe the user name is wrong? How are you trying to connect? From my Ubuntu box, I use:

Code: Select all

ssh pi@192.168.1.243

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

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 12:28 pm

Or, to mention the other corner of this triangle: if you are certain that the username pi and default (unchanged) password raspberry are correct, maybe the system you are connecting to is not the right one?

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 3:15 pm

I managed to connect briefly, but now it fails again.

It is incredibly annoying that the Raspberry Pi deletes the ssh and wpa_supplicant.conf files on each boot. I have recreated them so many times now and re-inserted the SD card in the slot.

I have no idea how to debug this thing. Where are the log files? Where does the Raspberry Pi store the options selected in raspi-config?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 3:22 pm

Once those files disappear, they should not need to be replaced.

The first thing I do when I log in to a new RPi is run

Code: Select all

sudo apt-get update
sudo apt-get upgrade
Is that what you are doing?

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 3:28 pm

Yes. I did that, changed the password, went into raspi-config etc.

Now my computer can't find the Raspberry Pi anymore.

Code: Select all

ssh: Could not resolve hostname raspberrypi.local: Name or service not known
Once those files disappear, they should not need to be replaced.
Excuse me, but it is not present on the network. My computer can't see it (see above). What else can I do than replace those two files (wpa_supplicant.conf and ssh)?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 3:41 pm

I use nmap to check devices on my localnets. You may need to install it on your Linux PC.

Code: Select all

nmap 192.168.0.*
Replace 192.168.0.* with your localnet IP.

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 4:08 pm

Thanks. I'm seeing some progress now. Managed to find its IP and connect, at least. Next step in the process is to set up two wireless interfaces (internal wifi + external USB dongle).

Update: The problem now is that the hostapd I get when installing with apt-get is buggy. Can someone confirm that? It used to be a problem in Ubuntu 14.04. hostapd is not working on this version of Raspbian (Linux 4.14.34).

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 4:47 pm

My experience with hostapd is it is not buggy.

My experience with the wireless interfaces initializing with different names has been a problem. Sometimes the onboard wifi boots as wlan0, and other times as wlan1. This cause me problems because my usb dongle did not support AP mode.

Edit: I also found that if you don't split the wpa_supplicant.conf file will cause hostapd service to exit abnormally.

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 5:25 pm

I'm using https://github.com/oblique/create_ap to handle all the details in the setup. It usually "just works". I see no reason why it shouldn't also "just work" on a Raspberry Pi if hostapd is working as it should. I say that because when I launch create_ap, I can connect to the Pi's wireless AP but it doesn't give me internet.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 5:44 pm

I haven't used the setup script you posted.

I just finished setting up an AP using the standalone network here. It is working fine.
https://www.raspberrypi.org/documentati ... s-point.md
I know it works because I edited it to comply with the new Stretch version. I'm using the newest. 2018-04-18

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 5:52 pm

That's not good enough. create_ap works on any normal linux install and should also work here. I don't know enough about routing etc to install this the way you have done.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 5:57 pm

Maybe you should ask the person who wrote that script why it doesn't work with a RPi.

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 6:10 pm

I could do that too. In very few user forums that I have visited do people try to direct unsolved questions to somewhere else.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 6:39 pm

DG415346 wrote:
Mon Jun 18, 2018 6:10 pm
I could do that too. In very few user forums that I have visited do people try to direct unsolved questions to somewhere else.
I gave you the best advice I have by directing you to the current tutorial, and was willing to help you with that tutorial, and you refused. The reason it is unsolved is you refused the help here. I know nothing of that script, and am not about to troubleshoot it after troubleshooting and rewriting the tutorial in this site's docs. To get help with that script, chances are you will need to ask the author of that script.

Maybe if you wait around, somebody else will help you with that script.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5645
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 6:52 pm

DG415346 wrote:
Mon Jun 18, 2018 3:28 pm
Yes. I did that, changed the password, went into raspi-config etc.

Now my computer can't find the Raspberry Pi anymore.

Code: Select all

ssh: Could not resolve hostname raspberrypi.local: Name or service not known
Once those files disappear, they should not need to be replaced.
Excuse me, but it is not present on the network. My computer can't see it (see above). What else can I do than replace those two files (wpa_supplicant.conf and ssh)?
Your computer cannot find it via the hostname "raspberrypi.local" but that does not mean that it is not present on the network. Have you checked if a new, unnamed device has been assigned an IP address by the router (eg. by something like "fing" on a mobile phone or via lugging in to the router itself)?
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 7:31 pm

SurferTim, I will follow your advice and try the procedure that you linked to. I notice that the article states: "If you are having trouble with a USB wireless dongle, please check the forums."

So, my first question is that I don't have a static IP address. I get internet from a dhcp server, with different IP each time. How do I modify this procedure?

The second problem is how to take down the wlan0 interface that I am connected through to this headless Zero W, in order to set up the bridge?

If I do

Code: Select all

denyinterfaces wlan0
won't it interfere with my ability to log on the this headless RPi through ssh?

OK, so I could reconnect to the RPi after following these steps. I am testing the AP now and trying to connect a phone, but it seems to hang on "Obtaining IP address".
Last edited by DG415346 on Mon Jun 18, 2018 8:02 pm, edited 2 times in total.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 7:52 pm

My RPi gets a dhcp lease for the WAN (eth0 or maybe wlan1 in your case) from my router. If you do not have a static IP issued by your ISP, the best way to access it is through the AP IP address (192.168.4.1) by connecting to the RPi's AP.

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 8:04 pm

I have followed the procedure you linked to https://www.raspberrypi.org/documentati ... s-point.md , and the result is that when I try to connect it hangs on "Obtaining IP address..."

Is there any way to debug this script / procedure? In syslog, I get many errors like this:
dnsmasq-dhcp[671]: DHCP packet received on br0 which has no address

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 8:36 pm

Trevor, thanks, I found the RPi's IP address by using nmap and managed to log on with ssh. I guess the initial problem is solved.

Now I am trying to set up the RPi as a wireless AP, so far without success.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 8:36 pm

Did you use the NAT or bridge AP? There are two. I use the NAT, and I highly recommend you should also.

If you used the NAT, you can obtain the status of dnsmasq.

Code: Select all

sudo service dnsmasq status
It should show active (running).
Same with hostapd.

DG415346
Posts: 33
Joined: Mon Jun 18, 2018 11:42 am

Re: Headless Zero W - can't connect

Mon Jun 18, 2018 8:57 pm

Using NAT. dnsmasq and hostapd both show active (running).

Connection attempts fail, or rather hang indefinitely at "Obtaining IP address..."
dnsmasq-dhcp[586]: DHCP packet received on wlan1 which has no address

Return to “Troubleshooting”