How to set up smartphones and PCs. Informational portal
  • home
  • Windows phone
  • Raspberry Pi: setup and management. Raspberry Pi: detailed setup from scratch to TorrentBox

Raspberry Pi: setup and management. Raspberry Pi: detailed setup from scratch to TorrentBox

The Raspberry Pi (RPi) is a single-board microcomputer that has all the same features as conventional personal computers and laptops. You can connect a monitor, keyboard, mouse, audio speakers, as well as an Internet cable to it. Like a personal computer, the RPi runs full operating systems (OS) such as: Raspbian (Debian), Android, and even Windows 10.

The Raspberry Pi is similar in performance to a modern smartphone, except it doesn't have a cellular module. Like modern smartphones, the RPi's operating system is stored on a microSD memory card. All user files are also stored there.

To get started with the Raspberry Pi, we need to install an operating system on the memory card. This is what we'll do!

1. Preparing the memory card

If you did not purchase a memory card with an already installed OS with your Raspberry Pi, you will have to download the operating system from the Internet yourself and write it to a blank card. It is recommended to use a memory card with a size at least 8 GB.

The most popular operating system for the Raspbrery Pi is Raspbian. It is essentially a modified Debian. There are two options for installing Raspbian on a memory card:

  1. copying an image of a memory card, with Raspbian preinstalled; this is done using Win32DiskImager.
  2. copying a special NOOBS installer that will automatically install Raspbian or another OS.

Let's take the second method step by step.

Step 1. Download archive with files here:

You can choose NOOBS or NOOBS Lite. In the first case, we will download the installer bundled with Raspbian. In the second case, the installer will be empty, but it will be possible to “download” any OS from the Internet. We choose the first option.

Step 2 Unpack the downloaded archive.

Step 3 Copy all files from the archive to an empty memory card.

Ready! Now we have a memory stick with the installer, and we can start deploying the Raspbian OS.

2. Installing Raspbian with NOOBS

Let's take a look at our Raspberry Pi. As already mentioned, RPi is a full-fledged small computer. Therefore, to work, we need to connect a monitor, keyboard, mouse and memory card to it.

Lastly, turn on the power to the microUSB connector and follow the steps to install Raspbian.

Step 1Launch Your Raspberry Pi

All Raspberry Pis start their boot up with this rainbow screen. This is a sign that the video card is connected correctly and everything is working as it should.

Step 2Run the NOOBS Installer

After downloading, the installer asks you to select the desired operating system. Choose Raspbian.

Confirm with the "Yes" button

Step 3: Copy operating system files

At this step, we just need to wait until everything is copied. It takes 15-20 minutes.

Step 4: Finishing the installation

Hooray, Raspbian installation completed successfully! Click "OK".

Step 4. Desktop

Finally, the system desktop opens.

Conclusion

Actually, upon completion of the installation procedure for the operating system, the Raspberry Pi is completely ready for use. Various useful programs are already installed on the system, including:

  • programming language python versions 2 and 3;
  • visual programming language Scratch;
  • Java application development tools: BlueJ Java IDE, GreenFoot Java IDE;
  • Geany Programmer's Editor development tool;
  • Mathematica package;
  • a package of office applications LibreOffice;
  • VNC Viewer;
  • Chromium browser;
  • mail client Claws Mail;
  • and even the game Minecraft Pi.

Next time we will talk about how to write simple programs in python. Let's deal with variables, conditional jumps and loops.

Five years after the release of the first Raspberry Pi devices, the project continues to gain more and more popularity and spread far beyond its original purpose. The founder of the project, Eben Upton, initially hoped to sell no more than 10,000 boards, but at the moment more than 10,000,000 devices are in the hands of students, teachers and other people in IT specialties.

In addition to the third generation Raspberry Pi, you can now find a lightweight Raspberry Pi Zero model, as well as other components such as a video camera, touch screen, and various sensors.

With so many possibilities, it can be hard to know where to start with your Raspberry Pi 3 application. This article will walk you through getting started with the Raspberry Pi. I'm assuming you already know how to connect a screen, mouse, keyboard, power, and install an operating system. Today we will look at what to do next.

Many people have a Raspberry Pi, but they don't even know what version of the device they have. You can determine the version of the device by the amount of memory, this parameter differs the most. Or, for example, more GPIO slots were added in later boards. But there are some minor differences that you should be aware of when creating your project.

You can find out the version of the board with a visual inspection, but the best way to do this is with a terminal. To do this, turn on the device and run the command:

