Connecting Raspberry Pi to a Wireless LAN

Second part in my series of posts about my current Raspberry Pi Project

Photo by Gavin Allanwood on Unsplash

Now that you are connected to your Pi using USB Hot-spot, you can do all sorts of things without relying on setting up a dedicated desk including monitor and other accessories.

But using your phone to access Pi and work on it is still not that interactive. Typing in your phone is not a preferable task when it comes to programming.

Let’s setup your Pi to your Wireless LAN so that you can easily do ssh from your already owned Laptop/PC, so that your experience will be hassle-free.

For that you have to connect to your Pi using USB Hot-spot for one last time. Bear it with me —

  1. You need to install wpa_supplicant software.
    sudo apt install wpasupplicant
  2. Now find your wireless interface with
    iwconfig
    You should be able to see something likewlan0
  3. Turn on the interface using
    sudo inconfig wlan0 up
  4. Scan for available SSIDs
    sudo iwlist wlan0 scan | grep ESSID
    This should print available WLAN to connect to in your network.
  5. Check the desired WLAN you want to connect and type in this command
    wpa_passphrase <SSID> <password> | sudo tee /etc/wpa_supplicant.conf
  6. sudo wpa_supplicant -c /etc/wpa_supplicant.conf -c wlan0 -B
    This will connect your Pi to the WLAN.
  7. To check if it’s connected to WLAN and get the IP use ifconfig
  8. But if you restart the Pi then you would need to type in the command in step 6. For that type in this command in rc.local
    sudo nano /etc/rc.local
    Add the command at the end. Save and exit. Restart Pi to check the setup.
  9. Now all you need is to open up your laptop.
    Ubuntu — ssh pi@<IP> and type in password
    Windows — Use Putty software to connect via ssh

Next up, we will install a SMTP server in Pi.
Stay tuned!

--

--

--

Hacking the Physical World | Senior Embedded Systems Engineer @ PiRhoAlpha Research (ActiveBuildings) | I write posts about AVR and Raspberry Pi.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Build a RESTful API with Golang — Part 1

System Design Interviews: Theoretical vs Experience

Finally coming to terms with the Python

JAVA vs KOTLIN : Which is a Better Choice for Android App Development?

No-Code Development in Wappler — Meet the New Flow

Handling live tweets from twitter in Kafka and Node

credentials in keys and tokens section of you app.

How to set a Slack status from other apps

Disabling camera on Linux

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshul Goyal

Akshul Goyal

Hacking the Physical World | Senior Embedded Systems Engineer @ PiRhoAlpha Research (ActiveBuildings) | I write posts about AVR and Raspberry Pi.

More from Medium

OpenVPN Community + 2FA with Google Authenticator

picam — Using raspberry pi camera module as home cctv

Let’s install qBittorrent on Docker

Linux distribution: deepin 20.6 version planning