1

I follow this tutorial to setup WiFi on my Pi. But it doesn't work. Can someone help?

Here are some debug outputs.

os: Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux


journalctl | grep wlan0
Apr 25 15:36:11 raspberrypi dhcpcd[362]: wlan0: starting wpa_supplicant
Apr 25 15:36:11 raspberrypi dhcpcd-run-hooks[404]: wlan0: starting wpa_supplicant
Apr 25 15:36:11 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Apr 25 15:36:12 raspberrypi dhcpcd[362]: wlan0: waiting for carrier
Apr 25 15:36:12 raspberrypi dhcpcd[362]: wlan0: carrier acquired
Apr 25 15:36:12 raspberrypi dhcpcd[362]: wlan0: IAID eb:49:49:eb
Apr 25 15:36:12 raspberrypi dhcpcd[362]: wlan0: adding address fe80::676a:712f:8132:7eca
Apr 25 15:36:12 raspberrypi dhcpcd[362]: wlan0: carrier lost
Apr 25 15:36:12 raspberrypi dhcpcd[362]: wlan0: deleting address fe80::676a:712f:8132:7eca

ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.107  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::4354:a1df:b8d:9509  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:1c:1c:be  txqueuelen 1000  (Ethernet)
        RX packets 8684  bytes 12555005 (11.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4660  bytes 338811 (330.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 352 (352.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 352 (352.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:49:49:eb  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=SI

network={
        ssid="MYWIFI"
        psk="*********"
}

sudo iwconfig
enxb827eb1c1cbe  no wireless extensions.

wlan0     IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

lo        no wireless extensions.

Update

Today I create mobile hotspot and pi could connect. So it must be router issue. Anyone know what could be wrong on router side.

pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.102  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::6c7b:1dd0:3a7b:ca3e  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:1c:1c:be  txqueuelen 1000  (Ethernet)
        RX packets 46  bytes 7411 (7.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 73  bytes 10639 (10.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.30  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::424:428e:6818:96c  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:49:49:eb  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 1073 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 34  bytes 5827 (5.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Update 2

I tried Raspbian Stretch with desktop and recommended software version. Then I installed XRDP server and connected via RDP. After I connected to WiFi through GUI my Pi can automatically connect to Wifi. What can be a problem that I couldn't connect before? Thanks for help.

  • Are you using Raspbian Stretch with Desktop? – CoderMike Apr 25 at 16:34
  • @CoderMike No. Stretch Lite. – usil Apr 25 at 21:13
1

I found the issue. The following line was missing in wpa_supplicant.conf.

key_mgmt=WPA-PSK

The whole file must looks like this.

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

network={
        ssid="MYWIFI"
        psk="*********"
        key_mgmt=WPA-PSK
}
0

Just for testing your network environment please flash a new image Raspbian Stretch Lite 2019-04-08 and boot it in your RasPi. Then create your wpa_supplicant.conf in the /boot/ directory, not in /etc/wpa_supplicant/. It should look like this:

rpi ~$ cat /boot/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=SI

network={
        ssid="MYWIFI"
        psk="*********"
}

Now reboot.

If you do not have a working wifi connection to MYWIFI after reboot then it is not a general problem with the setup. Either you have made a typo or the RasPi is broken or you have used a wrong password or your internet router is misconfigured or something like this. Don't modify the setup on the RasPi. It should work without typos.

  • I did fresh install, but it doesn't work. Maybe it is router problem. But no device currently no device has problem with WiFi connection. – usil Apr 25 at 21:49
  • @usil On the other side hundreds of users don't have a problem with the setup described in the answer. – Ingo Apr 25 at 22:24
  • I updated question. – usil Apr 26 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.