Raspberry Pi 3 B+ 开箱基本配置(Windows环境下)

前端之家收集整理的这篇文章主要介绍了Raspberry Pi 3 B+ 开箱基本配置(Windows环境下)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. 下载系统

下载 Raspbian,建议下载种子,然后使用迅雷等下载工具下载。
或者在官网上下载名称RASPBIAN STRETCH WITH DESKTOP的系统。

2. 写入SD卡

下载 Win32 Disk Imager,直接下载即可,安装。
将SD卡通过读卡器连接到电脑,从下载的文件(.zip)解压出系统(.img),选择后写入,等待5分钟左右。
写入完成后,在boot盘里新建空白文件ssh,不需要后缀,后续SSH连接时使用。

3. SSH连接

将SD卡插到树莓派上,将树莓派连接到路由器,上电。
登录路由器管理界面,便能看到名为raspberrypi的连接,记下IP地址。
使用Xshell或者Putty等,通过SSH方式登录树莓派,默认帐号pi,密码raspberry

4. 配置网络

给有线网络配置静态IP地址,可通过路由器静态IP配置,也可通过修改树莓派的网络接口配置文件/etc/network/interfaces。配置完都要重启树莓派。
方法一,用ifconfig查看eth0的MAC地址(ether后就是MAC地址),然后使用路由器静态IP配置。

  1. pi@raspberrypi:~ $ ifconfig -a
  2. eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500
  3. ether 12:34:56:78:9a:bc txqueuelen 1000 (Ethernet)
  4. RX packets 0 bytes 0 (0.0 B)
  5. RX errors 0 dropped 0 overruns 0 frame 0
  6. TX packets 0 bytes 0 (0.0 B)
  7. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


方法二,修改树莓派配置文件

  1. pi@raspberrypi:~ $ sudo vi /etc/network/interfaces
  1. # interfaces(5) file used by ifup(8) and ifdown(8)
  2.  
  3. # Please note that this file is written to be used with dhcpcd
  4. # For static IP,consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  5.  
  6. # Include files from /etc/network/interfaces.d:
  7. source-directory /etc/network/interfaces.d
  8.  
  9. auto lo
  10. iface lo inet loopback
  11.  
  12. iface eth0 inet static
  13. address 192.168.0.112
  14. netmask 255.255.255.0
  15. gateway 192.168.0.1

以下是无线配置,如果打算使用有线就跳过无线配置。
修改网络接口配置文件/etc/network/interfaces

  1. pi@raspberrypi:~ $ sudo vi /etc/network/interfaces

在最后添加

  1. auto wlan0
  2. allow-hotplug wlan0
  3. iface wlan0 inet dhcp
  4. wpa-ssid "[YOUR WIFI SSID]"
  5. wpa-psk "[YOUR WIFI PASSWORD]"

这是设置动态IP,静态IP参考有线的配置。

5. 网络名称

默认是raspberrypi,单个修不修改都可以,多个需要辨识就修改一下。
要改两个地方,/etc/hostname/etc/hosts
首先,hostname直接在里面替换掉就可以,必须是一个单词,不能包含任何标点符号和特殊字符(包括下划线_)。

  1. pi@raspberrypi:~ $ sudo vi /etc/hostname

其次,hosts中最后一行,将raspberrypi替换成与前面一致的单词。

  1. pi@raspberrypi:~ $ sudo vi /etc/hosts
  1. 127.0.0.1 localhost
  2. ::1 localhost ip6-localhost ip6-loopback
  3. ff02::1 ip6-allnodes
  4. ff02::2 ip6-allrouters
  5.  
  6. 127.0.1.1 raspberrypi

配置完成后重启树莓派。

6. 图形桌面

使用RDP(Remote Desktop Protocol,远程桌面协议)登录树莓派,需要安装xrdp软件。

  1. pi@raspberrypi:~ $ sudo apt-get install xrdp

xrdp是一个 守护进程,安装完后和树莓派启动时,xrdp服务会自动启动。
在Windows中,按住WIN+R,弹出运行窗口, 输入mstsc,启动远程桌面连接



账户信息和登录树莓派是使用的一样,默认帐号pi,密码raspberry

7. 修改密码

出于安全考虑,通过passwd修改用户piroot密码。

  1. pi@raspberrypi:~ $ sudo passwd pi
  2. Enter new UNIX password:
  3. Retype new UNIX password:
  4. passwd: password updated successfully
  5. pi@raspberrypi:~ $ sudo passwd root
  6. Enter new UNIX password:
  7. Retype new UNIX password:
  8. passwd: password updated successfully

注意RDP登录的密码也受此影响。

8. 更新系统

update从更新源中重新同步包索引文件升级前应始终执行,apt-get才知道有哪些新版本软件包可用。

  1. pi@raspberrypi:~ $ sudo apt-get update

upgrade从更新源中安装当前系统上所有已安装软件的最新版本,耗时较长。

  1. pi@raspberrypi:~ $ sudo apt-get upgrade

将软件源更改为国内源(网络稳定):为树莓派更换国内镜像源

猜你在找的Windows相关文章