cat /proc/cpuinfo |grep "Revision"

The output will contain a string of four or six characters, which can be used to understand what device you are using:

If you see a very large number that starts with 1000, then comes the revision number and again 1000, then this is a sign of a power surge.

Here are some comparative characteristics of different versions of devices:

If you want to know more information about your board from the command line, you can use the following commands:

Hardware:

cat /proc/cpuinfo

cat /proc/version

RAM:

cat /proc/memory

Raspberry Pi connection

Perhaps you are used to the fact that to turn on any electrical device, you just need to plug it into a power outlet, press a button and it works. The Raspberry Pi is not one of those devices. For this microcomputer, it is important to choose the right power supply that will provide stable power for maximum performance. There is no button to turn on and off, but if you want, you can make one.

If you think your device is not getting enough power, you can check the voltage with a multimeter. On older boards, there are holes on the top of the board labeled TP1 and TP2. On the B+, Pi2 and Pi3 models, they are located on the bottom of the board, on the side of the SD card, and are marked PP3 and PP7.

First connect all the peripherals you are going to use. Set your multimeter to measure voltage up to 20 volts. Connect the red wire to TP1 or PP3 and the black wire to TP2 or PP7. The multimeter should give a value of about 5 volts. a deviation of 0.25 volts is bad and the closer to five the better. If you find a voltage drop, this could happen for two reasons:

  • your USB cable. It may be suitable for charging the phone, but it is too slow. This is enough for a phone, but the Raspberry Pi lacks power.
  • Peripherals. All USB devices need power, you can use a USB hub to solve the problem.

In general, connecting a Raspberry Pi does not cause many problems.

Adding a reset button

Now that you know the basics and have chosen a power source, you can add a shutdown button to your device. Most electronics have a shutdown button, but there isn't one, and if you want to reboot your Raspberry Pi, you'll have to unplug the power cord and plug it back in. But you can add a button to not do this.

The board has two holes next to each other, one is round, the other is square. On Model B, they are marked P6 and are located next to the HDMI port. On later boards, they are placed closer to the GPIO ports and are labeled RUN.

You can purchase any button and solder its pins to these ports. All that is needed to reset the processor is to short these outputs.

Using GPIOs and Sensors

Apart from its low price, the Raspberry Pi is very attractive to users due to its GPIO capability.

GPIO or general purpose input/output are general purpose input and output ports. Almost all Raspberry Pi projects are built using these ports. Their strength is in flexibility.

The first Raspberry Pi boards had 26 GPIO ports, the Raspberry Pi 2 and Pi 3 have 40. From a technical point of view, only 17 out of 26 and 28 out of 40, respectively. The rest are electrical contacts and grounds. All ports are numbered, but to use them correctly you need a printout with a description of the values. For example, for 40:

Or for 28:

It can be printed and attached to the board so as not to get confused during work:

To get the GPIO to do what you need, you need a bit of programming. Usually, everything can be done in Python. In case you didn't know, the Pi part of the name comes from a tool for learning to program in Python. You can find a lot of instructions for using Python for Raspbery and GPIO on the internet.

Find a project

Your device is almost ready. All that is left is to decide on the project and start doing something. Even if you haven't written a single line of code or worked with a soldering iron yet, the Raspberry Pi can be the perfect tool for learning these things.

If you don't want to code anything but want to do something useful, you can install Kodi on your Raspberry and make your home media center.

After that, you can move on to searching for other projects. What do you like more, games? Home automation? The photo? Perhaps someone has already posted instructions on the Internet on how to do what you want. Use them or make your own. Here are some interesting projects that you can implement:

  • Cupcade is the easiest way to create your own small gaming system. But here you need to buy the device as a kit to get all the necessary parts;
  • MagicMirror is one of the most popular projects on Raspberry Pi, the essence is to display text information on a mirror using a screen and this microcomputer;
  • Minecraft - you can create your own Minecraft server based on Raspberry Pi;

These are not all interesting projects with which you can find a use for the Raspberry Pi 3. You can find a few more in the article.

conclusions

In this article, we covered getting started with the raspberry pi. This very interesting device can be quite useful if used properly. Have you bought a Raspberry Pi yet? Are you going to buy? Or have you already assembled your project and found a use for raspberry pi? Write in the comments!

At the end of the video from 16 bits ago about the Raspberry Pi:

When you buy a Raspberry Pi, you are only buying the circuit board, which comes without even a power supply or operating system. This article is intended to give you an idea of ​​how to set up your Raspberry Pi so you can start using it.

