-1

I was trying to connect to wifi from my RPI3 running Ubuntu 22 server.

This is my conf file

/etc/wpa_supplicant/wpa_supplicant.conf

Ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL

network={
scan_ssid=1
ssid="JioFiber-Uc9FK"
psk="HPASSWORDp"
key_mgmt=WPA-PSK
}

Here is the truncated output of network scan.

sudo iwlist wlan0 scan

Output

Cell 03 - Address: 48:55:5E:72:97:82
                    Channel:2
                    Frequency:2.417 GHz (Channel 2)
                    Quality=60/70  Signal level=-50 dBm
                    Encryption key:on
                    ESSID:"JioFiber-Uc9FK"
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 76ms ago
                    IE: Unknown: 000E4A696F46696265722D556339464B
                    IE: Unknown: 01088C129824B048606C
                    IE: Unknown: 030102
                    IE: Unknown: 2D1AAC0117FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1602000400000000000000000000000000000000000000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK

Here is the output of ifconfig

hpoddar@raspberrypi:~$ ifconfig

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:52:e0:24  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

I did restart wpa_supplicant but I am still not connected to the wifi.

sudo systemctl restart wpa_supplicant

Output of sudo raspi-config

enter image description here

0

1 Answer 1

0

The following answer and the blog helped me in solving my issue.

  1. failed-to-start-netplan-wpa-wlan0-sevice-unit-netplan-wpa-wlan0-service-not-found
  2. ubuntu-22-04-connect-to-wifi-from-command-line

I'll add the same here as well.

  1. First step is to open a command line terminal and identify the name of your wireless network interface. To do so execute:
$ ls /sys/class/net
eth0  lo  wlan0
  1. Next, navigate to the /etc/netplan directory and locate the appropriate Netplan configuration files. The configuration file might have a name such as 01-network-manager-all.yaml or 50-cloud-init.yaml.

$ ls /etc/netplan/
50-cloud-init.yaml

  1. Edit the Netplan configuration file with nano or your favorite text editor. You will have to open the file with root permissions.
$ sudo nano /etc/netplan/50-cloud-init.yaml
  1. Copy and paste the following configuration stanza while replacing the SSID-NAME-HERE and PASSWORD-HERE text with your SSID network name and password:
wifis:
        wlan0:
            optional: true
            access-points:
                "SSID-NAME-HERE":
                    password: "PASSWORD-HERE"
            dhcp4: true
  1. Make sure that the wifis block is aligned with the above ethernets or version block if present. The entire configuration file may look similar to the one in my case:
GNU nano 6.2                                                                              /etc/netplan/50-cloud-init.yaml                                                                                        # This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        eth0:
            dhcp4: true
            optional: true
    version: 2
    wifis:
        wlan0:
            optional: true
            access-points:
                "JioFiber-Uc9FK":
                    password: "HbHRnE5Kymm2fDRp"
            dhcp4: true
  1. Once ready, apply the changes and connect to your wireless interface by executing the bellow command:
$ sudo netplan apply
  1. Alternatively, if you run into some issues execute:
$ sudo netplan --debug apply
  1. If all went well you would be able to see your wireless adapter connected to the wireless network by executing the ip command:
ip a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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