Raspberry pi 2 installation dimensions. Single board computers on Linux, first acquaintance with Raspberry Pi


A full-fledged computer the size of a credit card. The controller can display images on the display, work with USB devices and Bluetooth, take photos and videos with a camera, play sounds through speakers and access the Internet. Let's look at getting started with Raspberry Pi single board computers.

Raspberry Pi platforms

Video review

Installation and configuration

Turning on the computer

Something went wrong

If a colored square appears when your Raspberry Pi boots, your version of the operating system is outdated. To solve the problem update OS on SD card.

Updating packages

For stable and correct operation of the Raspbian OS, update the versions of software packages.


The Raspbian operating system now has the latest software packages installed.

I²C interface

The I²C bus is the simplest way to exchange information. Each device connected to the I²C line has its own address by which the Raspberry Pi accesses it.

The interface lines have a built-in pull-up to the power supply with resistors. Accordingly, they cannot be used as general I/O ports in cases requiring the pull-up to be disabled.

Bus activation

Default bus I²C


In response, you should see a canvas of files, including: i2c-1.
Now you can use the interface I²C

I²C scanner

A list with the addresses of devices connected to the I²C line can be obtained by the i2cdetect program from the i2c-tools package:

    Install the i2c-tools package: sudo apt-get install i2c-tools

    Search for devices on the bus: sudo i2cdetect -y 1

SPI interface

SPI is a serial four-wire data interface designed to provide simple and inexpensive high-speed interfacing of microcontrollers and peripherals.

Raspberry Pi has one SPI bus - SPI0. But newer versions of the single-board, for example, have two buses: SPI0 And SPI1

SPI0 bus enable

Default bus SPI0 disabled. To enable, follow these steps:


In response, you should see a canvas of files, including two: spidev0.0 and spidev0.1.
SPI0 with the ability to connect two slave devices. Now you can use the interface SPI for communication with sensors and modules.

SPI1 bus enable

To turn on the bus SPI1, you must manually edit the system boot settings file config.txt.


In response, you should see a canvas of files, among which three are responsible for SPI1: spidev1.0, spidev1.1 and spidev1.2.

If you have the bus on SPI0, then there will be two more files: spidev0.0 and spidev0.1 .

This means that you have it turned on SPI0 with the ability to connect two slave devices and SPI1 with the ability to connect three slave devices.

UART interface

UART (Serial) is an asynchronous data interface that serially transfers bits from a data byte. Asynchronous transmission allows data to be transferred without using a timing signal from the transmitter to the receiver. Instead, the receiver and transmitter agree in advance on timing parameters and special "start bits" that are added to each word of data to synchronize the receiver and transmitter. There are many devices with which the Raspberry Pi can communicate using the UART protocol.

The Raspberry project was founded in 2011 and was originally intended for use in education. It was assumed that this would be a small batch of low-cost computers for teaching the basics of computer science and programming. Quite unexpectedly for the creators, the project has become extremely popular, and enthusiasts are finding wide use for these single-board little ones.

The heart of this small computer is the processor architecture ARM, so most of the operating systems used on it are based on Linux. The main official OS for the Raspberry Pi is . This is a Linux distribution based on Debian and optimized for the hardware components used. The set of applications and utilities collected in this distribution is basic and is intended mainly for an introductory study of the computer's capabilities.

The project website contains various operating systems available for installation on the Raspberry Pi 2. Some of them have advanced functionality and can even handle office work, while some are highly specialized distributions assembled for specific tasks. Below is a list of the main Raspberry Pi community projects that have standard installation:

  • Ubuntu Mate;
  • Ubuntu Snappy;
  • OSMK;
  • LibreELEC;
  • RiskOS;
  • Windows 10 IoT Core.

Dimensions and specifications

Raspberry Pi is truly a single-board minicomputer with unique not only technical but also dimensional characteristics.

For Raspberry Pi version two, they look like this:

  • overall dimensions 8.56 by 5.65 centimeters;
  • ARM processor with four cores and an operating frequency of 900 megahertz;
  • Videocore 4 graphics subsystem;
  • RAM size - one gigabyte;
  • power supply via micro-USB connector;
  • SD card reader;
  • HDMI video output;
  • 3.5 mm audio jack;
  • Ethernet RJ-45, standard cable connector with data transfer speeds up to 100 Mb/s;
  • four USB version 2.0 ports.

Brief overview of the main OS available

