安装镜像
1,格式化内存卡用第一个工具
2,把镜像写道内存卡中用第二个工具
登录
串口登录
因为树莓派默认的是蓝牙连接,我们要断开蓝牙连接,打开串口连接。
将安装好的sd卡文件夹下的
cmdline.txt文件的内容修改为
dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
config.txt文件内容修改为
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
dtoverlay=pi3-disable-bt
start_x=1
gpu_mem=128
此后将SD卡取出插到树莓派上,使用串口转ttl就可以串口登录。连接电脑在secureCRT
上使用串口登录。
网络登录
1,使用串口登录上去过后使用命令
Nano是文档编辑器,已进入便可以编写。
Ctrl+o 保存,会有提示是否写入。我们按回车。Ctrl+x退出
sudo nano /etc/wpa_supplicant//wpa_supplicant.conf
配置好network
2,在使用命令打开树莓派ssh登入
sudo raspi-config
使能ssh选项
在使用命令sudo reboot
在使用secureCRT来用网络登录
如果没有连上网,说明没有开启射频
rfkill list
需要打开网卡
rfkill unblock all
在使用
sudo ifconfig wlan0 up
系统已经存在打开的多个wpa_supplicant实例,执行killall wpa_supplicant杀死所有wpa_supplicant即可。
3,固定ip地址
用ifconfig查看ip地址
sudo nano /etc/rc.local
这个是操作系统初始话时会调用的shell脚本
在图中位置加上
ifconfig wlan0 192.168.31.135
至此配置完闭
树莓派换源
1, 默认的源是国外的,apt-get 安装的时候失败,我们更新成国内的源
2,使用命令
sudo nano /etc/apt/sources.list
把原本的用#注释了加上中国的源
deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib rpi
在使用命令更新
sudo apt-get update
在更新vim
sudo apt-get install vim