Setting up WiFi using command Line

The given steps are for to set up Wi-Fi for the first time using command line /terminal.

You can use this step in both ways headless or with head. Note also that no additional software is required; everything you need is already included on Odinub.

WiFi network details:

To scan for WiFi networks, use the command  sudo iwlist wlan0 scan . This will list all available WiFi networks, along with other useful information. Look out for:

  1. 'ESSID: "Odinub"' is the name of the WiFi network.
  2. 'IE: IEEE 802.11i/WPA2 Version 1' is the authentication used. In this case, it's WPA2, the newer and more secure wireless standard which replaces WPA. 

Adding the network details to Odinub:

Open the interfaces  file in nano:

cd ..

sudo nano /etc/network/interfaces

Go to the bottom of the file and add the following:

Auto wlan0

Iface wlan0 inet dhcp

                 Wpa-ssid Odinub(your ESSID name)

                 Wpa-psk 1234(your password)

Now save the file by pressing  Ctrl+X , then  Y , then finally press  Enter 

Now fire this command to turn on on-chip Wi-Fi

ifup wlan0

You can verify whether it has successfully connected using  ifconfig wlan0 .

ifconfig wlan0

If the inet addr field has an address beside it, the Odinub has connected to the network. If not, check that your password and ESSID are correct.

Also, you can check using  ping 

If you don't want to turn up WiFi by command every time then we can also make a file which will have command to turn up WiFi and it will automatically get execute right after booting of OS.

To do the same we have to write python script which will have command to turn up WiFi from following command.

sudo nano /home/debian/

 After execution above command you will get a new window in that write following lines.

import os, sys

os.system("ifup wlan0")

After write the file press Ctrl+X and then press Y.

After follow all steps just reboot your odinub by following command.

0 Commenting Overall Comment