System based on Debian OS packages. The lightweight Mate environment is used as a graphical shell. The version runs on Raspberry Pi versions 2 and 3, based on the stable release of Ubuntu 16.04. Contains a complete set of software, including a free office suite LibreOffice and browser Firefox. Supports Wi-Fi and hardware video acceleration using the program as a media player VLC.

Another OS version based on the stable branch of Ubuntu. It is a significantly reduced version of the original system. Includes the necessary development tools for the Internet of Things (IoT) and is designed, among other things, to run on the Raspberry Pi. Ideally suited for smart home projects.

Open Source Media Center

This distribution is called OSMC for short, its main purpose is to use it as a media center. A modified Kodi. It differs from the standard one in a lightweight set of libraries, which nevertheless allows you to easily deploy a media server based on Raspberry Pi. The development is based on Debian OS packages, thanks to which it has wide support for file sharing tools over network protocols.

LibreELEC

The second version of a Kodi-based distribution specialized for working with media content. Supports remote control and has high operating speed.

Risk OS

An OS developed by Acron Computers back in the last century. Subsequently, it was she who created the ARM processor architecture, on which this minicomputer is based. Supports the use of a range of development tools and has its own software base, unrelated to Debian and other Linux areas.

A distribution based on the Fedora project, a free version of the commercial RedHat Linux. Unlike Debian, the main package format of this OS has the RPM extension. Specially optimized for use on ARM processors and contains several software development environments.

Windows 10 IoT Core

Thanks to its high popularity, even Microsoft turned its attention to this minicomputer and developed a special version of the “ten”. The project is quite “raw” and, unlike Ubuntu Mate, does not have a large base of drivers for external peripherals that can be connected to the Raspberry Pi.

Latest OS developments

Raspberry is increasingly being positioned as a device that can be used in a “smart home.” With its small dimensions and high customization capabilities, this platform is of interest to companies developing in this promising area. Following Microsoft, the ubiquitous Google. In 2016, the start of development for Raspberry Pi applications was officially announced Android. Although a stable version has not yet been released, there are several unofficial builds that allow you to install Android TV or Android 6.0 OS on your Raspberry Pi 2.

In parallel, two more operating systems are being developed - Chromium And Sailfish, which also allow you to use android applications with apk extensions. The latter, by the way, was at one time actively supported in Russia with the aim of developing on its basis a competitive mobile operating system with domestic roots.

OS installation features

The Raspberry board comes without a pre-installed operating system. Therefore, its installation is the first task that the user faces. The main existing versions of operating systems with brief characteristics were given above.

For installation you will need an SD card with NOOBS, a special installer program containing several distribution kits recommended by the board developer. You can purchase such a card, in which case NOOBS and OS Raspbian will already be installed on it, or you can make it yourself. To do this, you will need to use a regular computer with a connected card reader and, having downloaded NOOBS from the official website, prepare it yourself.

Self-installation of OS Raspbian

It is important to remember that there is no hard drive on the board and the operating system will be stored on the SD card. The step-by-step self-installation process is as follows:


A computer without an operating system is just a set of hardware. Therefore, after receiving an RPi by mail or purchasing it in a store, you first need to install some kind of OS on it. This is not difficult to do, and any more or less computer-savvy person can easily figure it out.

What OS should I install on Raspberry?

The first task that will need to be solved is to choose a system. There are quite a lot of them, so an unprepared person can get confused. In fact, everything is very simple.

The most popular operating systems for Raspberry Pi 2 in 2017 were:

  • Raspbian is the standard OS for Raspberry;
  • Pidora is a project based on Fedora Linux code;
  • ArchLinux is a popular distribution that also has a version for the ARM processor architecture;
  • Windows 10IoT - you shouldn’t immediately think about installing it, as there is one very important nuance.

Beginners are strongly recommended to use Raspbian. This is a relatively powerful system based on one of the best Linux distributions - Debian. Its distinctive feature is that it is ideally tuned to work on Malina - the necessary optimization has been done and all the software useful for the single-board software in question has been installed.

You can install other operating systems on the Raspberry Pi 2 in 2 cases: to get acquainted with distribution kits or for comfort if the previously selected OS was actively used (for example, on a home computer).

Now about the product from Microsoft. For the Raspberry Pi 2, Windows 10 is not at all what many desktop users are used to. It doesn't even look like the mobile version. Windows 10 for RPi is a system for IoT - the Internet of Things. And it is needed only by those involved in the implementation of relevant projects. For reference: Raspberry, on which Windows 10 IoT is installed, can only be controlled remotely - through the browser of another computer.

