Currently, there are several models of Raspberry Pi i.e. A/B, A+/B+, 2, 3 and zero. The differences are on their provided interfaces, RAM size, processor model, processing power, AV jack, etc. Pi 3 uses Broadcom BCM2837 SoC with 64-bit support. Unlike earlier models, Pi 3 has built in wireless support, including 2.4GHz Wi-Fi and bluetooth. There is a Display Serial Interface (DSI) port near GPIO port. There is also Camera Serial Interface (CSI) near HDMI port which provides a high-speed connection to the Raspberry Pi Camera Module. The Pi 3 can draw up up to 1.2A so we need power adapter that can provide 2A of current.
Warning: When handling the Pi, always avoid touching GPIO pins, and never connect anything to them while Pi is switched on. GPIO port is powerful but fragile.
If you think this article is usefull, please share it with your colleagues.
Warning: When handling the Pi, always avoid touching GPIO pins, and never connect anything to them while Pi is switched on. GPIO port is powerful but fragile.
Software
Raspberry Pi Fondation supplies a software tool known as NOOBS (New Out-Of Box Software) which helps user to install standard operating system for Raspberry Pi like Raspbian and others. We can download it from https://www.raspberrypi.org/downloads/. There are two types of installation methods.- NOOBS. It is installation software. We can download it then extract and copy it to SD card. For the first time use of Raspberry Pi, you need to follow instalation steps provided by this software.
- Raspbian. It is operating system image. We can export this image to SD card using any image extractor software like win32diskimager in Windows or dd in Linux.
# list existing disk $ diskutil list # unmount SD card if it is mounted by default $ diskutil unmountdisk /dev/diskX # write image to disk $ sudo dd if=imageflename.img of=/dev/sdX bs=2M
# list all disks $ sudo fdisk -l # create directory as mounting location $ sudo mkdir /media/externaldrive1 $ sudo chgrp -R users /media/externaldrive1 $ sudo chmod -R g+w /media/externaldrive1 # mount the drive to new directory $ sudo mount /dev/sdXN /media/externaldrive -o=rwRaspbian is based on Debian. The default directories in Raspbian distribution are as follows.
- boot - contains Linux kernel and other packages to start the Pi
- bin - stores OS-related binary files i.e. GUI files
- dev - a virtual directory. All devices connected to the system can be found here.
- etc - miscellaneous configuration files
- home - stores users files
- lib - locates bits of code required by numerous applications
- lost+found - stores file fragments if the system crashes
- media - locates removable storage devices
- mnt - used to manually mount storage devices e.g. external HDD
- opt - stores optional software that is not part of OS
- proc - a virtual directory contains information about running programs (processes)
- run - used by various daemons (processes which run in the background)
- root - root user directory
- sbin - stores special binary files primarily used by superuser account
- srv - stores data served by OS but empty in Raspbian
- sys - a virtual directory storing system information used by Linux kernel
- tmp - temporary files storing
- usr - storage for user-accessible programs
- var - used by programs to store changing values or variables
raspi-config
command. We can configure hostname, enable SSH, change boot setting, and many others.Networking
In networking, by default the Pi will query DHCP server on the network for dynamic configuration information. We can also change its configuration to static in/etc/dhcpcd.conf
. We can set static configuration for all available interfaces such as eth0
, wlan0
, etc. After the changes are applied, we need to restart the networking service: $ service networking restart
. For wireless networking, we can run this following command to scan available connection.$ sudo iwlist scan | lessThe status of the established wireless connection can be showed by
iwconfig
command. There are several modes of the wireless adapter i.e. managed (standard wireless network), ad-hoc (device-to-device), monitor (the card listens for all traffics), repeater, and secondary (backup repeater). The Pi wireless network configuration is handled by wpasupplicant
tool. Using this tool, we can connect our Pi to any wireless network, WPA, WPA2, or WEP, in any mode, AES or TKIP. This tool configuration is located in /etc/wpa_supplicant/wpa_supplicant.conf
. All accessed network records are stored here. If the Pi is in WPA/WPA2 encrypted connection, we will see configuration likes the following.network={ ssid="<my-ap-name>" psk="<my-ap-password>" key_mgmt=WPA-PSK }If it uses unsecured connection without password, there will be only
ssid
and key_mgmt=NONE
fields. If it uses WEP secured connection, the configuration should be key_mgmt=NONE
and wep_key0="<your-WEP-key>"
. To enable the changes, we can restart the Pi or run this command: $ sudo ifup wlan0
.If you think this article is usefull, please share it with your colleagues.
Comments
Post a Comment