Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
SD卡_TF卡
树莓派_Raspberry-Pi
系统
【嵌入式AI】raspberry pi 安装树莓派系统及配置教程
发布于 2021-07-27 11:06:46 浏览:1484
订阅该版
[tocm] 本教程详细记录了树莓派系统安装及配置的方法。 ## 1 安装树莓派系统 安装树莓派系统主要操作是烧录系统到 micro SD卡。 - 首先需要准备一张 micro SD 卡(一般16G)  - 格式化 SD 卡 链接传送门:链接:https://pan.baidu.com/s/1JJThyXLlkFgQLb3ueI6bKw 提取码:6666 - 若SD卡大于32G,SD Formatter会默认以exFAT的格式进行格式化,而Raspberry Pi目前的机型都还不支持对该格式的识别,因此才会无法识别大于32GB的卡 【解决办法】 将micro SD卡格式运用DiskGenius化成FAT格式就行。 更加强大的格式化工具 DiskGenius,链接传送门:http://www.diskgenius.cn/download.php   - 从树莓派官网下载 Raspberry Pi Imager 链接传送门:https://www.raspberrypi.org/software/   在 Operating System处选择系统,在 Storage 处选择要烧录到的SD卡。  点击 WRITE 等待烧录完成即可。 ## 2 网络配置 - 有线网络配置 修改配置文件 ```shell sudo cp /etc/dhcpcd.conf /etc/dhcpcd.conf_backup sudo vi /etc/dhcpcd.conf ``` 末尾添加设置即可,其中192.168.128.100/24 ,24 代表 255.255.255.0 ```shell interface eth0 static ip_address=192.168.128.100/24 static routers=192.168.1.1 static domain_name_servers=202.102.152.3 114.114.114.114 8.8.8.8 ``` - 无线网络配置 可根据开机提示直接连接,也可通过配置相关文件设置静态IP。 介绍将wifi设置为静态IP,修改文件/etc/network/interfaces ```shell sudo cp /etc/network/interfaces /etc/network/interfaces_backup sudo vi /etc/network/interfaces ``` 将其中的wla0 无线端口进行修改,修改配置如下。 ```shell #allow-hotplug wlan0 #iface wlan0 inet manual #wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf auto wlan0 iface wlan0 inet static address 192.168.1.211 netmask 255.255.255.0 gateway 192.168.1.1 wpa-ssid C4 wpa-passphrase 1234567890 ``` 其中 wpa-ssid C4 为无线账号,C4 wpa-passphrase 1234567890 ,无线密码1234567890 ## 3 换源 - 树莓派换源 ```shell sudo vi /etc/apt/sources.list ``` 接着编辑这个文件,如下图所示,把原来的内容注释掉(最前面加 # 号),在文件最顶部添加下面的内容: ```shell deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib ``` 同样的方法,把 `/etc/apt/sources.list.d/raspi.list` 文件也替换成下面的内容: ```shell deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui ``` ## 4 ssh 与 vscode 远程 - 安装 ssh 树莓派端安装 ssh ```shell sudo apt update sudo apt apt install -y --no-install-recommends openssh-server ``` - windows 端cmd连接 ```shell ssh pi@ip ``` 输出,说明ssh可以连接:  - vscode远程 **树莓派端:** ```shell sudo vim /etc/ssh/sshd_config ``` 修改下面几行 ```shell # AuthenticationLoginGraceTime 120PermitRootLogin yesStrictModes yes ``` 重启ssh ```shell sudo service ssh start ``` 判断ssh服务是否启动成功  设置ssh开启自动启动: ```shell # 开机自动启动ssh命令sudo systemctl enable ssh ``` **windows端vscode:** 在设置面板中打开应用->可选功能->搜索 SSH,如下图所示,将两个都安装好。  vscode 安装 Remote Development 插件,此插件包括三个小插件分别是 Remote – WSL、Remote – Contaomers 和 Remote – SSH,我们用到的就是 Remote – SSH。  安装好 Remote Development 和 python 插件后在 vscode 左侧就有一个小电视机的图标,点击此图标后选择 SSH Targets,之后点击小齿轮设置,选择设置搜索框中选中第一个,之后出现 SSH 远程设置界面,其中 Host 是指在 vscode 中远程连接的名字,Hostname 值的是宿主机下的 IP 地址,User 写pi即可,Port 是指 写 22 号端口 映射到宿主机下的端口。    启动远程连接:  之后选择 Linux,按照提示连接即可。 - 若vscode出现如下连接异常   则说明在 C:\Users\Admin/.ssh.known_hosts的第三行存在重复密钥,加载了原先的错误密钥,导致连接不上。 **【解决办法】** 清空 C:\Users\Admin/.ssh.known_hosts文件中内容重新连接即可
0
条评论
默认排序
按发布时间排序
登录
注册新账号
关于作者
JeremyJ
这家伙很懒,什么也没写!
文章
1
回答
0
被采纳
0
关注TA
发私信
相关文章
1
正点原子miniSTM32开发板读写sdcard
2
sd卡写完断电延时,写入失败
3
SD卡与外置flash(dg25q32)一起应用,挂载spi2总线上
4
SD卡连续读写文件报错
5
usb sd卡模拟U盘出现no data -> disk name
6
sdio 驱动框架可能存在的一个问题?
7
sd card mount to '/' failed。
8
请教关于USB虚拟U盘 ,传输卡顿的问题?
9
studio配置SD卡和虚拟文件系统,测试SD卡写入速度只有100多KB/s?
10
开启多线程文件重入保护,多线程读写文件失败,占用文件描述符入口,导致内存泄露
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
rt-smart
FAL
I2C_IIC
UART
ESP8266
cubemx
WIZnet_W5500
ota在线升级
PWM
BSP
flash
freemodbus
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
keil_MDK
ulog
SFUD
msh
C++_cpp
MicroPython
本月问答贡献
RTT_逍遥
10
个答案
3
次被采纳
xiaorui
3
个答案
2
次被采纳
winfeng
2
个答案
2
次被采纳
三世执戟
8
个答案
1
次被采纳
KunYi
8
个答案
1
次被采纳
本月文章贡献
catcatbing
3
篇文章
5
次点赞
lizimu
2
篇文章
9
次点赞
swet123
1
篇文章
4
次点赞
Days
1
篇文章
4
次点赞
YZRD
1
篇文章
2
次点赞
回到
顶部
发布
问题
投诉
建议
回到
底部