Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

wpa_supplicant

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
dipoc67681
Posts: 5
Joined: 2019-11-23 08:40

wpa_supplicant

#1 Post by dipoc67681 »

A few times in the past I've attempted to install Debian but gave up on these occasions as I could never get wifi to work on my machine. I ended up running OpenBSD and FreeBSD because the wireless setup was so confusing to me, but this time I'm determined to get it straightened out!

I've a Thinkpad Carbon X1 which has an Intel 8275 wireless card. I used the image:

firmware-10.2.0-amd64-netinst.iso

And I went through the non-graphical install. The installation recognized my wifi card just fine and was able to connect to the internet during installation. One strange thing though is the netinst, I had presumed was going to ask me if I wanted to install additional packages. I had read there would be a time during the install you could add additional packages and the installation program would fetch them from the internet and install them. This prompt never came. It only gave me the option to install the minimal. I thought, ok, this isn't so bad, I'm used to a stripped down system like OpenBSD, this is basically what I want. I can add X and a tiling window manager later...

Or so I thought, but again I struggle to setup this wireless connection (my only option at the moment).

I follow the instructions on this page:

https://wiki.debian.org/WiFi/HowToUse#wpa_supplicant

But I've been unsuccessful.

What has worked so far:

# chmod 0600 /etc/network/interfaces

$ su -l -c "wpa_passphrase myssid my_very_secret_passphrase > /etc/wpa_supplicant/wpa_supplicant.conf"

My /etc/wpa_supplicant/wpa_supplicant.conf looks like (with "myssid" and the psk of course replaced with my own):

ctrl_interface=/run/wpa_supplicant
update_config=1
network={
ssid="myssid"
#psk="my_very_secret_passphrase"
psk=ccb290fd4fe6b22935cbae31449e050edd02ad44627b16ce0151668f5f53c01b
}

Now, I'm almost at the end, but I run into trouble here:

$ sudo systemctl reenable wpa_supplicant.service
$ sudo systemctl restart wpa_supplicant.service
$ sudo systemctl restart dhcpcd.service
$ sudo wpa_supplicant -B -Dwext -i wlp2s0 -c/etc/wpa_supplicant.conf

