老周有AI

计算机视觉与人工智能技术分享

utools 在 ubuntu 22.04 运行不起来

utools 是一个非常好的工具,可以在各个平台使用。

官网链接 https://u.tools/

NanoPi R6C 更换源报错

Ubuntu 22.04 LTS 阿里源更换后报错。

E: Failed to fetch  http://mirrors.aliyun.com/ubuntu-ports/dists/jammy/main/binary-arm64/Packages  404  Not Found [IP: 124.72.132.77 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu-ports/dists/jammy-security/main/binary-arm64/Packages  404  Not Found [IP: 124.72.132.77 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu-ports/dists/jammy-updates/main/binary-arm64/Packages  404  Not Found [IP: 124.72.132.77 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu-ports/dists/jammy-proposed/main/binary-arm64/Packages  404  Not Found [IP: 124.72.132.77 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu-ports/dists/jammy-backports/main/binary-arm64/Packages  404  Not Found [IP: 124.72.132.77 80]

解决方案

sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
sudo gedit /etc/apt/sources.list

NOTE: 在ubuntu后面加上-ports

deb http://mirrors.aliyun.com/ubuntu-ports/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu-ports/ jammy-backports main restricted universe multiverse

[参考]

[踩坑记录] aarch64版本Ubuntu apt-get更换阿里源后更新失败
ubuntu 22.04如何更换阿里源

仓库角落里发现了一个迷你小电脑 (nanoPC), 连上显示器和键鼠,进去不记得密码了,不得不重新刷一下系统。想装一个桌面系统,所以找了一圈,找到 nanoPC的官网

nanoPC-T4 刷桌面

准备好相关工具

软件

  1. 瑞芯微驱动助手,DriverAssitant_v4.5
  2. 系统固件,rk3399-usb-friendlydesktop-bionic-4.4-arm64-20220919

百度网盘链接 提取码:8888

硬件

  1. nanoPC-T4
  2. 键鼠
  3. 显示器及连接线
  4. type-c连接线

开始刷机

  1. Windows上安装 USB 驱动助手;
  1. nanoPC 上电,USB 连接宿主电脑(Windows
  2. 解压刷机文件 rk3399-usb-friendlydesktop-bionic-4.4-arm64-20220919, 找到文件 RKDevTool,双击打开,会显示没有找到设备,需要重启启动并 reset nano
  3. 按照下图所示,

按住Recovery键再长按(1.5秒以上)Power键开机,并同时按住reset键,然后松开,如果 RKDevTool显示发现设备,那么可以在 下载镜像 Tab 页面点击 执行。静等即可。

  1. 最后可以看到nanoPC重启后的桌面。
 普通用户:
    用户名: pi
    密码: pi
 Root用户: 
    用户名: root
    密码: fa

官方步骤

我这里实验用的 Windows Type-C 线刷的方式。

【参考】

  1. https://wiki.friendlyelec.com/wiki/index.php/NanoPC-T4/zh
  2. https://wiki.friendlyelec.com/wiki/index.php/NanoPC-T4/zh#FriendlyDesktop.E7.B3.BB.E7.BB.9F.E7.9A.84.E4.BD.BF.E7.94.A8
  3. https://blog.csdn.net/zhzwang/article/details/107761180
  4. https://blog.csdn.net/qq_66258329/article/details/126512220
  5. https://www.jianshu.com/p/61074d123878

【问题】

nanoPC-T4 在 # sudo apt update 和 sudo apt upgrade升级或安装软件 sudo apt install xxx时遇到以下问题:Failed to set up interface with /etc/hostapd/

Setting up hostapd (2:2.6-15ubuntu2.8) ...
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript hostapd, action "restart" failed.
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2022-11-11 07:23:16 UTC; 22ms ago
  Process: 12218 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)