The Raspberry Pi is a minicomputer that has many ports that can be used to connect various peripherals. You can connect a separate monitor via HDMI and a keyboard and mouse via USB, and the Raspberry Pi has an Ethernet port so you can use the internet in your Raspberry Pi projects.

In this guide, you'll walk through a series of steps that will allow you to connect your Raspberry Pi to your laptop or desktop PC, eliminating the need for separate Raspberry Pi devices.

Hardware and software

  • 1x;
  • 1 x Ethernet cable;
  • 1 x laptop or desktop PC;
  • 1 x SD card (minimum size 4 GB);
  • 1 x Micro USB cable (to power Raspberry Pi).

Before we continue, we need software that needs to be downloaded. Below is a list of software and links where you can download it for free:

  • Raspbian OS: when you buy a Raspberry Pi, you have the option (in some stores) to buy an operating system pre-installed on the SD card, or simply download the zip file from https://www.raspberrypi.org/downloads/ , which contains the Raspbian OS image, to write it to your SD card;
  • SDFormatter A: The SD Card Association has some very good software that can be used to format your SD card. Visit https://www.sdcard.org/downloads/formatter_4/index.html and download the SDFormatter for your operating system;
  • Win32DiskImager: To burn Raspbian OS to your SD card, you will need the useful Win32DiskImager utility. You can download it here;
  • Note: You will need to determine the IP address of your Raspberry Pi when you connect it to your computer. Just download this program http://www.advanced-ip-scanner.com/ ;
  • PuTTy A: PuTTy is the SSH client that will be used to connect to the Raspberry Pi. You can download it here http://www.putty.org/ ;
  • VNC: and the last one is the VNC server. You can download it here https://www.realvnc.com/download/ .

Once you've downloaded all of this software, extract and install it.

Operating system installation

  1. Insert the SD card into the card reader and check which drive letter has been assigned.
  2. Open Win32DiskImager, you may need to run it as administrator.
  3. Select the unpacked Raspbian OS image.
  4. Select the letter assigned to your SD card from the drop down list of devices. Be sure to select the correct drive letter so you don't corrupt data on any other drive.
  5. Click burn(Write) and wait for completion.
  6. Close Win32DiskImager, remove the SD card and insert it into the Raspberry Pi.

Note: After burning the operating system, you will notice that there are only a few megabytes left on the SD card. It's because of the created partition, the rest of the free space is hidden. You will be able to fix this once we connect to the Raspberry Pi.

Shared Internet via Ethernet port

Once the SD card is ready, insert it into your Raspberry Pi. Plug in the USB power cable. And also connect Raspberry Pi and laptop with Ethernet cable.

If you are connecting your Raspberry Pi to a router with internet access, you can skip this step.

Checking the IP address assigned to your Raspberry Pi

It's simple, make sure your Raspberry Pi is connected to your computer's Ethernet network (either directly or via a router). If everything is working properly, you will see the LEDs on the board blink.


Connecting to Raspberry Pi via PuTTy

Fine! Before continuing, let's take a look at what we have already done so far.

This short instruction will describe the installation and configuration of the Raspberry Pi single-board computer. If you are a happy owner and are just getting acquainted with the Raspberry Pi, well, and are thinking about starting a computer for the first time, then you are here.

Raspberry Pi - Preparing a Memory Card

Since the Raspberry Pi does not have built-in memory, for the computer to work, you must first prepare a memory card - unpack the image of the desired operating system onto it.

We will need:

  • SD (MMC / SDIO) memory card from 2 to 32 GB (reading speed should be high enough, so class 6 and 10 cards are suitable);
  • card reader for connecting a memory card to a computer;
  • Win32DiskImager program (download Win32DiskImager from MEGA - link);
  • image of the operating system, I will use Raspbian (download Raspbian from the official site - link).

1) Unzip the downloaded image of the operating system - for further work we need an .img file;

2) We connect the memory card using a card reader to the computer;

3) Unzip the Win32DiskImager program and run the Win32DiskImager.exe file from the program folder

4) Specify the path to the .img file with the operating system (to do this, click on the folder image), then in the "Device" field, select the memory card from the list of media and click "Write", then select "Yes" in the dialog box that appears.

When everything is ready, click "Write"

5) We are waiting for the image to be written to our memory card.

The process takes about 5 minutes

After the process is completed, the preparation of the memory card is completed, and the first launch of the Raspberry Pi can begin.

Raspberry Pi - first connection

After preparing the memory card, you can proceed to the first launch of the Raspberry Pi.

