JonnyQuest
Posts: 13
Joined: Sat Apr 06, 2019 3:09 am

[Solved] Problems creating headless boot for Pi 3 B+

Sat Apr 06, 2019 3:49 am

I have searched the net and this forum and still have not found a answer for my headless boot to activate wireless. What I am trying to do is create an SD card that has ssh and the wireless network activated on 1st boot. The steps I have followed are below:

1) Downloaded Rasbian Stretch Light (release date 11-13-18)
2) New 32GB micro SD card was cleaned with diskpart and primary partition created
3) micro SD card was formatted using default windows format
4) Applied the image from the zipped file in Etcher to my micro SD class 10 32GB card
5) A blank file titled ssh was placed on the root of the sd card
6) The file wpa_supplicant.conf was created on the root of the sd card that contains the following

Code: Select all

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

          Network={
          ssid="MySSID"
          psk="MyPassword"
          }
I have also tried the line "ctrl_interface=DIR=/var/run/wap_supplicant GROUP=netdev" with the same results as well as placing the country statement after the update_config statement as it is generated by raspi_config.

the Pi will boot up and I can connect through ssh (wired) but no wireless. If I issue sudo raspi-config and chose option 2 (network option), then N2 (Wi-fi) I get the following message:

Could not communicate with wpa_supplicant

If I don't include wpa_supplicant.conf on the root of the sd, I can configure the country using sudo raspi-config and get the wireless working but I want to streamline/script my install for a Pi Zero Wireless so that I can ssh wirelessly after 1st boot.

Any help would be apreciated.
Attachments
wpa_supplicant Error.jpg
wpa_supplicant Error.jpg (67.31 KiB) Viewed 416 times
Last edited by JonnyQuest on Sun Apr 07, 2019 5:01 pm, edited 1 time in total.

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Problems creating headless boot for Pi B+

Sat Apr 06, 2019 2:25 pm

Not sure why the wireless errors like that but a few bits to ask:

What type of WiFi are you trying to connect to?
Is the SSID hidden? (can you unhide and test)?
After the first boot, does the wpa_supplicant.conf go from the boot directory?
Any odd characters (not a-z, 0-9 or A-Z) in the WiFi SSID or password?

As an aside, you can save sometime by not doing step 2 and step 3 of your list - Etcher will ignore what is on the card and create its own portion table and partitions depending what is in the image.
Need Pi spray - these things are breeding in my house...

JonnyQuest
Posts: 13
Joined: Sat Apr 06, 2019 3:09 am

Re: Problems creating headless boot for Pi B+

Sat Apr 06, 2019 10:41 pm

Since this works if I configure the wireless through raspi-config, there is no issue with the WiFi/SSID/odd characters. As expected, the file wpa_supplicant.conf was moved from the root of the sd card to /etc/wpa_supplicant so the file is where it should be and has been removed from the root.

Thanks for the feedback.

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Problems creating headless boot for Pi B+

Sat Apr 06, 2019 11:23 pm

It is possible it’s your SSID containing special characters. Have you looked at what the file contents are after you have used raspi-config?

Looking at the source of raspi-config here lines 1500 onwards actually change what you type in if they are special characters e.g. .*+ etc
Need Pi spray - these things are breeding in my house...

JonnyQuest
Posts: 13
Joined: Sat Apr 06, 2019 3:09 am

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 1:14 am

The only special character in my SSID is an underscore "_".

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 2:58 am

And that’s not in the list :twisted:

From what I can tell of the code in raspi-config the only time you see that message is if it cannot get the status of the interface.

What Pi are you using and us it the built in WLAN adapter or a USB one? If USB which one?
Can I also check:
What type of WiFi are you trying to connect to?
Is the SSID hidden?
Need Pi spray - these things are breeding in my house...

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

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 3:24 am

Is it the old Pi 1 B+ or the newer 3B+ model?

What are you using for a power supply?

What editor did you use to create the wpa_supplicant.conf file?

Try using the GUI to configure WiFi and then use the resulting wpa_supplicant.conf file.
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?

JonnyQuest
Posts: 13
Joined: Sat Apr 06, 2019 3:09 am

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 4:06 am

Sorry I missed that in my description. It is the latest Pi 3 B+ using the built in wireless. It works if I configure through raspi-config but I want to streamline my install and minimize my interaction other than cli.

JonnyQuest
Posts: 13
Joined: Sat Apr 06, 2019 3:09 am

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 4:15 am

I am using the power supply that came in my kit. Newark Element 14 Raspberry Pi 3 Model B+ Physical Computing Kit. The wpa_supplicant.conf file was created in notepad++. I have only compared my file with the file in /etc/wpa_supplicant. I will redo my sd card and run through raspi-config to copy the working file to see if that resolves my issue.

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

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 4:40 am

That should work (wpa_supplicant.conf can be a bit finicky about formatting).

Once you get a working wpa_supplicant.conf file it will work with both Desktop and Lite versions of Raspbian and any model of Pi with built-in WiFi (or other models with a Raspbian compatible USB WiFi dongle). I've been using the same one for years.

Notepad++ should work fine for editing wpa_supplicant.conf, but you might want to change its line ending from Windows (CR LF) to Unix (LF). That won't matter for wpa_supplicant.conf (I've tried it both ways) but it could matter on other configuration files you'll need to edit.
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?

JonnyQuest
Posts: 13
Joined: Sat Apr 06, 2019 3:09 am

[Solved] Problems creating headless boot for Pi B+

Sun Apr 07, 2019 4:45 am

1) I created a clean SD card following my steps outlined earlier. I did NOT copy my Windows version of wpa-supplicant.conf.
2) I ran through raspi-config and set up the wireless networking and verified that I could ping my Pi. I then copied /etc/wpa-supplicant/wpa-supplicant.conf to /boot.
3) I then shutdown my Pi.
4) I placed the sd card in my Windows laptop and copied wpa-supplicant.conf that was working.
5) Repeated creating the same sd card per my outlined steps including the previously working wpa-supplicant.conf
6) Booted my Pi and the wireless is working.

Thank you for all the assistance. I am late to the Pi game but I see so much potential in this product.

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

Re: Problems creating headless boot for Pi B+

Sun Apr 07, 2019 5:14 am

Glad you got it working.

Welcome to the forums and the Raspberry Pi community.
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 “Troubleshooting”