Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the considerations for getting started with raspberry pi

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what raspberry pi entry notes are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1. The solution to the rejection of SSH connection in the new system

Burn the new raspberry pie system, turn it on and connect remotely with SSH. As a result, the SSH connection prompts "connection refused", causing the connection to raspberry pie to fail. The reason for the error is the Raspbian system image officially released from 2016-11-25, and the SSH service is disabled by default.

As of the November 2016 release, Raspbian has the SSH server disabled by default.

The details of the error are: ssh: connect to host 192.168.0.11 port 22: Connection refused

The official solution is: SSH disabled by default; can be enabled by creating a file with name "ssh" in boot partition

If you have a monitor, turn on SSH in the raspberry pie configuration after you turn it on. But in the absence of a monitor, the first time you need to log in with SSH, you need to go to the boot partition disk and create a new blank file named ssh after the system has been burned.

When you are done, insert the SD card back into the raspberry pie and you can use SSH normally.

Reference: http://www.tuicool.com/articles/M7bQFbI

Second, the tree plum school sets up static IP

Dhcp automatically allocates ip by default for raspberry pie.

According to the hint of / etc/network/interfaces:

First of all, we don't need to change anything in the / etc/network/interfaces file for the new configuration method, just open the file / etc/dhcpcd.conf and add the following code at the end:

Interface eth0

Inform 192.168.0.50

Static routers=192.168.0.1

Static domain_name_servers=192.168.0.1 8.8.8.8

Among them, inform is followed by the static IP you want to set, and other contents are filled in according to your actual situation.

If you want to modify DNS, then you need to modify this file.

Root@raspberrypi:~# sudo cat / etc/resolv.conf

Just change it to something similar.

Nameserver 8.8.8.8

Nameserver 8.8.4.4

Nameserver 208.67.220.220

Nameserver 208.67.222.222

Nameserver 10.10.10.10

Third, the tree plum school sets up static IP and WIFI

Open the network configuration file sudo nano / etc/network/interfaces

Auto lo

Iface lo inet loopback

Iface eth0 inet static

Address 192.168.0.88

Netmask 255.255.255.0

Gateway 192.168.0.1

Auto wlan0

Iface wlan0 inet static

Address 192.168.0.88

Netmask 255.255.255.0

Gateway 192.168.0.1

SSID of wpa-ssid WIFI

Wpa-passphrase WIFI password

# wireless-channel 11 # can be commented out

4. The default user is pi and the password is raspberry

V. on the domestic sources of the Shu Mei School

Modify / etc/apt/source.list file

Replace the source address with deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/

Modify the / etc/apt/sources.list.d/raspi.list file (most of them don't mention this)

Replace the source address with deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/

Official list of sources: http://www.raspbian.org/RaspbianMirrors

VI. About the extended partition of the SD card of Shumei School.

1. Start the tree plum pie and log in to the system for operation. Or operate in the Linux system through a card reader.

two。 First, take a look at the hard drive usage. The command is as follows: df-h

Then use the fdisk command to partition (it's best to be familiar with the use of fdisk before actual operation)

Command format: fdisk / / such as: fdisk / dev/sda

After entering fdisk, use the single button command

M display Help

P list all partitions

D delete partition

N New partition

W save disk exit

Q exit without saving the disk

Fdisk the master device with the following command: sudo fdisk / dev/sda

(if you are operating on a physical machine, the command should be the path of the SD card corresponding to sudo fdisk / dev/sdb)

Press p to list all partitions, so there are two or three partitions

The first partition is the FAT32 partition, which is used for boot

The second partition is the Linux primary partition

The third partition is the Linux Swap swap file partition (there may not be)

Write down the Start Sector number of the primary partition of Linux with a pen (94208 in my img file)

Press the d key Partition Number (partition number) to select 2 to delete the linux primary partition (2nd zone)

If there is a linuxSwap partition, press the d key Partition Number (partition number) to select 3 to delete the linuxSwap partition (the third zone)

Press p to list all partitions, so you can see that only the first partition is left

Press the n key to recreate the linux primary partition

Partition Type (classification type) Select P (Primary)

Partition Number (partition number) Select 2

First Sector (starting Sector) be sure to enter the Start Sector number you just wrote down (mine is 94208)

Last Sector (termination Sector) use the default value and enter directly

Press p key to list all partitions, you can see that there are two partitions, the linux primary partition is in the second, and the starting position is the original location.

Press w key to save disk and exit fdisk

Next, restart immediately (sudo reboot) and don't do anything else (or pop up the memory card)

7. View available serial port information

Pi@raspberrypi:/ $sudo dmesg | grep ttyS* [0.000000] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=72239d9d-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait [0.001187] console [tty1] enabled [0.887850] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87) Base_baud = 0) is a PL011 rev2 [130.952655] usb 1-1.3: ch441-uart converter now attached to ttyUSB0 is all the content of the article "what are the considerations for getting started with raspberry pi" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report