Nov 11 07:23:16 NanoPC-T4 systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Nov 11 07:23:16 NanoPC-T4 hostapd[12218]: Configuration file: /etc/hostapd/hostapd.conf
Nov 11 07:23:16 NanoPC-T4 hostapd[12218]: Could not open configuration file '/etc/hostapd/hostapd.conf' for reading.
Nov 11 07:23:16 NanoPC-T4 hostapd[12218]: Failed to set up interface with /etc/hostapd/hostapd.conf
Nov 11 07:23:16 NanoPC-T4 hostapd[12218]: Failed to initialize interface
Nov 11 07:23:16 NanoPC-T4 systemd[1]: hostapd.service: Control process exited, code=exited status=1
Nov 11 07:23:16 NanoPC-T4 systemd[1]: hostapd.service: Failed with result 'exit-code'.
Nov 11 07:23:16 NanoPC-T4 systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
dpkg: error processing package hostapd (--configure):
 installed hostapd package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 hostapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

【解决】

发现问题

Could not open configuration file '/etc/hostapd/hostapd.conf' for reading.

在目录下查看 hostapd.conf, 发现没有该文件,当然无法打开配置文件了。

如何重新找到该文件

在目录 /usr/share/doc/hostapd 下可以看到有一个 README.Debian 文件, 文件内容如下:

hostapd for Debian
------------------

This package provides two methods for managing hostapd process(es); an
initscript and an ifupdown hook. Both methods require creation of a
hostapd daemon configuration file (eg. /etc/hostapd/hostapd.conf) to
function correctly.

An example hostapd.conf may be used as a template but _must_ be edited
to suit your local configuration. An example is located at:
  /usr/share/doc/hostapd/examples/hostapd.conf.gz

To use the example as a template:
  # zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz > \
  	/etc/hostapd/hostapd.conf
  # $EDITOR /etc/hostapd/hostapd.conf

To use the initscript method of starting a hostapd daemon see
/etc/default/hostapd.

To use the ifupdown method, the path to hostapd configuration file can
be specified in a network interfaces configuration stanza in
/etc/network/interfaces like so:

iface eth1 inet static
	hostapd /etc/hostapd/hostapd.conf
	...

The hostapd process will be started in the pre-up phase of ifup, and be
terminated in the post-down phase of ifdown.

 -- Kel Modderman <kel@otaku42.de>  Tue, 27 Oct 2009 12:03:01 +1000

Please note:
* If you want to use hostapd with a Prism2/2.5/3 card in WPA mode, you'll need
  STA firmware version >= 1.7.0.

 -- Faidon Liambotis <faidon@cube.gr>, Mon, 10 Oct 2005 14:57:11 +0300

done

zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz > /etc/hostapd/hostapd.conf

或者下载 地址

pi@NanoPC-T4:~$ sudo apt update
Hit:1 http://ports.ubuntu.com bionic InRelease
Hit:2 http://ports.ubuntu.com bionic-backports InRelease
Hit:3 http://ports.ubuntu.com bionic-proposed InRelease
Hit:4 http://ports.ubuntu.com bionic-security InRelease
Hit:5 http://ports.ubuntu.com bionic-updates InRelease
Reading package lists... Done                      
Building dependency tree       
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
pi@NanoPC-T4:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  u-boot-tools xserver-common xserver-xorg-core xserver-xorg-legacy
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

看起来好像可以升级不报错了。不知道后面有没有后遗症。暂时不用科学上网了。

【其他】

ssh 登录 nanoPC-T4

ssh pi@pi_addr  # 例如: pi@192.168.0.49

然后输入密码 pi。就可以远程访问和操作nanoPC-T4了

Warning: Permanently added '192.168.0.49' (ECDSA) to the list of known hosts.
pi@192.168.0.49's password: 
 _____     _                _ _       _____ _     _____ ____ 