Instructions for installing the OS on RPi2

On the Raspberry Pi 2, installing the OS is very easy. To do this, you will need a memory card of 4GB or more. It is also necessary that its speed class is at least 4.

Having selected a suitable memory, you will need to insert it into the computer card reader. Next, installing Raspbian on Raspberry Pi 2 will proceed as follows. First you need to format your MicroSD to FAT32. The next step is to download the NOOBS utility. This is an archive whose contents should be unpacked onto a cleaned card.

When the data recording is complete, you will need to remove the MicroSD from the card reader and insert it into the Raspberry. Then you will need to connect everything you need to it (for example, a keyboard, mouse and monitor), and then start the single board. From the OS list, select Raspbian. Also, after turning it on, you will need to select the keyboard layout, language and other settings.

Now that everything is done, all you have to do is click on Install and wait until the system installation process is completed. And when it is completed, you will need to select GUI - LXDE from the Configuration Tool menu. This is done in point 3. Now all you have to do is click on Done, after which the device will reboot.

To log in you will need to enter your access details. The standard ones in Raspberry are: login - pi, password - raspberry.

It should be noted that there is another way to install the system on the Raspberry Pi. It involves directly recording the distribution image onto a flash drive. You can find out how this can be done from the Wiki of any Linux project.

As you can see, the process of installing the OS on Malina is not complicated. Anyone can handle it without any problems, including children who want to understand computers. As for the amount of time that will have to be spent on this, it depends on the MicroSD speed class. On average, unpacking the system takes from 15 to 30 minutes.

