RK !

Let's make comprehension easy ...

100%x200

Raspi - Installation & remote access setup

Author: Romaan, Last Updated: Oct. 12, 2015, 6:36 p.m.

Looking for installing Raspberry Pi without a keyboard and monitor? If yes, the below blog can help. Let us to run through the steps required for installing OS on Raspberry Pi and then prepare for remote access. Before we begin, I assume we have the following ready: Raspberry Pi board, a laptop or computer with Linux or Windows, a LAN wire and a router.

Installation

First, let us download the Raspbian Operating System image from https://www.raspberrypi.org/downloads/. There are various OS that can be installed on Raspberry Pi. I downloaded the wheezy zip image to my linux machine.

Then inorder to install the downloaded image, unzip the image with the below command:

unzip 2015-05-05-raspbian-wheezy.zip

Put the micro SD card into the card reader of your laptop or system, and ensure you can see it. It will be usually /dev/mmcblk0 when we execute the below command:

sudo fdisk -l

Ensure the micro card has no partitions on it. If present then format the card using the below command

sudo fdisk /dev/mmcblk0   # Press m for help, #d for deleting existing partition, w to save changes

Finally unmount the partition and copy the unzipped image to Raspberry Pi using dd command as below:

dd if=./path/to/unzipped/image.img of=/dev/mmcblk0 bs=1M

This takes a few minutes, once done, take the micro card out of system and plug it into the raspberry pi. 

Next step will be to connect the LAN wire to the router, plug in the micro card to Raspi and power on the raspi. At this point the Raspi boots up, but you need to know the IP address of your Raspi which can be obtained by looking at your Router interface or using NMAP tool from your linux

sudo apt-get install nmap

nmap <network-range> # Example: nmap 192.168.1.1-255

Once you know the IP address, ssh into it with the following credentials:

Username: pi

Password: raspberry

Then run "sudo raspi-config" to configure timezone, expand filesystem and change the password.

Wifi

Connect the Wifi dongle to Raspberry Pi and then login to Raspberry pi.

Update the file: '/etc/wpa_supplicant/wpa_supplicant.conf' with the below contents.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="<network_name>"
        psk="<password>"
}

Ensure the below lines are present in file: '/etc/network/interfaces':

auto wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Reboot the machine:

sudo reboot

Assign Static IP Address

Edit the file '/etc/network/interfaces' and replace the line:

iface wlan0 inet manual

with

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 192.168.2.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

Restart the networking services with the below command:

sudo /etc/init.d/networking restart

We will now be able to ssh into raspberry pi at 192.168.2.100, if SSH service is enabled during raspi-config

Popular Tags:


Related Articles:


Comments: