Closed jcgarciaca closed 5 years ago
Try this out. 1.Check that there are no extra wpa_supplicant processes with ps -ax | grep wpa 2.Edit /etc/wpa_supplicant/wpa_supplicant.conf and add "country = xx"(your country code,US represents USA) to the top of the file.
If the country code is not set by raspi-config etc., wifi is disabled by default after rpi3b.
Hi @yashiki2005
ubuntu@ubuntu:~$ ps -ax | grep wpa
355 ? Ss 0:00 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf -C /run/wpa_supplicant
527 ? Ss 0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
790 pts/0 S+ 0:00 grep --color=auto wpa
/etc/wpa_supplicant/wpa_supplicant.conf
. I tried with my country code as well as with US, but they did not work.I noted that if I run sudo ifdown wlan0 && sudo ifup -v wlan0
then the raspberry gets a valid ip address and I can ping well, but I need to do it automatically at startup. So, I added that command to rc.local
file, but still doesn't work.
Oh, I was misunderstood. To connect automatically, Ubuntu 18.04 or later uses netplan to generate a configuration file. Make sure /etc/netplan/ is empty (delete or move if there is a file), for example when using DHCP create /etc/netplan/raspberrypi-config.yaml with the following contents. Warning: Indentation is important for this file. If you make a mistake, you will get an error.
network:
version: 2
wifis:
wlan0:
dhcp4: true
dhcp6: true
access-points:
“Your AP name”:
password: “Your AP WPA password”
And "sudo netplan apply" netplan apply suceed, wifi will automatically connect after the next startup.
@yashiki2005 Thank you for your help!! I can automatically connect now.
Hi, I am using Release V6 and it works well. However, raspberry does not connect to wifi properly.
I added lines below to
/etc/network/interfaces
:And
/etc/wpa_supplicant/wpa_supplicant.conf
is defined as follow:But after reboot the device does not connect to wifi.
I also tried with doing:
After commands above, the raspberry receives an ip address but
ping
from/to other devices in same network does not get response. Withifconfig
I get the address forwlan0
but it says<UP BROADCAST MULTICAST>
.RUNNING
does not appear forwlan0
.Am I missing anything else? Thank you.