Raspberry Pi introduction and usage

Source: Internet
Author: User

Raspberry Pi introduction and usage

Raspberry Pi is a mini computer launched by the Raspberry Pi Foundation. It only has a credit card size, but can do most of the work that can be done by a normal PC at a low price, it is the best choice for computer enthusiasts. If you are a Linuxer, You should have such a mini computer.

Development

Since its release in 2012, Raspberry Pi 1 A, Raspberry Pi 1 B, Raspberry Pi 1 B +, Raspberry Pi 1 A +, and Raspberry 2 B are released in sequence, there are many changes in these versions of hardware. For details, refer to Wikipedia Raspberry Pi. In addition, Raspberry Pi 2 B will support Windows 10 iot, which is also a good news for non-Linux users, because you can use Raspberry Pi 2 B as your other Windows PC, you can view the Raspberry Pi Windows 10 iot for details.

Use of Raspberry Pi

What can Raspberry Pi do? Its gameplay is countless, because it depends on our creativity. As a Development Board, it provides us with great freedom.

  • A supercomputer built by Raspberry Pi
  • As a home server
  • What do I do with raspberry?
  • Five interesting ways to play Raspberry Pi
  • Micro-personal computer (I just think of it as a personal micro-computer)

The following are several pictures in the Reference document:

Operating System Selection

Because Raspberry Pi is generated almost for Linux, the operating systems of Raspberry Pi are also diverse. The following describes the operating systems.

  • Raspbian is the official Raspberry Pi Operating System Based On debian. If it is used on a development board, we recommend that you use this system most.
  • Ubuntu Mate
  • Snappy Ubuntu Core
  • Windows 10 Iot Core
  • OPENELEC
  • PINET
  • Proteus OS

You can find related information on the Raspberry Pi homepage.

  • Arch Arm
  • Gentoo Arm
PC

I only use Raspberry Pi as my PC. Therefore, instead of Raspbian, I chose Arch Arm.

Below are the accessories I selected

  • Raspberry Pi 2 B
  • 8 GB flash drive memory card
  • USB Wi-Fi module (optional)
  • Acrylic shell (optional)
  • Cooling aluminum or copper
  • Power cord
  • Keyboard and mouse (optional)
Install the system

First, install the system by referring to Arch Arm Installation.

 

Partition the SD card (replace sdX with your sd card device on Linux ):

  1. fdisk/dev/sdX

First, delete the original partition and recreate it:

  • Input o to clear all partitions.
  • Enter p to list all partitions. At this time, there should be no partitions.
  • ENTER n, ENTER p to select the primary partition, 1 is the first partition, ENTER to determine the first sector, and then ENTER + 100 M.
  • Enter t, and then enter c to set the first partition type to W95 FAT32 (LBA ).
  • ENTER n, and then input p to select the primary partition. 2 is the second partition. ENTER to determine the default sector and the last sector (all the remaining capacity is used as the second partition)
  • Enter w to write to the partition table and exit.

Create and mount a vfat File System (replace sdX with your sd card device on Linux ):

  1. mkfs.vfat /dev/sdX1
  2. mkdir boot
  3. mount/dev/sdX1 boot

Create an ext4 File System (replace sdX with your sd card device on Linux ):

  1. mkfs.ext4 /dev/sdX2
  2. mkdir root
  3. mount/dev/sdX2 root

Use the root user to download and decompress the root file system:

  1. wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
  2. bsdtar -xpf ArchLinuxARM-rpi-2-latest.tar.gz -C root
  3. sync

