In this How to set up WiFi on your Raspberry Pi without a keyboard or monitor (or ethernet). Raspberry model A + does not have the Ethernet LAN support to connect to the LAN network but can support the WiFi connectivity. So here we will be able to connect our Raspberry Pi directly to wifi network on power on without the need to connect to any Desktop monitor.
- Raspberry Pi Single board computer ( I chose Raspberry pi model 3 A+)
- A micro SD card with Raspbian Operating system installed
- A high-quality 5V/2.5A micro USB power supply
- PC computer to access Raspberry Pi using SSH terminal
- Xshell software for SSH remote access.
Setup your SD card:
Make sure SD card is installed with Raspbian, if not go install using mentioned below link.
Once SD card is installed with the Raspbian operating system you will be able to access the files inside the SD card from the PC computer.
Setup the Wifi configuration:
1. Insert the SD card adapter (with SD card) into your computer to connect the SD card.
2. Navigate to boot directory: E:\ (this can be different for different PC computer)
You will have to locate the SD card directory and got to E:\boot\ path.
3. Enable SSH:
By default current version of Raspbian has SSH disabled. to enable the ssh service we need to create the SSH file into the boot directory.
Create the empty file into boot directory called ssh
By default current version of Raspbian has SSH disabled. to enable the ssh service we need to create the SSH file into the boot directory.
Create the empty file into boot directory called ssh
3. Create the file wpa_supplicant.conf file in boot directory with following details.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=IN
network={
ssid="D203"
psk="*************"
key_mgmt=WPA-PSK
}
Raspbian will move this file to /etc/wpa_supplicant/ when the system is booted to enable the wifi configuration on startup of Pi.
connect to the Wifi network:
Next step is to connect SD card to Raspberry Pi and power up the raspberry pi.
Once the raspberry Pi boot up it will automatically try to connect to configured wifi network.
Once Raspberry Pi is connected to wifi network it will get the IP address from the connected network. This is 32 bit network address (exa. 192.168.0.1 represent in numeric format)used to connect Raspberry pi to computer network and internet world. If we have IP address of the raspberry pi we can assess it using the SSH terminal which we have already enabled as part of the boot up process.
To get ip address of raspberry pi there are various ways using the tools like nmap and wireshark. I will show simple mechanism to identify the IP address of the Raspberry Pi in the connected wifi network.
Along with IP address raspberry Pi have fix MAC address (hardware address which is assigned by manufacture) which is 48 bit address represent in hexadecimal representation example b8-27-eb-98-36-11.
prefix b8-27-eb is always associated with raspberry pi since it is the assign by the raspberry pi foundation for there raspberry pi devices. Once it is connected to network it will associated with IP address so that we can identify each indiusual devices in the netowork. This binding of MAC adress and IP address can be found using the arp utility.
Open the command prompt using RUN application:
Once you able to open the command prompt you will be able to see the network devices of computer with following command line tool.
To find the IP address of your device in network:
Command: ipconfig
Above 192.168.0.102 is the IP address of my desktop computer which is connected to same WiFi network where Raspberry Pi is also computer. So this mean this desktop computer can be reachable to raspberry pi using the remote ip connection. We can able to find the ip address of the Rasperry pi using ARP (Address Resolution Protocol) which is protocol used to check the network connectivity between devices in network.
To find the IP address and MAC address of the connected remote device:
command: arp -a
Since b8-27-eb-98-36-11 is associated with 192.168.0.105 ip we can make sure the this IP address is belong to Rasperry Pi.
Once we get the address we can connect the Raspberry Pi using the SSH service which run on the port 22 for remote communication. Download the Xshell software and install in the desktop computer in network from where you wanted to access the raspberry pi.
Download Xshell
Open the SSH terminal and try connecting raspberry pi [192.168.0.105:22]
command: ssh pi@192.168.0.105
this will prompt to provide the raspberry pi password for authentication purpose.
Once the login is successful you will be able to access the raspberry pi using remotely.
Done.
This is how we can access raspberry Pi without using remote desktop computer.
Next Blog: If you wanted to access the desktop version of the rasperry pi you can access using the another software tool call VNC (Virtual Network computing) which provide the remote access using Graphical User Interface.
Please find the below below below blog on how to access Raspberry Pi using VNC server.
No comments:
Post a Comment