To turn on the Raspberry Pi for the first time, we need:

I think it’s intuitively clear what needs to be connected where - we insert the memory card into the connector on the Raspberry Pi, connect the keyboard and mouse to the USB connectors, connect the monitor to the Raspberry Pi with an HDMI (or RSA) cable, and connect the power via the MicroUSB connector. After connecting the power, the operating system will immediately start loading.

If everything went smoothly, then we will see the settings window that appears when you first start the operating system:

Raspberry Pi Settings Menu

Let's analyze all the menu items in turn (to select items, use the up / down arrows, to select a menu item - "Enter"):

one) " Expand filesystem"- extension of the main partition to the entire memory card. Just press "Enter";

2) " Change User Password » setting a password for the "pi" user (the default password is "raspberry"). I set mine - "piip". When entering a password, the entered characters are not displayed, the password must be entered twice (the second time to confirm the correctness of the input);

3) " Enable Boot to Desktop « load/not load GUI. I disable it, since the graphical interface can be launched at any time (see “Raspberry Pi - Useful Commands”), and most of the work with the Raspberry Pi happens through the console. After selecting "Enable Boot to Desktop", an additional dialog box will appear: the first line - do not load the graphical interface, the second - load (there is also a third line, but we are not interested in it in this article).

4) " Internationalization Options “- the choice of language and location. After selection, a dialog box will appear with three options:

  • « Change Locale"- language selection, select "ru_RU.UTF-8 UTF-8" (scroll to the desired item with the arrow, select the desired item with the space key, then press "Tab" - the cursor will go to "OK", press "Enter", then in the dialog box, select ru_RU.UTF-8, go to "OK" with the "Tab" key and confirm the selection with the "Enter" key;
  • « Change timezone"- choice of time zone, select your own (just select from the list, after highlighting the desired city, press "Tab" to move the cursor to "Ok");
  • « Change Keyboard Layout» - keyboard settings. We leave it as it is.

five) " Enable Camera» - enable camera support. I don't have a camera, so I'm skipping this step.

6) " Add to Rastrack » - registration of the device in a common database. There is no need for this, skip it.

7) " Overclock"- overclocking the processor. By default, the frequency is set to 700 MHz, it can be increased to 1000 MHz (intermediate modes are available). If you do not know why you need to increase the frequency, it is better to just skip the paragraph, if necessary, this can always be done.

8) " advanced options" - additional settings. After selecting this line, a dialog box will open with the following options:

nine) " About raspi-config“-general information about this settings menu, skip.

Everything is ready, now we select the finish with the “Tab” key, the device will reboot and we can start working. After the reboot, a login will be requested - enter “pi”, then a password will be requested - “piip” (if you did not set your own, then the default password will be “raspberry”).

Raspberry Pi is ready to go! The only other thing I recommend doing is setting a password for the "root" user. To do this, type in the console "sudo passwd root" and enter the password twice.

Raspberry Pi - SSH setup

For convenient interaction with the Raspberry Pi, I recommend that you immediately deal with remote access to the console and file system - it is much more convenient to manage Raspberry from under the familiar Windows environment.

For remote access, the Raspberry Pi must be on the same local network as the computer from which we want to control it (in the simplest version, the Raspberry Pi and the computer must be connected to the same router).

How to find out what IP address a Raspberry Pi is getting on a local network

The first step is to find out what IP address the Raspberry is getting. To do this, it is convenient to use programs such as Advanced IP Scanner (official website of Advanced IP Scanner - link) or Free IP Scanner (download Free IP Scanner from MEGA - link). I will be using Advanced IP Scanner. Using the program is very simple - download, run (it is possible to start without installation) and click "Scan".

Raspberry gets IP address 192.168.1.6

In the list of devices we find Raspberry, in this case it receives the IP address 192.168.1.6, remember it. Now you can proceed to setting up remote access.

Configuring SSH Access to the Raspberry Pi Console (from Windows)

To access the console, it is most convenient to use PuTTY (download PuTTY from the official site - link, download from MEGA - link) - a simple program that does its job perfectly.

PuTTY setup:

1) After launch, go to the "Translation" section and select UTF-8;

Translation section

2) We return to “Session” and set the settings as in the screenshot below, in the “Host Name” field enter the Raspberry IP address (which we found out using Advanced IP Scanner). In the field "Saved Sessions" we set the name of the connection, I will have "SSH PI". Click "Save"

If everything is correct, click "Save"

3) Now, to connect to the Raspberry Pi, select the created “SSH PI” connection, click “Open”, and the Raspberry console opens in front of us.

