Children's shoes for learning Linux If you want to buy a toy, Raspberry Pi is definitely the best choice. For the introduction of the Raspberry Pi, Liang Xu will not repeat it. Baidu has searched a lot. In short, the Raspberry Pi is a small computer, we can use it to learn Linux, and can also be extended to make a lot of fun toys.
But Liang Xuqiang bought a raspberry pie and ate dirt, and had no money to buy a screen. Liang Xu will introduce how to play Raspberry Pi without a screen.
required objects
- Raspberry Pi 3B
- Raspberry Pi power supply (5V2.5A)
- computer
- cable
- TF card above 4G (high-speed card is preferred)
Raspberry Pi operating system installation
1. Raspberry Pi operating system image download
The image of the Raspberry Pi is customized based on Debian and is officially named Raspbian. The mirror can be downloaded from its official website:
https://www.raspberrypi.org/downloads/raspbian/
2. Mirror burning tool download
After the image is downloaded, you need to burn it to the Raspberry Pi. The burning tool used is win32diskimager
, the download address is as follows:
https://sourceforge.net/projects/win32diskimager/
3. Mirror burning
After downloading the image and the burner, you can start to burn. Proceed as follows:
- Insert the TF card into the computer through the adapter;
- Open
win32diskimager
, load the Raspbian image, select the drive letter corresponding to the TF card; - Click the
写入
button to burn. The burning process is a bit long, just wait patiently.
Raspberry Pi boot
After the image is burned, we need to make some necessary settings to start the Raspberry Pi correctly.
1. Turn on SSH
The first is the SSH function. Because we don't have any screen or an external keyboard, we can't directly operate the Raspberry Pi. To play Raspberry Pi happily, we need to log in remotely via SSH.
However, Raspbian turned off the SSH function after November 25, 2016. Ways to open SSH is also very simple: good programming SD card boot directory, create a file called ssh
empty file folder can be.
2. Determine the IP address of the Raspberry Pi
We know that if you want to log in to Linux remotely via SSH, you need to know the other party's IP address. But it is still the problem. Our Raspberry Pi has no screen and cannot directly know its IP address.
How to determine the IP address of the Raspberry Pi?
We can insert the Raspberry Pi into the TF card with the burned image, then connect the power supply, and then directly connect to the router through the network cable, and then log in to the router background to check the IP address of the Raspberry Pi. The wiring is very simple, as follows:
After that, log in to the router background to check the Raspberry Pi IP address. The login address in the background of different routers may be different. The specific address can be viewed on the back of the router. After logging in to the background, you can see the addresses of all devices connected to the router. If you still can’t find the Raspberry Pi, you can wait for a while. Maybe the Raspberry Pi hasn't fully started yet.
3. SSH into Raspberry Pi
Raspberry Pi's SSH service is turned on, and also know its IP address, we can use MobaXterm
telnet to Raspberry Pi. Of course, in addition to MobaXterm, we can also use SecureCRT, putty, XShell and other tools, depending on personal preference.
For MobaXterm
the tutorial, you can refer to this article:
Almighty terminal artifact-MobaXterm
We only need to fill in the IP address in Remote host, fill in pi in uername, and then click OK.
Then enter the password raspberry
to log in to the Raspberry Pi remotely. Logging in for the first time may be a bit slow, just wait for a while.
After connecting, we can play Raspberry Pi happily.
Configure Raspberry Pi
1. Configure raspi-config
For the raspberry pie with a screen, when you first start, it will automatically appear raspi-config
configuration interface. For the SSH remote connection, the raspi-config setting program will not appear at the first login. Please use sudo raspi-config
the command to manually start.
raspi-config
There are many things that can be configured freely, but some settings can only be set once, for example expend_rootfs
. Although there are many things that can be set, Liang Xu only configures two: password and expend_rootfs.
- Password modification
Use sudo raspi-config
the command to start the configuration interface, and then select Change User Password
, you can change your password.
- Configure expend_rootfs
Configure expand_rootfs to expand the available space of the entire system to the size of the storage card. If there is no expand, SSH login may be very unstable and the available resources are also very small.
The configuration process is also very simple, first select Advanced Options
, then select Expend Filesystem
, then enter all the way, and then wait a while.
2. Configure Wi-Fi
Now we use a network cable to connect to the router to access the Internet, but connecting a network cable is somewhat troublesome, and now in a wireless society, using Wi-Fi is undoubtedly the best choice.
We only need to write the SSID and PSK of the hotspot to be connected into the wpa_supplicant.conf file, and the Raspberry Pi will automatically connect to this hotspot when it is powered on next time. In fact, this setting can also be done through raspi-config, just think about it yourself.
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
Add the hotspot SSID and PSK to be connected at the end of the file
network={
ssid="WIFINAME"
psk="password"
}
Raspberry Pi visual interface
Our Raspberry Pi does not have a screen, but we can use the remote desktop that comes with Windows to view the Raspberry Pi's desktop. Of course you can also use VNC, but you need to install a software, which is troublesome.
Before using Remote Desktop Connection on Raspberry Pi, you need to come in raspberry Installation xrdp
Services:
sudo apt-get install xrdp
After that, open the remote desktop on the Windows computer. Open method is: Enter the run in mstsc
to.
In the remote desktop software, enter the IP address of the Raspberry Pi, and then click Connect. Then enter the user name and password of the Raspberry Pi in the pop-up interface.
Finally, recently many friends asked me for the Linux learning roadmap , so based on my experience, I spent a month staying up late in my spare time and compiled an e-book. Whether you are in an interview or self-improvement, I believe it will help you! The directory is as follows:
Give it to everyone for free, just ask you to give me a thumbs up!
Ebook | Linux development learning roadmap
I also hope that some friends can join me to make this e-book more perfect!
Gain? I hope the old irons will have a three-strike combo so that more people can read this article
Recommended reading: