01_樹莓派開發環境搭建

1. 樹莓派簡介

Raspberry Pi(中文名爲「樹莓派」), 是爲學生計算機編程教育而設計,只有信用卡大小的微型電腦,其系統基於Linux。python

2. 燒錄系統

官網下載:https://www.raspberrypi.org/downloads/raspbian/編程

3.樹莓派系統啓動

開啓SSH:sudo raspi-config ->Interfacing Options -> SSHbootstrap

4. 樹莓派系統設置

sudo raspi-config -> Localisation Optionsdom

5. 樹莓派顯示中文

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ttf-wqy-zenhei

sudo raspi-config ->Localisation Options ->Change Locale ->zh_CN * ->sudo reboot設計

6. 固定樹莓派IP

sudo nano /etc/dhcpcd.conf
# wifi鏈接 wlan0           網線鏈接 eth0
interface eth0
static ip_address=192.168.1.188/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 114.114.114.114

interface wlan0
static ip_address=192.168.1.188/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 114.114.114.114
sudo reboot

7. 鏈接Wi-Fi

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
        ssid="coco414"
        psk="coco-414"
        key_mgmt=WPA-PSK
}

8. 更換阿里源

sudo nano /etc/apt/sources.list
deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi
sudo nano /etc/apt/sources.list.d/raspi.list
deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main
sudo apt-get update
sudo apt-get upgrade

9.pip安裝

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
pip -V

10.設置樹莓派屏幕常亮,禁止樹莓派屏幕休眠

sudo nano /etc/lightdm/lightdm.conf
# 找到[Seat:*]這一項,在下面的‘#xserver-command=X’刪除前面的註釋符#,修改成如下
xserver-command=X -s 0 -dpms
# 其中,-s 參數:設置屏幕保護不啓動,0 數字零,-dpms 參數:關閉電源節能管理。
#保存退出:Ctrl+X,按Y 再按回車。
sudo reboot
相關文章
相關標籤/搜索