Accessing RPi Using LAN Cable :
Edit your boot/cmdline.txt
file by plugging the memory card into the computer and then editing this file in the boot folder and add ip=192.168.0.200
this line to give it a static IP.
Change the IP of lan adapter in your computer to something like 192.168.0.10 (So that both are on the same network)
After this you can use this ip 192.168.0.200
to ssh to Raspberry Pi using Putty.
Using WiFi to connect to RPi
- SSH to RPi.
- Now follow the following steps :
Edit interfaces file
sudo nano /etc/network/interfaces
Make ‘auto io’ to ‘auto wlan0’. This command makes RPi automatically try to connect to wifi.
Add the following lines or edit if they do not exist:
allowhotplug
wlan0
iface wlan0 inet dhcp
wpaconf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Now edit the **wpa_supplicant** file.
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following lines:
network={
ssid="YOUR_NETWORK_NAME"
psk="YOUR_NETWORK_PASSWORD"
}
Restart the wlan0 interface
use command: sudo ifdown wlan0; sudo ifup wlan0;
After RPi is connected to the network you can use IP scanner to scan for the IP of RPi to ssh to it.