Buy Me a Coffee

Buy Me a Coffee!

Sunday, September 27, 2020

Installing Ubuntu Server on an Intel® Compute Stick STK1AW32SC and making wireless work

TL/DR: To enable the WiFi adapter for STK1AW32SC on Ubuntu 20.04 LTS:
  1. sudo apt install wireless-tools
  2. sudo apt install wpasupplicant
  3. sudo ip link set wlp1s0 up
  4. sudo -
  5. wpa_passphrase Fios-F2MZ0 >> /etc/wpa_supplicant.config
    typeinyourpassphrasehere
  6. exit
  7. sudo wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
  8. sudo dhclient wlp1s0

I decided this weekend would be a good chance to break out my Intel® Compute Stick STK1AW32SC and get a modern Ubuntu on it. I had previously installed Ubuntu 18.04 on it for fun and figured that 20.04.1 LTS would be similar.  I downloaded ubuntu-20.04.1-live-server-amd64.iso from https://releases.ubuntu.com/focal/ and used Rufus to build a bootable USB stick.  I then just plugged the USB stick into one port and a keyboard into the other and got to work.  On the initial boot screen I pressed F10 to control the boot options, I choose to use the USB and started the installation.  I ran into my first problem part way through the installation.  The installer wasn't picking up the WiFi.  I then unplugged my keyboard and plugged in a USB Ethernet adapter I had lying around and then...wait.  Unplugged the keyboard.  Dang!  Ok, I found a USB Hub, plugged the USB Ethernet adapter and the keyboard into it and plugged it into the computer and finished the installation.  
Now, I want to use the WiFi but to do that I need to install the wireless-tools with:
    sudo apt install wireless-tools
Now I just need to connect to my network.  The initial round of tutorials I Binged all were based on ifconfig which wasn't installed.  I found out that it was deprecated way back in 2012, so I guess it is time to learn how to use ipConnect to WiFi network from command line in Linux is a good article that covers all the steps with the why and how and such.  For me, I ran an >ip a to get my interface name: 

lsmithmier@stick:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
3: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 60:f6:77:e4:63:76 brd ff:ff:ff:ff:ff:ff
4: enx9cebe8aee3cd: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 9c:eb:e8:ae:e3:cd brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.208/24 brd 192.168.1.255 scope global dynamic enx9cebe8aee3cd
       valid_lft 82430sec preferred_lft 82430sec
    inet6 fe80::9eeb:e8ff:feae:e3cd/64 scope link
       valid_lft forever preferred_lft forever

and then brought the interface up with >sudo ip link set wlp1s0 up and confirmed that it was up with >sudo ip link show wlp1s0 :

lsmithmier@stick:~$ sudo ip link set wlp1s0 up
lsmithmier@stick:~$ sudo ip link show wlp1s0
3: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 60:f6:77:e4:63:76 brd ff:ff:ff:ff:ff:ff

Now that we have our interface up, we need to connect to it.  That means using our passphrase which we need to set up by using wpa_passphrase which we need to install with >sudo apt install wpasupplicant and then we capture and encode our pass phrase:

root@stick:~# wpa_passphrase Fios-F2MZ0 >> /etc/wpa_supplicant.config
donotthinkiamgoingtoshowit

Now that we have that done, we can check to see that our link has been made by running >iw wlp1s0 link and confirming that we have a connection.  Alternatively we can use the command from earlier >sudo ip link show wlp1s0 

lsmithmier@stick:~$ ip link show wlp1s0
3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 60:f6:77:e4:63:76 brd ff:ff:ff:ff:ff:ff

Now that the link is made, we need to get an IP address using >sudo dhclient wlp1s0 and we are done!