preface

The raspberry pie I bought since the last article has been obtained, and the intranet penetration is perfect to access the educational administration system through the internet. However, I encountered several pitfalls during this period, so I will record them here. First, the service of Raspberry Pie to connect to ssh needs to be started at boot. Second, the problem of wifi connection configuration. Finally, after the FRP is added and restarted since startup, it can't be started normally. This new article records that the following is a reprint of Raspberry Pie Labs Raspberry Pie WiFi and SSH without screen and keyboard Full text of the article.


It's not a new function. Shortly after the launch of Raspberry Pie 3B, the official Raspbian system of Raspberry Pie has long added a mechanism that allows the WiFi network to be configured before startup.

1、 WiFi network configuration

The user can independently modify the/boot/wpa_supplicant.conf file to configure the SSID and password of WiFi when the raspberry pie is not started, so that the raspberry pie will automatically read the wpa_supplicant.conf configuration file to connect to the WiFi device after it is started.

The operation method is simple: read the SD card of Raspbian system with a computer. Create a new wpa_supplicant.conf file in the boot partition, that is, the/boot directory of Raspberry Pie, fill in the content according to the following reference format, and save the wpa_supplicant.conf file.

 country=CN ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="WiFi-A" psk="12345678" key_mgmt=WPA-PSK priority=1 } network={ ssid="WiFi-B" psk="12345678" key_mgmt=WPA-PSK priority=2 scan_ssid=1 }

Description and WiFi configuration examples with different security:
#Ssid: The ssid of the network
#Psk: Password
#Priority: connection priority. The higher the number, the higher the priority (can't be negative)
#Scan_ssid: This value needs to be specified as 1 when connecting to hidden WiFi

If your WiFi doesn't have a password

 network={ Ssid="Your wireless network name (ssid)" key_mgmt=NONE }

If your WiFi uses WEP encryption

 network={ Ssid="Your wireless network name (ssid)" key_mgmt=NONE Wep_key0="Your wifi password" }

If your WiFi uses WPA/WPA2 encryption

 network={ Ssid="Your wireless network name (ssid)" key_mgmt=WPA-PSK Psk="Your wifi password" }

If you don't know the encryption mode of WiFi, you can open it with root explorer on Android phones /data/misc/wifi/wpa/wpa_supplicant.conf , view the WiFi information.

2、 Enable SSH service

If the message Access denied appears when connecting to Raspberry pie through ssh, it indicates that the ssh service is not enabled. If you want to start it manually, it is similar to the WiFi configuration. Also, create a new file in the boot partition. If it is blank, the file name is ssh. Be careful to lower case without any extension.
Raspberry Pie will automatically enable the ssh service after detecting this file after starting. Then you can log in to the router to find the IP address of Raspberry Pie, and connect to Raspberry Pie through SSH.

If you need to operate the raspberry pie in the remote desktop mode, you can install xrdp through ssh, and then connect to the raspberry pie with the remote desktop client of Windows.

Last modification: April 25, 2018
If you think my article is useful to you, please feel free to appreciate it