Four login methods for Raspberry Pi

Method 1: (HDMI)

HDMI video connection, connected to the monitor (I use less, I haven’t tried it, and I won’t introduce it in detail at the moment)

Method two: (serial port)

Because the serial port of the Raspberry Pi is connected to Bluetooth by default, some configuration is required to log in to the Raspberry Pi through the serial port

1. Preparation tools: one USB-TTL conversion module, one SD card, one card reader, one Raspberry Pi, one computer.

2. Modify the configuration: open the " config.txt " file in the root directory of the SD card with a card reader , add the following content at the end of the file and save it.

dtoverlay=pi3-miniuart-bt

This stops the Bluetooth occupation of the serial port.

Then modify the " cmdline.txt " of the root directory and replace all the contents with the following contents. For safety, please backup the original contents of this file first, and then replace the contents with the following contents.

dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

3. Insert the configured SD card on the Raspberry Pi

4. Download the software SecureCRT

https://www.vandyke.com/products/securecrt/

5. Serial software configuration: Options--------->Terminal---------> Linux ---------->Emulation

6. Connection: USB-TTL connection with Raspberry Pi

7. Connect the USB-TTL to the computer, turn on SecureSRT, select serial as the connection method , and the baud rate is 115200

8. Login: default account: pi       ;      default password: raspberry

Method Three: (Network Login SSH) This method is the most used

1. Proceed to method two first, after entering the Linux command terminal of the Raspberry Pi, you can change the settings and let the Raspberry Pi connect to the network. 

2. Enter the command: (Nano is a text editor, you can write as soon as you enter, or you can replace nano with vim)

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf 

3. Modify the configuration: add the code at the end of the file, and replace ssid_name and password 

network={
        ssid="ssid_name"     //将ssid name替换成你的WiFi的名字   
        psk="password"       //将password 改成 你的WiFi密码
        key_mgmt=WPA-PSK     //加密方式,可不写
}

4. Save: Ctrl + o; Exit: Ctrl + x

5. Check whether the connection is successful: enter the command ifconfig to check whether the connection is successful, if wlan 0 is displayed, the connection is successful

6. Restart: sudo reboot

// After performing the above six steps, it means that the Raspberry Pi can be used for SSH login, but the IP address of the Raspberry Pi is still changing, which is not convenient for subsequent development, so the IP address of the Raspberry Pi needs to be fixed

7. Fix the IP address of the Raspberry Pi :

Step 1 : Enter the command ifconfig: view your IP address and record it

Step 2 : Enter the command sudo nano /etc/rc.local

Step 3 : Add on exit 0

ifconfig wlan0 192.168.55.123 “你记录下来的IP地址”

Step 4 : Save: Ctrl + o

Step 5 : Exit: Ctrl + x

Step 6 : Reboot: sudo reboot

8. Log in to Raspberry Pi via SSH

Step 1 : Enter the command: sudo raspi-config

Step 2 : Use the arrow keys to select 5 Interfacing Options----->Enter----->P2 SSH----->Yes----->Enter----->OK-- ---->finish----->Enter

Step Three : Click the mouse software over the third row of the second icon of lightning ⚡ symbol

Step 4 : Protocol:  SSH2   ; host name: your IP address   ; port: 22 (don’t care about the port number); user name: pi

   

Step Five : Click Connect

Step 6 : Enter username: pi    password: raspberry

Method 4: (Login with Graphical Interface)

1. Download xrdp    ----> enter the command: sudo apt-get install xrdp

2. Locate the computer to start inside the Remote Desktop Connection (window10 computer comes)

3. Fill in the IP address of the Raspberry Pi and click to connect

4. Enter the user name and password (the second line is the user name: pi; the third line is the password: raspberry)

 

  

Guess you like

Origin blog.csdn.net/weixin_49472648/article/details/109954120