Volume >= 16 GB, class >= 10

  • Power supply 5V outputting >= 2A
  • HDMI cable
  • Monitor
  • USB mouse, keyboard
  • Variety of distributions

    Download the operating system image (hereinafter referred to as OS) from the official website
    https://www.raspberrypi.org/downloads/raspbian/
    • NOOBS- simplified installation and long because The distribution kit is downloaded by Malinka in the process after selecting the desired OS from the list of proposed ones. Does not require creating a bootable flash drive - just copy the contents of the archive to the flash drive
    • RASPBIAN- a complete distribution of the main official OS for the Raspberry Pi. Size ~2 GB - quick installation
    Raspbian is offered in two versions:
    • DESKTOP- a distribution with a lot of pre-installed software, including the Raspberry Pi Desktop (RPD), office, frameworks.
    • LITE- simplified console version - suitable for cases of using older, less powerful versions of Raspberry Pi and/or experienced users who are able to install and configure the necessary software packages. The desktop can also be installed manually.

    I suggest you consider installing RASPBIAN DESKTOP

    Installation

    Download the distribution from the download page
    For this you will need a program
    Specify the path to the OS image and the letter of the memory card

    Click Write, then Yes

    Running without a monitor

    To immediately connect to Raspberry via Wi-Fi, you need to specify the network connection data and allow access via SSH

    Let's reduce the following two files to the specified form:
    rootfs/etc/network/interfaces
    allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
    Let's indicate our network name and password:
    /etc/wpa_supplicant/wpa_supplicant.conf
    network=( ssid="YOUR_NETWORK_NAME" psk="YOUR_NETWORK_PASSWORD" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP auth_alg=OPEN ) To allow access via SSH in the section(!) boot/ Let's create an empty file called SSH.

    installing Nmap sudo apt install nmap

    scanning hosts within the network (one of them is Raspberry) sudo nmap -sn 192.168.1 .0/24

    The red number depends on the router model (0,1,2,10...)

    Connection via SSH: ssh [email protected]
    pi user password: raspberry

    To connect via VNC:

    1. Activate the VNC interface using the raspi-config utility (Intefacing Options >>> VNC >>> Yes)
    2. Set the desired desktop resolution there (Advanced Options >>> Resolution >>> [select the desired one] >>> Ok)

    Insert the microSD card with the system into the slot Raspberry, connect the peripherals (monitor, keyboard, mouse) and, last but not least, supply power, since this is also a signal to start Raspberries. If everything is done correctly, then after a while we will see the Desktop Raspbian- the system is installed.

    Initial setup

    First of all, connect to a Wi-Fi network or Ethernet cable to the router to access the Internet
    Next, open the terminal using the keyboard shortcut Ctrl + Alt + T, enter the command sudo apt-get update -y && sudo apt-get upgrade -y
    and press Enter
    This will check the availability of new versions of installed packages and, if available, update the software.
    Let's configure important access parameters Raspberry, open the configuration window:


    On the first tab you can change the default user password pi (default is raspberry )On the tab Interfaces:

    • Camera- control interface for a special camera for Raspberry Pi

    • SSH- system availability for access via SSH protocol
    • VNC- system availability for remote desktop control via VNC
    • The remaining protocols refer to the Raspberry GPIO pin comb

    Setting up a static IP address for Raspberry

    If you don't use Raspberry Pi as a desktop PC, then in most cases you will need to connect to Malina from outside (SSH or VNC), to do this you at least need to know the IP address Raspberry, and by default it is dynamic - this means that the next time you boot it may change. Find out IP address Raspberries At the moment you can run the command in the terminal ifconfig.
    In the example below, Raspberry is connected to the network via Wi-Fi, the interface is used accordingly wlan0 and we see its address on the screen - 192.168.1. 12 . By the way, before the reboot the address was 192.168.1. 17

    Every time you connect to the network, the device receives its address using the protocol DHCP(Dynamic Host Configuration Protocol) is a network protocol that allows computers to automatically obtain an IP address and other parameters necessary to operate on a TCP/IP network.
    This protocol is initialized both on the router and on the Malina. To make the address assignment to the same value each time, you need to change the DHCP settings in relation to Raspberry either on the router or on the Malina.
    • The easiest option is to go into the DHCP settings of the router and assign a static IP for the device with a specific MAC address (it is also displayed by the command ifconfig, the ether parameter is different for different interfaces).
    However, everyone's routers are different, so let's consider the case of setting up DHCP on Malina.
    1. Let's decide on the interface to be used, their list is just given by the ifconfig command: if an Ethernet port is used for connection, then this is the interface eth0, if the built-in Wi-Fi module is wlan0, if an external Wi-Fi adapter, then wlan1 etc. Consider the case with wlan0
    2. Next is the IP address of the router. This is the address that you enter into the address bar of your browser to get into the router settings, usually it is 192.168.1.1. You can definitely find out this with the route command - this will be the Gateway value in the line whose Flags value is “UG” (Up Gateway)
    1. We select an arbitrary IP address for the Raspberry - essentially this is the value of the last digit in the gateway address from 0 to 255, excluding 1 (this is the gateway address itself) and the remaining addresses are already occupied by other devices. If it is not possible or desirable to view the list of connected devices (via the router interface), you can take a number greater than 100, let’s say this will be the address 192.168.1.111/24 (24-bit subnet mask)
    2. All settings in Linux are stored in text files; for DHCP this is a file dhcpcd.conf, which is located in the system folder /etc/. Let's open it in the console text editor nano with the command
    nano /etc/dhcpcd.conf
    1. We find a block almost at the end of the file

    1. Let's uncomment the necessary lines and indicate our values:

    # Example static IP configuration:
    interface wlan0
    static ip_address= 192.168.1.111/24
    #static ip6_address=fd51:42f8:caae:d92e::ff/64
    static routers= 192.168.1.1
    static domain_name_servers= 192.168.1.1 8.8.8.8

    The last value is a list of DNS servers - this is our router and Google's public DNS server

    1. Save changes Ctrl+O, exit nano Ctrl+X
    2. Reboot Raspberry: sudo reboot now
    Minimum configuration Raspberry Pi ready! You can start deploying a home server or something else)

    To work in Linux operating systems, we recommend that beginners familiarize themselves with a small alphabet on the Linux OS.

    Install OS Raspbian

    Installing drivers

    Camera driver in V4L

    To make the standard V4L device /dev/video0 appear, you just need to run:

    sudo modprobe bcm2835-v4l2

    To ensure that the driver is loaded automatically every time, we register it (bcm2835-v4l2) in /etc/modules

    i2c

    Add i2c drivers to the autoload list (/etc/modules) i2c-bcm2708 i2c-dev

    We install from the i2c-tools repository, we will need it for bus diagnostics

    sudo apt-get install i2c-tools

    Using it you can view a list of devices connected to i2c.

    i2cdetect -y 1

    Raspberry Pi 3

    UART does not work on Raspberry Pi 3

    On Raspberry Pi 3 the UART is occupied by BT. If you need UART BT you will have to disable it.

    Editing /boot/config.txt

    add sudo nano /boot/config.txt to the end of the file dtoverlay=pi3-miniuart-bt

    Editing /boot/cmdline.txt file





    

    2024 gtavrl.ru.