本次开发环境的搭建还是摸索了很久的,踩了很多坑,官方的教程中的镜像和最新的镜像有很多差异,比如
ssh:最新的镜像通过ssh<username>@192.168.7.2并不能直接连接开发板
官方的教程中的镜像有两个usb设备,最新的只有一个·
官方的教程中的镜像RAM total:0.35GB,最新的为0.41GB
我这里两个版本都试过,官方的教程中的镜像不推荐,缺失很多设备树插件,并且官方维护了。那我们就用最新的吧。
下载镜像选择最新的下载
上面这句话一定要看,后面有大用(之前就是没有处理这个导致无法连接SSH的)
下载镜像烧录软件这个有两款,链接如下,我推荐使用bb-imager-rs
bb-imager-rs:
BalenaEtcher:
根据自己的电脑版本选择
镜像烧写基本步骤如下:选择板卡,选择镜像,选择SD卡,直接WRITE
这里不需要去设置用户名密码之类的东西,因为这个修改根本就不起作用,直接烧录就行。
不需要如下操作
然后安心的等待烧录失败,报错(这里我试过20多次,没有一次烧录成功,显示教程中烧录成功的内容,但是镜像可以正常跑起来)
如果出现以下报错,不必理会
修改uboot下sysconf.txt文件,这个一定要烧录完修改,在开发板上修改是不起作用的
# This file will be automatically evaluated and installed at next boot
# time, and regenerated (to avoid leaking passwords and such information).
#
# To force it to be evaluated immediately, you can run (as root):
#
# /usr/sbin/bbbio-set-sysconf
#
# You can disable the file evaluation by disabling the bbbio-set-sysconf
# service in systemd:
#
# systemctl disable bbbio-set-sysconf
#
# Comments (all portions of a line following a '#' character) are
# ignored. This file is read line by line. Valid
# configuration lines are of the form 'key=value'. Whitespace around
# 'key' and 'value' is ignored. This file will be _regenerated_ every
# time it is evaluated.
#
# We follow the convention to indent with one space comments, and
# leave no space to indicate the line is an example that could be
# uncommented.
# root_password - Set a password for the root user (not used in ubuntu)
root_password=kone
# root_authorized_key - Set an authorized key for a root ssh login (not used in ubuntu)
#root_authorized_key=
# user_name - Set a user name for the user (1000)
user_name=kone
# user_password - Set a password for user (1000)
user_password=kone
# user_authorized_key - Set an authorized key for a user (1000) ssh login
#user_authorized_key=
# iwd_psk_file - Set a configuration for iwd https://wiki.archlinux.org/title/iwd
#iwd_psk_file=
# wifi_regdom - Country Code (ISO Alpha-2) Requests the country be set for the system.
#wifi_regdom=US
# hostapd_file - Set a configuration for hostapd https://wiki.gentoo.org/wiki/Hostapd
#hostapd_file=SoftAp0.conf
# hostname - Set the system hostname.
hostname=BeagleBone
# keymap - Set the system keymap.
keymap=us
# timezone - Set the system timezone.
timezone=America/Chicago
# usb_enable_dhcp - enable usb gadget to startup in dhcp mode, useful for Win/Mac with ICS enabled
usb_enable_dhcp=yes
# enable_ufw - enable ufw firewall (https://en.wikipedia.org/wiki/Uncomplicated_Firewall)
enable_ufw=yes
# ufw_allow_ssh - allow ssh access over port 22
ufw_allow_ssh=yes
# ufw_allow_http - allow http access over port 80
ufw_allow_http=yes
# ufw_allow_https - allow https access over port 443
ufw_allow_https=yes
# ufw_allow_nodered - allow nodered access over port 1880 (https://nodered.org/)
ufw_allow_nodered=yes
# ufw_allow_vscode - allow vscode access over port 3000 (https://github.com/coder/code-server)
ufw_allow_vscode=yes
# ufw_allow_vnc - allow vnc access over port 5901
ufw_allow_vnc=yes
# ufw_allow_cockpit - allow cockpit access over port 9090 (https://cockpit-project.org/)
ufw_allow_cockpit=yes
将SD插入开发板上电,可以看到已经正常工作起来了。
这里SSH是不起作用的,串口也不起作用,只有USB可以用(这里应该是一个USB虚拟串口)通过MobaXterm工具进行连接
要想使用SSH,需要将开发板和电脑保持在统一网段。这里为了开发板可以连接外网,进行了网络共享。
查看开发板ip地址
sudo dhclient usb0
ifconfig
在MobaXterm进行SSH连接,并且尝试连接外网ping baidu.com
可以看到ssh和连接外网已经成功。那个VSCode 网页地址同样也变了。
新老镜像之间的差异还是很大的,推荐大家使用新版本。