Connect raspberry pi 4 with ubuntu server to wifi

Ajouve

I have a Raspberry Pi 4.

As I do not have a screen and keyboard available, I connect it through an Ethernet cable.

I want the Raspberry Pi to be connected to the Wi-Fi and not via Ethernet.

I tried to update /etc/network/interfaces to:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-essid MYESSID12345
wpa-psk MYPASSWORD$1234567

Then I am running:

sudo dhclient wlan0

But it does not seem to work.

ifconfig returns:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.41  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::dea6:32ff:fe62:c4fc  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:62:c4:fc  txqueuelen 1000  (Ethernet)
        RX packets 118  bytes 13529 (13.5 KB)
        RX errors 0  dropped 52  overruns 0  frame 0
        TX packets 63  bytes 9012 (9.0 KB)
        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 168  bytes 12300 (12.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 168  bytes 12300 (12.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether dc:a6:32:62:c4:fd  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 also tried to do it through:

iwconfig wlan0 essid name key password

Or:

iwconfig wlan0 essid name key s:password

But I have an invalid argument error because my password is 8 characters.

Error for wireless request "Set Encode" (8B2A) :
    SET failed on device wlan0 ; Invalid argument.

I also tried iwconfig wlan0 essid name using wps but it does not work.

I also tried with wpasupplicant.

Creating /etc/wpa_supplicant.conf with

network={
    ssid="ssid_name"
    psk="password"
}

and then running sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D wext

But I have errors too.

Successfully initialized wpa_supplicant
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Ajouve

It works updating /etc/netplan/50-cloud-init.yaml

Adding those lines to network

wifis:
    wlan0:
        optional: true
        access-points:
            "SSID-NAME":
                password: "WIFI-PASSORD"
        dhcp4: true

Then

$ sudo netplan --debug try
$ sudo netplan --debug generate
$ sudo netplan --debug apply

and finally reboot

$ sudo reboot

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Manage Wifi connections on Raspberry PI

From Dev

Connect to wifi using Python on Raspberry Pi

From Dev

Connect to rails server remotely from raspberry pi

From Dev

Ubuntu Server ARM or Ubuntu Server Raspberry Pi?

From Dev

Ubuntu Server with Raspberry Pi Motion Camera

From Dev

Ubuntu Server 16.04: connect to wifi network (usb wifi adapter)

From Dev

How to connect wifi network from raspberry pi 2 (snappy)

From Dev

Problem with wireless networking for ubuntu server on a Raspberry pi 4

From Dev

How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

From Dev

How to connect wifi network from raspberry pi 2 (snappy)

From Dev

Different iw list for the same USB Wifi device on Raspberry pi and ubuntu

From Dev

Ubuntu Server with Raspberry Pi Motion Camera

From Dev

Game server on a Raspberry Pi

From Dev

How to set up WiFi on Ubuntu 19.10 Server running on Raspberry Pi 4?

From Dev

Raspberry Pi WiFi Repeater Issues

From Dev

Let Raspberry Pi connect to internet through Ubuntu in virtual machine

From Dev

How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

From Dev

Setup ubuntu server on Raspberry Pi 4 without keyboard

From Dev

how to connect to WPA2 enterprise WiFi in Ubuntu Core Raspberry Pi 3

From Dev

Testing bcache with raspberry pi 4 on ubuntu

From Dev

Ubuntu Server cannot connect to wifi

From Dev

Can you install Ubuntu on the Raspberry Pi 4

From Dev

Raspberry Pi Server

From Dev

wlan0 does not appear in Ubuntu server and raspberry pi 4

From Dev

Unable to enumerate USB device on Ubuntu server 19.10 arm64 at Raspberry Pi 4B

From Dev

Connect to Raspberry Pi 4 with Ubuntu Core 18 via serial cable

From Dev

Can't connect with SSH to Ubuntu server (20.04) on raspberry pi 4

From Dev

KVM Bridge on Ubuntu 20.04 on Raspberry Pi 4

From Dev

Redistribute modified Ubuntu Server for Raspberry Pi

Related Related

  1. 1

    Manage Wifi connections on Raspberry PI

  2. 2

    Connect to wifi using Python on Raspberry Pi

  3. 3

    Connect to rails server remotely from raspberry pi

  4. 4

    Ubuntu Server ARM or Ubuntu Server Raspberry Pi?

  5. 5

    Ubuntu Server with Raspberry Pi Motion Camera

  6. 6

    Ubuntu Server 16.04: connect to wifi network (usb wifi adapter)

  7. 7

    How to connect wifi network from raspberry pi 2 (snappy)

  8. 8

    Problem with wireless networking for ubuntu server on a Raspberry pi 4

  9. 9

    How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

  10. 10

    How to connect wifi network from raspberry pi 2 (snappy)

  11. 11

    Different iw list for the same USB Wifi device on Raspberry pi and ubuntu

  12. 12

    Ubuntu Server with Raspberry Pi Motion Camera

  13. 13

    Game server on a Raspberry Pi

  14. 14

    How to set up WiFi on Ubuntu 19.10 Server running on Raspberry Pi 4?

  15. 15

    Raspberry Pi WiFi Repeater Issues

  16. 16

    Let Raspberry Pi connect to internet through Ubuntu in virtual machine

  17. 17

    How to setup of Raspberry Pi 3 onboard WiFi for Ubuntu Server with 'netplan'?

  18. 18

    Setup ubuntu server on Raspberry Pi 4 without keyboard

  19. 19

    how to connect to WPA2 enterprise WiFi in Ubuntu Core Raspberry Pi 3

  20. 20

    Testing bcache with raspberry pi 4 on ubuntu

  21. 21

    Ubuntu Server cannot connect to wifi

  22. 22

    Can you install Ubuntu on the Raspberry Pi 4

  23. 23

    Raspberry Pi Server

  24. 24

    wlan0 does not appear in Ubuntu server and raspberry pi 4

  25. 25

    Unable to enumerate USB device on Ubuntu server 19.10 arm64 at Raspberry Pi 4B

  26. 26

    Connect to Raspberry Pi 4 with Ubuntu Core 18 via serial cable

  27. 27

    Can't connect with SSH to Ubuntu server (20.04) on raspberry pi 4

  28. 28

    KVM Bridge on Ubuntu 20.04 on Raspberry Pi 4

  29. 29

    Redistribute modified Ubuntu Server for Raspberry Pi

HotTag

Archive