Raspberry Pi Console

Setting up SSH access to the Raspberry Pi file system (from Windows)

To access the Raspberry Pi file system, we need the WinSCP program (download WinSCP from the official website - link, download from MEGA - link). The first step is to download and unzip it.

1) We go into the folder with the unzipped program, run the WinSCP.exe file. In the program window that opens, specify the settings, as in the screenshot - in the "Host name" field you need to enter the IP address of Raspberry (which we found out using Advanced IP Scanner), in the "User name" and "Password" fields we specify the data for authorization, it is more convenient just to access the file system, log in as root (how to set a password for the root user, see "Raspberry Pi - the first start of the computer, setting up the operating system «) . Then click "Save".

When everything is ready, click "Save"

2) In the window that appears, specify the name of the connection, you can set any. I'll call it "SSH PI FILES", you can also check the box to remember the password. We press "Ok".

3) Our connection has been saved and is now available in the "Stored sessions" section. Go to this section and double-click on the name of the connection. In the window that appears, click "Yes".

Section "Stored sessions" with our connection

4) After the done actions, the file manager window will appear - on the right are the Raspberry Pi files, on the left is the file system of the computer.

File manager window

Now we can copy, edit, view files that are on the Raspberry Pi with Windows. When creating your own projects, this can be very handy.

Raspberry Pi - network settings

After setting up remote access, you need to configure the network connection on the Raspberry Pi in such a way that when you turn on the Raspberry it always receives the same IP address (the one that we saved in the settings of the remote access programs), otherwise we will have to guess which IP address each time. the address has been obtained and re-configure SSH.

To set the Raspberry network connection to a specific IP address, we need to edit the /etc/network/interfaces. The most convenient way to accomplish this task is with the help of the already familiar WinSCP program (see "Raspberry Pi - SSH Setup").

So let's get started:

1) Run WinSCP and find the interfaces file (/etc/network/interfaces).

2) Select the file and open it for editing ("F4" key). And instead of the line "iface eth0 inet dhcp"

enter the following:

"iface eth0 inet static
address 192.168.1.6
netmask 255.255.255.0
gateway 192.168.1.1"

Where “192.168.1.6” is the IP address that we specified in the SSH (remote access) settings, “192.168.1.1” is the main gateway (home router address).

Edited interfaces file

Now, when you turn on the Raspberry Pi, it will always be available at the desired IP address (in this example, 192.168.1.6).

Raspberry Pi - Useful Commands

A small list of basic commands for controlling Raspberry through the console:

  • "top" - launching the task manager preinstalled in Raspbian;
  • "sudo raspi-config"- launching the initial settings menu (see "Raspberry Pi - first connection");
  • « sudo passwd root"- creating a password for the root user;
  • "startx"- launching the graphical shell;
  • "sudo halt"- turn off the Raspberry Pi;
  • "logout"- Sign Out;
  • "cd"- go to the necessary directory, for example, to go to the /etc/network/ directory - "cd /etc/network/";
  • pwd— path to the current directory;
  • dir— contents of the current directory;
  • "mkdir"- creating a directory. For example, "mkdir /home/pitest/" will create a directory called "pitest";
  • "rmdir"- deleting a directory. For example, "mdir /home/pitest/" - delete the "pitest" directory;
  • cat— open the file for reading. For example, "cat /etc/network/interfaces" will show the contents of the "interfaces" file;
  • "nano"— open the file for editing. For example, "nano /etc/network/interfaces" will open the "interfaces" file for editing;
  • "ifconfig"- displays the current network configuration;
  • "df"- will display in the console the free and used disk space for all sections of the file system;
  • clear- clear the terminal screen;
  • "Ctrl"+"Ins"(keyboard shortcut) - copy selection (text);
  • "Shift"+"Ins"(keyboard shortcut) - paste from clipboard (text);
  • "sudo"- execute commands with root user rights. For example, this is relevant if you are logged in as the "pi" user and want to edit some system file from the console - "sudo nano path_to_file";
  • "Ctrl"+"C"(keyboard shortcut) - stop the current action / exit the console application;
  • "sudo apt-get update"- updating the list of available packages;
  • "sudo apt-get upgrade"- updating installed packages;
  • "sudo apt-get install"- Installing the required package. For example, to install the Links console browser, type "sudo apt-get install links".

Conclusion

Now everything is ready for comfortable use of the Raspberry Pi, and you can start implementing your projects. I will write about this and much more later.

Top Related Articles