When I issue the command `sudo systemctl restart dhcpcd.service', I get:

Failed to restart dhcpcd.service: Unit dhcpcd.service not found.

Not sure what to do next, I attempted to install isc-dhcp-server package. What I ended up doing was formatted a FAT usb stick and manually downloaded the package and all relevant dependencies, dpkg -i *, and tried to repeat the process. Unfortunately this did not work either.

So, now I'm completely stuck again. There has got to be a way for me to configure the wifi from the command line? Would anyone be able to point me in the right direction?

dipoc67681
Posts: 5
Joined: 2019-11-23 08:40

Re: wpa_supplicant

#2 Post by dipoc67681 »

Oh, yea, and by the way, I don't even have man pages installed! I was kind of shocked when I realized that after the installation reboot. That makes it almost impossible to fix the system without a separate internet connected machine. Should I just try to reinstall? If the network is up and functioning during the installation, is there a way to "save" this configuration for regular use, i.e., after rebooting the installation?

trinidad
Posts: 299
Joined: 2016-08-04 14:58
Been thanked: 16 times

Re: wpa_supplicant

#3 Post by trinidad »

I notice in your post that you began with "su -" yet later you use "sudo". Did you install sudo initially or did you just work from root? Try the command from "su -" in the terminal.

TC
You can't believe your eyes if your imagination is out of focus.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: wpa_supplicant

#4 Post by Head_on_a_Stick »

dipoc67681 wrote:One strange thing though is the netinst, I had presumed was going to ask me if I wanted to install additional packages. I had read there would be a time during the install you could add additional packages and the installation program would fetch them from the internet and install them. This prompt never came. It only gave me the option to install the minimal.
Yes, the installer should have a tasksel section that will let you pick the desktop. I've just run the 10.2 netinstall ISO in QEMU and it does indeed ask. Did you verify the integrity of the image? What was the exact URL from which it was downloaded?
dipoc67681 wrote:I follow the instructions on this page:

https://wiki.debian.org/WiFi/HowToUse#wpa_supplicant

But I've been unsuccessful.
Your post does not match those instructions.

Try this bit: https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK

Hints: you don't need to run wpa_supplicant directly and Debian uses dhclient rather than dhcpcd.
dipoc67681 wrote:I don't even have man pages installed!
Yeah, I think your image was bad.
deadbang

dipoc67681
Posts: 5
Joined: 2019-11-23 08:40

Re: wpa_supplicant

#5 Post by dipoc67681 »

trinidad wrote:I notice in your post that you began with "su -" yet later you use "sudo". Did you install sudo initially or did you just work from root? Try the command from "su -" in the terminal.

TC
Yes, everything was done from root.
Head_on_a_Stick wrote:
dipoc67681 wrote:One strange thing though is the netinst, I had presumed was going to ask me if I wanted to install additional packages. I had read there would be a time during the install you could add additional packages and the installation program would fetch them from the internet and install them. This prompt never came. It only gave me the option to install the minimal.
Yes, the installer should have a tasksel section that will let you pick the desktop. I've just run the 10.2 netinstall ISO in QEMU and it does indeed ask. Did you verify the integrity of the image? What was the exact URL from which it was downloaded?
The image was obtained from: https://cdimage.debian.org/cdimage/unof ... etinst.iso

Upon your recommendation, I repeated the download, verification, and dd again on my mac. My first attempt was from an OpenBSD machine. The ISO was verified there too, so I don't think it could be the integrity of the image. Everything came out good, but by your recommendation, I re-downloaded the image and tried with another USB on another machine.

On my mac I checked:
% shasum -a 512 -c SHA512SUMS 2>/dev/null | grep firmware-10.2.0-amd64-netinst.iso
firmware-10.2.0-amd64-netinst.iso: OK

I used:
% sudo dd if=firmware-10.2.0-amd64-netinst.iso of=/dev/rdisk2
Head_on_a_Stick wrote:Your post does not match those instructions.

Try this bit: https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK

Hints: you don't need to run wpa_supplicant directly and Debian uses dhclient rather than dhcpcd.
Hmm... how have I strayed from the instructions on https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK?

I checked again and haven't appeared to miss anything? Could be so kind to point out what it is that I did miss?

These command go fine:

# systemctl reenable wpa_supplicant.service
# systemctl restart wpa_supplicant.service

But here I get an error:

# systemctl restart dhcpcd.service

"Failed to restart dhcpcd.service: Unit dhcpcd.service not found."

That doesn't bode well, but I continue anyway to see what happens:

# wpa_supplicant -B -Dwext -i wlp2s0 -c/etc/wpa_supplicant/wpa_supplicant.conf

And get:
Successfully initialized wpa_supplicant
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

And:
# ping google.com
ping: google.com: Temporary failure in name resolution

No love :-(
Last edited by dipoc67681 on 2019-11-23 19:24, edited 1 time in total.

dipoc67681
Posts: 5
Joined: 2019-11-23 08:40

Re: wpa_supplicant

#6 Post by dipoc67681 »

My /etc/network/interfaces file:

source /etc/network/interfaces.d/*
auto lo
face lo net loopback
# you'll need to copy from "psk=" to the end of the line, to put in your /etc/network/interfaces file.
psk=<some long string without these brackets>

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: wpa_supplicant

#7 Post by Head_on_a_Stick »

dipoc67681 wrote:The image was obtained from: https://cdimage.debian.org/cdimage/unof ... etinst.iso
As I said I've just tried that exact image and it does ask for a graphical desktop. The expert installer should have a tasksel section to select it explicitly.
dipoc67681 wrote:I used:
% sudo dd if=firmware-10.2.0-amd64-netinst.iso of=/dev/rdisk2
Did you flush the buffers before removing the stick?

Code: Select all

sync
Copy the image back to a file and check the sha256sum again to rule out a bad USB stick.
dipoc67681 wrote:Hmm... how have I strayed from the instructions on https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK?
You stopped reading too soon. Read the bit after wpa_supplicant is run directly, it shows what to add to the interfaces file. At no point does the wiki suggest to run systemctl.
deadbang

dipoc67681
Posts: 5
Joined: 2019-11-23 08:40

Re: wpa_supplicant

#8 Post by dipoc67681 »

Head_on_a_Stick wrote:
dipoc67681 wrote:The image was obtained from: https://cdimage.debian.org/cdimage/unof ... etinst.iso
As I said I've just tried that exact image and it does ask for a graphical desktop. The expert installer should have a tasksel section to select it explicitly.
I used the non-graphical installer in both instances.
Head_on_a_Stick wrote:
dipoc67681 wrote:
dipoc67681 wrote:I used:
% sudo dd if=firmware-10.2.0-amd64-netinst.iso of=/dev/rdisk2
Did you flush the buffers before removing the stick?

Code: Select all

sync
Copy the image back to a file and check the sha256sum again to rule out a bad USB stick.
I'm not sure how to flush the buffers. Can you describe how I do that? The chances of it being a bad USB stick are pretty slim, while although I'd love for it to be something as simple as that, I've tried two separate instances made on two separate machines, and besides I've had this EXACT problem for multiple Debian releases now. In fact, I've been using OpenBSD for a few years because it was much easier to setup unfortunately for me I still want to use Debian instead. I do suppose I could just go with another distribution, but I've used Linux for decades (an Debian or Slackware for the majority of this), but sadly WiFi has become a dealbreaker for me. If I can't get WiFi to work on a machine, it unfortunately won't work for me. I've had great difficulty trying to piece together how to do that on Debian for years now. I try a few times every release to see if things have improved, but eventually give up and wait for the next release. So far, I've been unsuccessful, but I'm determined to make it work this time.

(And it needs to work from the command line only because I don't necessarily plan on installing Xorg either.)
Head_on_a_Stick wrote:
dipoc67681 wrote:Hmm... how have I strayed from the instructions on https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK?
You stopped reading too soon. Read the bit after wpa_supplicant is run directly, it shows what to add to the interfaces file. At no point does the wiki suggest to run systemctl.
Here, from https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK, is where I'm pulling those systemctl commands:
Quick connect to the configured network (doesn't require ifupdown):

sudo systemctl reenable wpa_supplicant.service
sudo systemctl restart wpa_supplicant.service
sudo systemctl restart dhcpcd.service
sudo wpa_supplicant -B -Dwext -i <interface> -c/etc/wpa_supplicant.conf

Now you should have connected to the internet.
I'm wondering if the document might be dated? Is dhcpcd deprecated?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: wpa_supplicant

#9 Post by Head_on_a_Stick »

dipoc67681 wrote:I'm not sure how to flush the buffers. Can you describe how I do that?
With the sync command (as I already posted). Both OSX and OpenBSD have that.
dipoc67681 wrote:Here, from https://wiki.debian.org/WiFi/HowToUse#W ... d_WPA2-PSK, is where I'm pulling those systemctl commands
Hmm, yes sorry, I'm a bit distracted here.

Read the bit after that where it tells you to edit the interfaces file. And make sure all wpa_supplicant processes are stopped before running the ifup command.

And I'm positive that netinstall images include a tasksel section that ask for a desktop, here is a scrot of the 10.2 image at that stage:

Image
deadbang

Post Reply