Getting Started with Raspberry Pi

What I have?

  • Raspberry Pi 2 Model B Rev 1.1
  • TP-Link Wireless Adaptor (TL-WN725N)
  • Monitor (HDMI)
  • Logitech Keyboard and Mouse (Wireless)
  • 32GB Class 10 SDCard

Preparing the 32gb SDCard (Class 10) & Installing Rasbian

Formating the SD card, Extracted the ‘Noobs‘ files from https://www.raspberrypi.org/downloads/noobs/ to the root of SDCard.

Unplug TP-Link Wi-Fi Adaptor, Plug the SDCard to raspberry and switch on the pi. Install and expand OS. Once the installation finish check the os version

uname -a

Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux

hostname : raspberrypi
kernal : 4.19.75-v7
build : 1270

Oops: TP-link Wi-Fi not detecting

$ lsusb #before pluging USB Wi-Fi
  Bus 001 Device 005: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
  Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
  Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
  Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ lsusb #after pluging USB Wi-Fi
  Bus 001 Device 006: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
  Bus 001 Device 005: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
  Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
  Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
  Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Luckily I got some guidance from

$ sudo rpi-update
$ sudo apt-get install rpi-update # // if 'rpi-update' command is not found
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot
$ uname -a 

Linux raspberrypi 4.19.88-v7+ #1284 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux

hostname : raspberrypi
kernal : 4.19.88-v7
build : 1284

Use command uname -a to find the kernel version and build for the kernel you are using and the wifi driver filename is now formed using those values like 8188eu-kernel-build.tar.gz. Drivers for kernel versions 3.18, 4.0, 4.1, 4.4, 4.8/9, 4.14 and 4.19 are available using this new filename format.

For example, for the Pi 2 B or 3 B, if uname -a shows Linux raspberrypi 4.19.88-v7+ #1284 SMP Sat Apr 30 12:16:50 BST 2016 armv7l GNU/Linux the file to download is 8188eu-4.19.88-v7-1284.tar.gz.

$ cd Desktop/
$ mkdir 8188eu-4.19.88-v7-1284
$ cd 8188eu-4.19.88-v7-1284/
$ wget http://downloads.fars-robotics.net/wifi-drivers/8188eu-drivers/8188eu-4.19.88-v7-1284.tar.gz
$ tar xzf 8188eu-4.19.88-v7-1284.tar.gz
$ ./install.sh

How to change to Static IP

$ ip r     # // Find default gateway IP in Linux
  default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.108 metric 303 
  192.168.1.0/24 dev wlan0 proto dhcp scope link src 192.168.1.108 metric 303 
$ route -n # // Find gateway 
  Kernel IP routing table
  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  0.0.0.0         192.168.1.1     0.0.0.0         UG    303    0        0 wlan0
  192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlan0
$ netstat -r -n
  Kernel IP routing table
  Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
  0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
  192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
$ sudo nano /etc/dhcpcd.conf

append below towards end of file

interface wlan0
static ip_address=192.168.1.101/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.0

Linux: How to Install/Remove Packages

# Install Package
sudo apt-get install <name>

# Remove Package
sudo apt-get remove <name  # un-install package.
sudo apt-get purge <name>  # remove a package and its config files.

# Search package
apt-cache search <name>

# Describe Package
apt-cache show <name>  # describe package.
apt-get showpkg <name> # show a package's dependencies.

# List Installed Packages
dpkg -l

# Update All Installed Software (it'll ask to confirm)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get distupgrade

Resources

Projects