|  ___| __(_) ___ _ __   __| | |_   _| ____| |   | ____/ ___|
| |_ | '__| |/ _ \ '_ \ / _` | | | | |  _| | |   |  _|| |  
|  _|| |  | |  __/ | | | (_| | | |_| | |___| |___| |__| |___ 
|_|  |_|  |_|\___|_| |_|\__,_|_|\__, |_____|_____|_____\____|
                                |___/                      

Welcome to Ubuntu 18.04.6 LTS 4.4.179
System load:   0.00            	Up time:       9 min		Local users:   2          
Memory usage:  10 % of 3845Mb 	IP:            192.168.0.49
CPU temp:      42°C         
Usage of /:    44% of 8.2G   

 * Documentation: http://wiki.friendlyarm.com/Ubuntu
 * Forum: http://www.friendlyarm.com/Forum/

To run Qt5 demo, type "qt5demo" at the command prompt and then hit the enter key.
To play a video demo, use command "sudo gst-player.sh".
Last login: Fri Nov 11 08:12:07 2022

pi@NanoPC-T4:~$ ls
demo.mp4  Desktop  Documents  Downloads  h264ify   Music  Pictures  Public  Templates  Videos

远程拷贝和下载资料

scp pi@192.168.0.49:/usr/share/doc/hostapd/README.Debian /home/john/Documents/

输入密码 pi。就可以下载资料了。

nanoPC-T4 安装 OpenCV

Note: OpenCV has been pre-installed in FriendlyCore/FriendlyDesktop (Version after 201905) and does not require manual installation.

Please download the latest FriendlyCore/FriendlyDesktop Image file from the following URL: http://download.friendlyarm.com

参考 nanoPC-T4 环境配置
【边缘设备】基于RK3399核心板的nanoPC-T4 线刷桌面版系统

【边缘设备】nanoPC-T4 线刷ubuntu2004核心非桌面版

【边缘设备】解决nanoPC-T4 upgrade报错

【边缘设备】nanoPC-T4 挂载NVME硬盘

安装OpenCV

按照上述配置刷机系统已经预装了 OpenCV;

建立 Python3 的 OpenCV 开发环境

注意:这里仅仅拷贝激活脚本,不做其他任何操作

git clone https://github.com/friendlyarm/install-opencv-on-friendlycore
cd install-opencv-on-friendlycore
cp examples/py/cv-env.sh /usr/bin/

测试

pi@NanoPC-T4:/media/nvme/install-opencv-on-friendlycore$ cd examples/py/
pi@NanoPC-T4:/media/nvme/install-opencv-on-friendlycore/examples/py$ . cv-env.sh 
(cv) pi@NanoPC-T4:/media/nvme/install-opencv-on-friendlycore/examples/py$ python ver.py 
4.2.0

虚拟环境激活 . cv-env.sh
虚拟环境退出 deactivate

建立 C++ 的 OpenCV 开发环境

OpenCVnanoPC-T4 里已经预装了。

命令查看下版本号,/usr/local/bin/opencv_version

.
├── CMakeLists.txt
├── README.md
├── sample.png
└── showimage.cpp
# cmake needs this line 
cmake_minimum_required(VERSION 2.8) 

# Enable C++11 
set(CMAKE_CXX_STANDARD 11) 
set(CMAKE_CXX_STANDARD_REQUIRED TRUE) 

# Define project name 
project(showimage) 

# Find OpenCV, you may need to set OpenCV_DIR variable 
# to the absolute path to the directory containing OpenCVConfig.cmake file 
# via the command line or GUI 
find_package(OpenCV REQUIRED COMPONENTS core highgui calib3d) 
include_directories( ${OpenCV_INCLUDE_DIRS} ) 

# Declare the executable target built from your sources 
add_executable(showimage showimage.cpp) 

# Link your application with OpenCV libraries 
target_link_libraries(showimage ${OpenCV_LIBS})
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <cstdlib>
#include <stdio.h>
#include <time.h> 

using namespace std;
using namespace cv;

int main(int argc,char* argv[]) 
{
	Mat image = imread("sample.png");
	if (image.empty())
	{
		cout<<"no image"<<endl;
		return -1;
	}	
	imshow("test", image);
	waitKey(0);	
	destroyAllWindows();
    return 0;
}
mkdir build 
cp sample.png build/
cd build
cmake .. 
make -j4
./showimage

别急,执行完这里会黑屏的,那还是因为环境没有配好,和代码没有关系。

继续执行以下命令:

su pi

输入密码: pi

export DISPLAY=:0.0
. setqt5env

再执行 ./showimage 效果正常。

【参考】

  1. install-opencv-on-friendlycore
  2. 官网 Wiki

nanoPC-T4 安装 ncnn

参考 nanoPC-T4 环境配置
【边缘设备】基于RK3399核心板的nanoPC-T4 线刷桌面版系统

【边缘设备】nanoPC-T4 线刷ubuntu2004核心非桌面版

【边缘设备】解决nanoPC-T4 upgrade报错

【边缘设备】nanoPC-T4 挂载NVME硬盘

ncnn 库是深度学习理库最好的,没有之一

ncnn官网

  1. 下载代码仓库
git clone https://github.com/Tencent/ncnn.git
  1. 编译安装
cd ncnn
mkdir build && cd build
cmake -DNCNN_BUILD_TOOLS=OFF ..
make -j4
make install 
  1. 使用

在项目的 CMakeLists.txt 里加入

# ncnn路径设置
set(NCNN_DIR "/media/nvme/ncnn/build/install")
set(NCNN_INCLUDE_DIR "${NCNN_DIR}/include/ncnn")
set(NCNN_LIB_DIR "${NCNN_DIR}/lib")
include_directories("${NCNN_INCLUDE_DIR}")
link_directories("${NCNN_LIB_DIR}")
list(APPEND EXTRA_LIBS ncnn)

在对应的生成库或者生成应用程序里链接ncnn的库

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ${EXTRA_LIBS} -lpthread -lm)

${CMAKE_PROJECT_NAME} 替换成自己的库或者程序名称

步骤如下

检测NVME硬盘

cat /proc/partitions 

输出

major minor  #blocks  name

   1        0       4096 ram0
   1        1       4096 ram1
   1        2       4096 ram2
   1        3       4096 ram3
   1        4       4096 ram4
   1        5       4096 ram5
   1        6       4096 ram6
   1        7       4096 ram7
 259        0  488386584 nvme0n1
 179        0   15267840 mmcblk1
 179        1       4096 mmcblk1p1
 179        2       4096 mmcblk1p2
 179        3       4096 mmcblk1p3
 179        4      12288 mmcblk1p4
 179        5      32768 mmcblk1p5
 179        6      32768 mmcblk1p6
 179        7    6553600 mmcblk1p7
 179        8    8611840 mmcblk1p8
 179       96       4096 mmcblk1rpmb
 179       64       4096 mmcblk1boot1
 179       32       4096 mmcblk1boot0

如果有 nvme0n1 就说明有 NVME SSD硬盘。可以进行下一步。

分区

只分一个区

(echo g; echo n; echo p; echo 1; echo ""; echo ""; echo w; echo q) | sudo fdisk /dev/nvme0n1

输出

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x5b899dc5.

Command (m for help): Created a new GPT disklabel (GUID: 41364481-DE8B-DA4B-AF5B-3966AF3946FB).

Command (m for help): Partition number (1-128, default 1): Value out of range.
Partition number (1-128, default 1): First sector (2048-976773134, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-976773134, default 976773134): 
Created a new partition 1 of type 'Linux filesystem' and of size 465.8 GiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

格式化 EXT4

sudo mkfs.ext4 /dev/nvme0n1p1

输出

mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done                          
Creating filesystem with 122096385 4k blocks and 30531584 inodes
Filesystem UUID: 6b369f2f-173b-4bbf-bbf9-4668e137cbef
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000

Allocating group tables: done                          
Writing inode tables: done                          
Creating journal (262144 blocks): 
done
Writing superblocks and filesystem accounting information:        
done

系统启动自动挂载

1. 查看BlockID

sudo blkid /dev/nvme0n1p1

输出

/dev/nvme0n1p1: UUID="6b369f2f-173b-4bbf-bbf9-4668e137cbef" TYPE="ext4" PARTUUID="9e55ee97-8c07-504e-beef-e7963967e9bf"

修改 fstab

sudo vi /etc/fstab

UUID=6b369f2f-173b-4bbf-bbf9-4668e137cbef /media/nvme ext4 defaults 0 0

建立目录和修改权限

sudo mkdir -p /media/nvme
sudo chmod 777 /media/nvme

挂载

sudo mount /media/nvme

重启

sudo reboot

定制命令行的欢迎信息

欢迎信息如下

 _____     _                _ _       _____ _     _____ ____ 
|  ___| __(_) ___ _ __   __| | |_   _| ____| |   | ____/ ___|
| |_ | '__| |/ _ \ '_ \ / _` | | | | |  _| | |   |  _|| |  
|  _|| |  | |  __/ | | | (_| | | |_| | |___| |___| |__| |___ 
|_|  |_|  |_|\___|_| |_|\__,_|_|\__, |_____|_____|_____\____|
                                |___/                  

如何修改显示的内容呢?

修改方式,找到 /etc/update-motd.d/10-header文件,修改其中的

TERM=linux toilet -f standard -F metal $BOARD_VENDOR

TERM=linux toilet -f standard -F metal $COMPANY

修改时区

例如更改为Shanghai时区:

sudo rm /etc/localtime
sudo ln -ls /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  1. 替换内核下面的两个文件,重新编译内核:
    kernel/logo.bmp
    kernel/logo_kernel.bmp
  2. 或者使用脚本来操作,如下所示:

NOTE:

下载仓库

git clone https://github.com/friendlyarm/sd-fuse_rk3399
cd sd-fuse_rk3399

将需要替换的 logo 放到 sd-fuse_rk3399/files 文件夹下,并命名为 logo.jpg

图片转换

convert files/logo.png -type truecolor /tmp/logo.bmp
convert files/logo.png -type truecolor /tmp/logo_kernel.bmp

新装的系统可能没有 convert 命令, 会报错,所以需要先安装软件包
sudo apt-get install imagemagick

打包与编译内核

LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh eflasher
LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh friendlydesktop-arm64
./mk-emmc-image.sh friendlydesktop-arm64

这中间可能会退出,因为没有 /opt/FriendlyARM/toolchain/6.4-aarch64 目录和相关的交叉编译工具;终端会有如下提示。

root@NanoPC-T4:/media/nvme/sd-fuse_rk3399# LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh eflasher
please install aarch64-gcc-6.4 first, using these commands: 
\tgit clone https://github.com/friendlyarm/prebuilts.git -b master --depth 1
\tcd prebuilts/gcc-x64
\tcat toolchain-6.4-aarch64.tar.gz* | sudo tar xz -C /

按照提示输入以上命令(NOTE: 还是会报错,不要执行以下命令):

git clone https://github.com/friendlyarm/prebuilts.git -b master --depth 1
cd prebuilts/gcc-x64
cat toolchain-4.9.3-armhf.tar.gz* | sudo tar xz -C /
cat toolchain-6.4-aarch64.tar.gz* | sudo tar xz -C /

报错信息

/opt/FriendlyARM/toolchain/6.4-aarch64/bin/aarch64-linux-gnu-gcc: 1: /opt/FriendlyARM/toolchain/6.4-aarch64/bin/aarch64-linux-gnu-gcc: ELF: not found /opt/FriendlyARM/toolchain/6.4-aarch64/bin/aarch64-linux-gnu-gcc: 2: /opt/FriendlyARM/toolchain/6.4-aarch64/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected scripts/kconfig/conf  --silentoldconfig Kconfig

查找了编译链版本,版本对不上,一般情况下该类问题都是因为环境有问题。那么有了最新的7.5版本的就不用6.4版本的了。需要修改 build-kernel.shexport PATH=/opt/FriendlyARM/toolchain/6.4-aarch64/bin:$PATH (如果已经安装了,注释掉该段代码)

如果还没有安装6.4版本的编译器,这一段代码也可以注释掉:

#if [ ! -d /opt/FriendlyARM/toolchain/6.4-aarch64 ]; then
#	echo "please install aarch64-gcc-6.4 first, using these commands: "
#	echo "\tgit clone https://github.com/friendlyarm/prebuilts.git -b master --depth 1"
#	echo "\tcd prebuilts/gcc-x64"
#	echo "\tcat toolchain-6.4-aarch64.tar.gz* | sudo tar xz -C /"
#	exit 1
#fi

报错: ./fusing.sh: line 210: ./tools/sd_update: cannot execute binary file: Exec format error

./mk-sd-image.sh friendlydesktop-arm64

File not found: ./friendlydesktop-arm64/partmap.txt, please download the latest version of the image files from http://dl.friendlyarm.com/nanopct4

官网 百度网盘 yn6r
下载

  • 安装完成后,执行 ./clean.sh 命令,清理一下空间

friendlydesktop-arm64-images.tgz

【参考】

  1. 官网

Windows下通过Type-C数据线进行烧写

访问此处的下载地址下载Windows下使用Type-C数据线烧写所需的文件及工具:

视频教程:
https://www.bilibili.com/video/av38052562/

准备

参考 【边缘设备】基于RK3399核心板的nanoPC-T4 线刷桌面版系统

下载 驱动和 rk3399-usb-friendlycore-lite-focal-5.15-arm64-20220919.zip

百度网盘链接 提取码:8888

安装

解压 rk3399-usb-friendlycore-lite-focal-5.15-arm64-20220919.zip 打开其中的 RKDevTool;按住Recovery键再长按(1.5秒以上)Power键开机,并同时按住reset键,然后松开,如果 RKDevTool显示发现设备,那么可以在 下载镜像 Tab 页面点击 执行。静等即可。

NOTE

由于设备之前安装了其他版本的固件,如果遇到不支持写GPT错误信息,可以在升级固件里,重新升级选择 MiniLoaderAll 并升级和擦除 Flash, 然后重新执行下载镜像。

安装完成后,记得

输入用户名: pi 和密码: pi

sudo apt update
sudo apt upgrade

【参考】

  1. https://wiki.friendlyelec.com/wiki/index.php/NanoPC-T4/zh 4.2.2 节

问题

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lap
  Running setup.py clean for lap
Failed to build lap
ERROR: Could not build wheels for lap, which is required to install pyproject.toml-based projects

解决方法

conda install -c conda-forge lap

参考引用

YOLOv8—运行mode=track报错 ERROR: subprocess-exited-with-error与 ERROR: Failed building wheel for lap解决

问题:

conda 创建新的虚拟环境时报错

Collecting package metadata (current_repodata.json): done
Solving environment: done

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/conda/gateways/repodata/__init__.py", line 132, in conda_http_errors
        yield
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/conda/gateways/repodata/__init__.py", line 101, in repodata
        response.raise_for_status()
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/requests/models.py", line 1022, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/current_repodata.json
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/requests/models.py", line 972, in json
        return complexjson.loads(self.text, **kwargs)
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
        return _default_decoder.decode(s)
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
        obj, end = self.raw_decode(s)
      File "/home/xxx/anaconda3/lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
        return self.scan_once(s, idx=_w(s, idx).end())
    simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    
    During handling of the above exception, another exception occurred:

解决办法

conda config --remove-key channels
conda config --append channels conda-forge --append channels bioconda --append channels defaults

参考

Conda更新报错:requests.exceptions.HTTPError: 404

0%