欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

树莓派安装ubuntu server 20.10 笔记本+树莓派

程序员文章站 2022-06-01 12:55:05
...

树莓派安装ubuntu server 20.10 笔记本+树莓派

前言

无外接键盘,显示器和网线,只用笔记本和树莓派

官网

1.树莓派各种支持的系统下载, ubuntu server 推荐Ubuntu Server 20.10https://ubuntu.com/download/raspberry-pi
2.ubuntu的官网安装树莓派的教程:https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview
node:我第一次选择的是Ubuntu Server 20.04.1 LTS(Raspberry Pi 4/ 64 bit)结果安装好后ssh连不上,permission denied,wifi也连不上 后来选用:Ubuntu Server 20.10(Raspberry Pi 4/ 64 bit),直接配置好文件network-config就可以连接wifi了,ssh登录也可以。

准备条件

  1. 笔记本
  2. 树莓派
  3. 路由器

只需要笔记本和树莓派在同一网络,获取到树莓派的IP,后面能用电脑ssh到树莓派系统

软件环境

  1. Windows 10
  2. Respberry Pi Imager
  3. Fing 可选(手机端用于scan IP)
  4. Advanced IP Scanner 可选(电脑端用于scan IP)

按照上面的步骤安装好后,找到respberry的IP地址,电脑端cmd进入
arp -a 查看局域网设备信息,找到类型是动态的Respberry 的IP
用ssh连接,cmd命令,如:ssh [email protected]
第一次登录,默认账号密码都是ubuntu,第一次连接要修改密码,修改成功后再次用新密码登录

相关截图代码

  1. TF卡插入笔记本,修改system boot根目录下的文件:network-config
    设置wifi名称为:wifi-name
    密码:12345678
version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      "wifi-name":
        password: "12345678"

找到RaspberryPi的IP地址

如果电脑和Raspberry在同一网络,根据网卡地址找IP
windows下cmd命令:arp -a | findstr dc-a6-32
返回的结果就是找到的RaspberryPi的IP和网卡地址
参考:
Connect remotely to your Raspberry PiTo connect to your Raspberry Pi remotely, you need two things (we’ll help you find them):
Its IP address on the local network
An SSH client (SSH is a communication protocol between machines)
Determining the Pi’s IP addressTo determine the IP address of your board, open a terminal and run the arp command:On Ubuntu and Mac OS:arp -na | grep -i “b8:27:eb”
If this doesn’t work and you are using the latest Raspberry Pi 4, instead run:arp -na | grep -i “dc:a6:32”

Information

Depending on your version of Ubuntu, you may need to install the net-tools package. Install it with sudo apt install net-tools and try the arp command again.
On Windows:arp -a | findstr b8-27-eb
If this doesn’t work and you are using the latest Raspberry Pi 4, instead run:arp -a | findstr dc-a6-32

相关标签: 树莓派 ubuntu