Mobile phone control raspberry pi

1. Introduction to Raspberry Pi

Wikipedia's explanation:

Raspberry Pi (Chinese name "Raspberry Pi", abbreviated as RPi) is designed for learning computer programming education, only a credit card-sized microcomputer.a

Since its inception, it has been sought after by many computer enthusiasts and makers, and it was once hard to find a "school". Don't look at its "petite" appearance, but its "heart" is very powerful, and it has all functions such as video and audio.

 

Below is a picture to see what a Raspberry Pi looks like.

It can be seen that it is really only as small as a bank card. Although it is small, this circuit board the size of a bank card integrates hardware such as cpu, gpu, memory, etc. Let's take a look at the specific hardware configuration. I use Raspberry Pi 3b, and all the hardware of 3b is shown. configure

1.1. Hardware configuration

CPU ARM Cortex-A53  64-bit (ARMv8 series) 1.2GHz (quad core)
GPU Broadcom VideoCrore IV, OpenGL ES 2.0, 1080p 30 h.264/MPEG-4 AVC HD decoder
RAM 1GB (LPDDR2)
Number of USB 2.0 ports 4
video input 15-pin MIPI Camera (CSI) interface, can be used by Raspberry Pi camera or Raspberry Pi camera (no IR version)
Network Interface
  • 10/100 Ethernet interface

  • 802.11n Wireless LAN

  • Bluetooth 4.1

  • Bluetooth Low Energy (BLE)

I feel like a picture would explain it better

1.2 Operating System

The Raspberry Pi mainly supports the operating system based on the Linux kernel, although the Raspberry Pi 2 can already run "Windows 10 IoT Core Edition",

Commonly used operating systems: Raspbian, Snappy Ubuntu Core, OSMC, Windows10 Lot Core

This is the system download link of the official website

1.3 Purpose

 

What can you do with a Raspberry Pi?

Just like any other desktop or laptop computer running Linux, there's a lot you can do with a Raspberry Pi. Of course, there are bound to be some differences. Ordinary computer motherboards rely on hard disks to store data, but Raspberry Pi uses an SD card as a "hard disk", and you can also connect an external USB hard disk. The Raspberry Pi lets you edit Office documents, browse the web, and play games—even games that require a powerful graphics accelerator, like Quake.

The Raspberry Pi's low price means it's more versatile, making it a great multimedia center. With the Raspberry Pi, you can play videos and even power through the TV's USB port.

Baidu Encyclopedia's explanation is as above, but very electronic enthusiasts have played a lot of tricks, such as making a wireless router, home theater, Internet radio to play FM radio (a feeling of overkill...), and more advanced hexapods Walking robot, simple face recognition, etc.

For more Raspberry Pi applications click here

2. Connect the phone to the Raspberry Pi

2.1 Introduction

The Raspberry Pi is just a circuit board and does not have its own display. If you want to use the Raspberry Pi to program or play games, the easiest way is to connect a monitor via an HDMI cable, like this

 

If you don't have a monitor or don't want to view the Raspberry Pi through the monitor, you can only operate it by connecting to the Raspberry Pi remotely. Generally, the remote connection method is to connect to the Raspberry Pi through ssh.

Because the Raspberry Pi is connected remotely through the network, before this, the Raspberry Pi must be connected to the network and an IP address is assigned to the Raspberry Pi.

There are generally several ways to access the network

  • Plug the network cable directly into the Raspberry Pi
  • connect wifi in raspberry pi
  • Mobile phone USB network sharing, share network with Raspberry Pi

No matter which way to connect to the network, if you want to connect through ssh instead of directly plugging in the HDMI cable to connect to the display, you must first know the IP address of the Raspberry Pi. The third one is introduced here, sharing the network with the Raspberry Pi through the USB of the mobile phone. A mobile phone can do everything directly. It can not only connect the Raspberry Pi to the network, but also function as a display + keyboard and mouse.

2.2 Specific steps

Powering the Raspberry Pi

  • First insert the memory card (with the system already flashed) into the Raspberry Pi
  • Plug in the power cord and turn on the power switch. If you see the green light on the Raspberry Pi, it means the system is starting up

 

Connect the Raspberry Pi to the network

  • Connect your phone and Raspberry Pi with a USB cable
  • Turn on USB tethering on your phone

 

Different mobile phones have different ways to enable USB sharing, please Baidu by yourself.

 

Check the IP address of the Raspberry Pi

Because it is connected to the Raspberry Pi through ssh, all you need to know the IP address of the Raspberry Pi (this step is very important). And through the mobile phone USB network sharing method, an IP address will be dynamically assigned to the Raspberry Pi each time, which is different each time, and all have to be scanned out by an IP scanner.

Mainly through an IP scanner in the mobile phone , scan the IP in the local area network to find out the IP address of the Raspberry Pi. I use a mobile phone software called "Network Scanner".

The download address is here, click on the mobile browser to automatically download (Android phone)

 

The following describes how to use the software

 

Click the wrench-like icon

 

select settings

 

Click Scan Settings

 

Set the IP start address to: 192.168.42.1

The IP end address is set to: 192.168.42.255

(I don't know why the IP of this section is, maybe different mobile phones or operators have different IP sections to be set)

After setting the IP, go back to the main interface and click the icon like a magnifying glass to scan.

There are two IP addresses, 192.168.42.101 this is it, write it down and use it when you log in with SSH (this step is very important )

 

Connect Raspberry Pi

Once you know the IP address assigned to the Raspberry Pi, you can connect via your phone. As long as it is a mobile phone software that supports ssh. I use

A software called "Termius", the Baidu cloud disk link is here, copy it to the mobile browser to download.

https://pan.baidu.com/s/1EsXsk36w1gbsykNhh9JdZg Password: wtia

 

You only need to set 4 parameters in the software:

  1. IP address
  2. The port number
  3. username
  4. password

 

Click the plus sign in the lower right corner, the above interface will appear, and then click New Host

 

Set 4 parameters according to the above figure, IP address, port number, user name and password. After setting, click the tick in the upper right corner.

 

Then this interface will appear, click CONNEXT

 

 

If there is no problem, the following interface will appear, indicating that the connection is successful. The Raspberry Pi can be operated with only one mobile phone, no need to plug in the monitor, keyboard and mouse. Now you can enter some linux operation commands

 

If you want to shut down, enter "sudo poweroff"

 

Areas that can be improved:

 

Because of the way to connect through ssh, the command line interface appears. If you want to log in through the graphical user interface , you need to use a software called VNCviewer to log in, and continue to make up this tutorial next time

This is the end of this tutorial, writing a tutorial for the first time and finding it a tiring thing.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324442043&siteId=291194637