Move the Startup file to the first partition:

  1. mv root/boot/* boot

Detach a mount point:

  1. umount boot root

Insert the SD card into the Raspberry Pi to connect to the Ethernet and 5 v power supply.

Log On Using SSH

The default user is alarm password alarm. (For ssh, log on with this user first, and then modify the ssh configuration to allow root login)

The default password of root is root.

Note:sudoCommand, If you do not configuresudoUserootUser execution.

The first use should be in the following format:sshLogon:

  1. $ Ssh-p 22 alarm @ address

UsesuSwitchrootAnd change the password:

  1. $ sudosu-
    # password

To enablerootPasssshLog On, Edit/etc/ssh/sshd_config

  1. $ sudonano/etc/ssh/sshd_config

Set#PermitRootLoginThis line removes comments and sets the valueyes:

  1. PermitRootLoginyes
Configure the source and update system

Edit/etc/pacman.d/mirrorlist

  1. $ sudonano/etc/pacman.d/mirrorlist

Add the following code at the top, which is the source of HKUST

  1. ## USTC
  2. Server= http://mirrors.ustc.edu.cn/archlinuxarm/armv7h/$repo

After editing, pressctrl +x, And then pressySave and upgrade the entire system:

  1. $ sudo pacman -Syu
Desktop Raspberry Pi

First installxorg

  1. $ sudo pacman -S xorg
  2. $ sudo pacman -S xorg-xinit

Then installlxqtDesktop:

  1. $ sudo pacman -S lxqt 
Access Raspberry Pi using vncviewer

First, configure vncviewer. Both the local machine and Raspberry Pi need to be installed.tigervnc

  1. $ sudo pacman -S tigervnc

Run the following command in the Raspberry Pi:vncserver

  1. $ vncserver
  2. You will require a password to access your desktops.
  3. Password:
  4. Verify:
  5. Would you like to enter a view-only password (y/n)? n
  6. New'ArchRaspi:1 (locez)' desktop isArchRaspi:1
  7. Creatingdefault startup script/home/locez/.vnc/xstartup
  8. Starting applications specified in/home/locez/.vnc/xstartup
  9. Logfileis/home/locez/.vnc/ArchRaspi:1.log

Edit~/.vnc/xstartupTo replace the original content with the following content. You can also directly Delete the original file and create a new file with the same name:

  1. #!/bin/sh
  2. unset SESSION_MANAGER
  3. unset DBUS_SESSION_BUS_ADDRESS
  4. exec startlxqt

Then kill the vnc service and restart it:

  1. $ vncserver -kill:1
  2. KillingXvnc process ID 400
  3. $ vncserver
  4. New'ArchRaspi:1 (locez)' desktop isArchRaspi:1
  5. Starting applications specified in/home/locez/.vnc/xstartup
  6. Logfileis/home/locez/.vnc/ArchRaspi:1.log

Remember the above:1This port may vary depending on the actual situation.vncviewerThe port used for connection.

Then execute:

  1. $ vncviewer address:port

Enter the password.

Small Screen Display

Now we can see that this is not full screen, but we can add a parameter when starting vncserver to specify the Resolution:

  1. $ vncserver -kill:1
  2. $ vcnserver -geometry 1920x1000

This is full screen.

Full Screen

Other Purposes

Then you can use the Raspberry Pi without configuring the display.sambaThe server, or a download server, depends on what you want to use the Raspberry Pi.

The author also tries to directly connect the Raspberry Pi to the Wi-Fi of the mobile phone, and use the mobile phone as a router. After obtaining the Intranet IP address of the mobile phone, it is directly on the mobile phone.sshYou can log on to the Raspberry Pi through the Intranet to enable the Raspberry Pi to access the Internet using mobile phone traffic without using a vro.

Here I recommend juiceSSH, a simple and practical ssh tool on the mobile phone. Due to the length of the article, I will not detail how to use a mobile phone to directly connect to the Raspberry Pi here. If you have strong hands-on skills, please refer to the ideas I gave above for self-help.

Later I bought the keyboard and used it again.tmuxUse the phone purely on the screen.

First, mobile phone firstsshLog on to the Raspberry Pi and run

  1. tmux

Then, when the screen is invisible, use the keyboard to blindly enter the user name and password for login, and then execute

  1. tmux attach

At this time, the keyboard is synchronized with the phone screen input, and a personal work is complete!

Result Display

The following figures are taken when I was at school:

How to run Ubuntu Snappy Core in Raspberry Pi 2

Install NodeJS on the (Raspberry Pi) Raspberry Pi

Install Weston on Raspberry Pi

Linux OS for Raspberry Pi is available

Raspberry Pi (Raspberry Pi) trial note

Introduction to Raspberry Pi (Raspberry Pi) installation, IP configuration, and software source

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.