Skip to content

Commit

Permalink
Merge pull request #491 from wu-yue-yu/main
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
wonderfullook authored Aug 1, 2023
2 parents 3aae556 + cfd1b87 commit bd470df
Show file tree
Hide file tree
Showing 13 changed files with 598 additions and 8 deletions.
28 changes: 28 additions & 0 deletions docs/hardware/en/lichee/th1520/lpi4a/3_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,34 @@ TODO
![android](./../../../../zh/lichee/th1520/lpi4a/assets/images/android.png)
Readme and image download link: [Click me](https://gitee.com/thead-android/thead-android)

> The Android 13 SDK is still in its infancy, and the problems will be gradually fixed
The precompiled image file of Android 13 is provided in the network disk download link of Sipeed official image, and the burning method after downloading is as follows. Please use the version downloaded from here for the fastboot tool:
https://developer.android.com/tools/releases/platform-tools

There are also fastboot files in the network disk.

```shell
#Burn uboot and initialize boot environment variables
fastboot flash ram u-boot-with-spl.bin
fastboot reboot
fastboot flash uboot u-boot-with-spl.bin

#Burn all partitions
#In the non-boot burning mode, you can enter the command fastboot usb 0 in the uboot command line to burn the partition separately
fastboot flash bootpart bootpart.ext4
fastboot flash boot boot.img
fastboot flash vendor_boot vendor_boot.img
fastboot flash super super.img
fastboot flash userdata userdata.img
fastboot flash vbmeta vbmeta.img
fastboot flash vbmeta_system vbmeta_system.img

#Initialize metadata and misc partition
fastboot erase metadata
fastboot erase misc
```

## Third-party images

The images provided by third parties are listed here for informational purposes only. Sipeed does not guarantee the availability and stability of these images.
Expand Down
8 changes: 7 additions & 1 deletion docs/hardware/en/lichee/th1520/lpi4a/5_desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ You can try the following command to fix it:
```shell
sudo apt-key adv --keyserver keyring.debian.org --recv-keys 'Replace the key value after NO_PUBKEY in the error message here'
# or
gpg --keyserver keyring.debian.org --recv-keys 'Replace the key value after NO_PUBKEY in the error message here'
gpg --keyserver keyserver.ubuntu.com --recv-keys 'Replace the key value after NO_PUBKEY in the error message here'
```
## SSH
Expand Down Expand Up @@ -245,6 +245,12 @@ The Chromium browser is built-in and is available by clicking the browser icon a

![browser_location](./../../../../zh/lichee/th1520/lpi4a/assets/desktop/browser_location.png)

> If the launch bar icon at the bottom of the desktop is displayed abnormally, you can try to use the following commands to fix it:
```shell
cp /etc/xdg/xfce4/panel/default.xml /home/sipeed/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
chown sipeed:sipeed /home/sipeed/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
```

Use a search engine:

![browser_search_engine_use](./../../../../zh/lichee/th1520/lpi4a/assets/desktop/browser_search_engine_use.jpg)
Expand Down
53 changes: 53 additions & 0 deletions docs/hardware/en/lichee/th1520/lpi4a/6_peripheral.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,59 @@ sudo apt-get install fswebcam
fswebcam /dev/video0 image.jpg
```

To allow the USB camera to automatically save images, a reference script is given below. The script uses the uvccapture tool, which makes it easy to adjust capture parameters as needed.

Install this tool first
```shell
sudo apt install uvccapture
```

This tool supports various parameters, use `-x -y` to adjust the shooting resolution, `-B` to adjust the brightness, `-C` to adjust the contrast, `-S` to adjust the saturation, and `-o` to specify the shooting image storage Path, for specific use, refer to the following script code:
```shell
#!/bin/bash

# Check if the interval time parameter is passed in
if [ -z "$1" ]; then
echo -e "The interval time parameter is not specified, and the default interval is 1 second"
interval=1
else
interval=$1
the fi

# Check if the output file path parameter is passed in
if [ -z "$2" ]; then
echo -e "The output file path parameter is not specified, the default output is to the current directory"
output_file="$PWD"
else
output_file=$2
the fi

# Check whether the number of shots parameter is passed in
if [ -z "$3" ]; then
echo -e "The number of shots is not specified, the default is 10 shots"
num_executions=10
else
num_executions=$3
the fi

echo -e "script started, press q to stop"

for ((i = 1; i <= num_executions; i++)); do
echo -e "capture img $i"
uvccapture -x640 -y480 -m -o$output_file/$image$i.jpg
# Take pictures at specified time intervals
sleep $interval
# Press the q key to exit
read -t 1 -n 1 key
if [[ $key = "q" ]]; then
break
the fi
done

echo -e "Script execution ended"
```
The above script can also be operated with fswebcam, just make corresponding changes.

### USB Sound Card

TODO
Expand Down
2 changes: 1 addition & 1 deletion docs/hardware/en/lichee/th1520/lpi4a/7_develop_android.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This project is a repository supported by the Android Open Source Project (AOSP)

> Note that the project is still in the early stage, the current AOSP on Licheepi 4A is not stable and the functionality is not yet complete. A stable version with improved functionality will be updated later, so please keep an eye on this document for updates.
### 快速上手
### Get Started

Before downloading the source code of Android open source project , please check your working environment , it is recommended to use a Linux system with at least 250G free disk space , 16GB + RAM (Ubuntu 20.04 or later version is recommended ) of the working environment , compilation time and the number of processor cores of the host computer is related to the host computer , it is recommended to use a host computer with more cores . It is recommended to use a host with more cores. Due to the network, the download time may vary greatly depending on the network conditions, and it is recommended to use a proxy to download the source code.

Expand Down
186 changes: 185 additions & 1 deletion docs/hardware/en/lichee/th1520/lpi4a/8_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ At this point, the basic python environment has been created. Similar to other a

The opencv installation will depend on other python packages, so if pip does not download them automatically, you can install the dependencies manually first. See [download riscv whl](https://www.yuque.com/za4k4z/uzn618/zsp0krgg9dlp0fhx) for more information on how to get the packages.

**获取 YOLOX 模型**
**Get YOLOX**

[YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) is a YOLO-like target detection model with quite excellent performance.
The source code and model can be downloaded directly from github
Expand Down Expand Up @@ -298,6 +298,187 @@ hello-world latest eb6f80695a28 2 months ago 4.98kB

To experience a more complete image, go [here](https://hub.docker.com/) and search for the name of the distribution you want to use and pull it.

## K3s-RISCV

This chapter will show how to run the lightweight Kubernetes distribution K3s on LPi4A.

First download the precompiled K3s package:
https://github.com/CARV-ICS-FORTH/k3s/releases

Then merge the downloaded packages into a `.gz` file and decompress it. After completion, add execution permission to k3s:
```shell
wget https://github.com/CARV-ICS-FORTH/k3s/releases/download/20230721/k3s-riscv64.gz.aa
wget https://github.com/CARV-ICS-FORTH/k3s/releases/download/20230721/k3s-riscv64.gz.ab
wget https://github.com/CARV-ICS-FORTH/k3s/releases/download/20230721/k3s-riscv64.gz.ac
# The following commands need root user to execute
sudo -i
cat k3s-riscv64.gz.* | gunzip > /usr/local/bin/k3s
chmod +x /usr/local/bin/k3s
exit
```

Verify whether it can run successfully. The typical output of a successful run is as follows:
```shell
sipeed@lpi4a:~$ k3s
NAME:
k3s-riscv64 - Kubernetes, but small and simple

USAGE:
k3s-riscv64 [global options] command [command options] [arguments...]

VERSION:
v1.27.3+k3s-9d376dfb-dirty (9d376dfb)

COMMANDS:
server Run management server
agent Run node agent
kubectl Run kubectl
crictl Run crictl
ctr Run ctr
check-config Run config check
token Manage bootstrap tokens
etcd-snapshot
secrets-encrypt Control secrets encryption and keys rotation
certificate Manage K3s certificates
completion Install shell completion script
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--debug (logging) Turn on debug logs [$K3S_DEBUG]
--data-dir value, -d value (data) Folder to hold state (default: /var/lib/r)
--help, -h show help
--version, -v print the version
```

Now, download and run the k3s install script:
```shell
curl -sfL https://get.k3s.io > k3s-install.sh
chmod +x k3s-install.sh
INSTALL_K3S_EXEC="server --disable metrics-server" INSTALL_K3S_SKIP_DOWNLOAD="true" bash -x ./k3s-install.sh
```

After running, use the following command to check whether k3s is running normally. Typical output is as follows:
```shell
sipeed@lpi4a:~$ systemctl status k3s
● k3s.service - Lightweight Kubernetes
Loaded: loaded (8;;file://lpi4a/etc/systemd/system/k3s.service/etc/systemd)
Active: active (running) since Mon 2023-07-31 06:48:34 UTC; 6s ago
Docs: 8;;https://k3s.iohttps://k3s.io8;;
Process: 3240 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --qu>
Process: 3242 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status>
Process: 3243 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SU>
Main PID: 3244 (k3s-server)
Tasks: 37
Memory: 529.5M
CPU: 54.841s
CGroup: /system.slice/k3s.service
├─3244 "/usr/local/bin/k3s server"
└─3361 "containerd
```
Next, we create a new configuration file to run the k3s container:
```shell
vi hello-lpi4a.yaml
```
The content of the file is as follows (refer to https://raw.githubusercontent.com/CARV-ICS-FORTH/kubernetes-riscv64/main/examples/hello-kubernetes.yaml):
```yaml
apiVersion: v1
kind: Service
metadata:
name: hello
spec:
type: ClusterIP
ports:
- port: 8080
selector:
app: hello
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
spec:
replicas: 1
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- name: hello-kubernetes
image: carvicsforth/hello-kubernetes:1.10.1
env:
- name: MESSAGE
value: "Hello Lichee Pi 4A!"
```
Then start a container with this configuration file. A typical input is as follows:
```shell
sipeed@lpi4a:~$ sudo kubectl apply -f hello-lpi4a.yaml
service/hello created
deployment.apps/hello created
```
Then check the status of pods (if the IP address is not displayed in the output, you can wait a little longer and check again):
```shell
sipeed@lpi4a:~$
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
hello-5b576d45d7-fdjgh 1/1 Running 0 16m 10.42.0.6 lpi4a <none> <none>
```
Next, use curl to test whether the k3s container runs successfully. The typical output is as follows:
```shell
sipeed@lpi4a:~$ curl 10.42.0.6:8080
<!DOCTYPE html>
<html>
<head>
<title>Hello Kubernetes!</title>
<link rel="stylesheet" type="text/css" href="/css/main.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:300">
</head>
<body>
<div class="main">
<img src="/images/kubernetes.png"/>
<div class="content">
<div id="message">
Hello Lichee Pi 4A!
</div>
<div id="info">
<table>
<tr>
<th>namespace:</th>
<td>-</td>
</tr>
<tr>
<th>pod:</th>
<td>hello-5b576d45d7-fdjgh</td>
</tr>
<tr>
<th>node:</th>
<td>- (Linux 5.10.113-gfac22a756532)</td>
</tr>
</table>
</div>
<div id="footer">
paulbouwer/hello-kubernetes:1.10.1 (linux/riscv64)
</div>
</div>
</div>
</body>
</html>
```
So far, the k3s container has run successfully.
The page shows as follows:
![k3s_hello_world](./../../../../zh/lichee/th1520/lpi4a/assets/application/k3s_hello_world.png)
## Minecraft Server
Here we take `1.20.1` version as an example, LPi4A as Server and PC (Ubuntu 22.04) as Client.
Expand Down Expand Up @@ -363,8 +544,11 @@ java -jar HMCL-3.5.5.jar
```
You can download ``1.20.1`` version directly in the launcher and configure the game account, then you can enter the game, after entering the game, enter the server IP (LPi4A's IP) to add the server to connect (make sure that the computer and LPi4A are under the same network), the effect is as follows:
![mc_server_menu](./../../../../zh/lichee/th1520/lpi4a/assets/application/mc_server_menu.png)
![mc_server_use](./../../../../zh/lichee/th1520/lpi4a/assets/application/mc_server_use.png)
> Note that if you want to change back to the original version of the JDK, run:
> ```shell.
> sudo rm /usr/bin/java
Expand Down
3 changes: 2 additions & 1 deletion docs/hardware/en/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ items:
- label: revyos
file: lichee/th1520/lpi4a/7_develop_revyos.md
- label: Linux Mainline (Work in Progress)
- label: Android
file: lichee/th1520/lpi4a/7_develop_android.md
- label: THead Yocto
file: lichee/th1520/lpi4a/7_develop_thead.md
- label: Android (Work in Progress)
- label: OpenHarmony (Work in Progress)
- label: OpenWRT (Work in Progress)
- label: Application(Building)
Expand Down
28 changes: 28 additions & 0 deletions docs/hardware/zh/lichee/th1520/lpi4a/3_images.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,34 @@ TODO

Readme and image download link: [Click me](https://gitee.com/thead-android/thead-android)

> 安卓13 SDK 仍处于初期状态,会逐步修复其中的问题
Sipeed 官方镜像的网盘下载链接中提供了 Android 13的预编译镜像文件,下载后烧录方式如下,fastboot工具请使用从这里下载的版本:
https://developer.android.com/tools/releases/platform-tools

网盘中也有提供 fastboot 的文件

```shell
#烧录uboot并初始化boot环境变量
fastboot flash ram u-boot-with-spl.bin
fastboot reboot
fastboot flash uboot u-boot-with-spl.bin

#烧录各个分区
#在非boot烧写模式,可以在uboot的命令行中输入命令fastboot usb 0,单独烧录分区
fastboot flash bootpart bootpart.ext4
fastboot flash boot boot.img
fastboot flash vendor_boot vendor_boot.img
fastboot flash super super.img
fastboot flash userdata userdata.img
fastboot flash vbmeta vbmeta.img
fastboot flash vbmeta_system vbmeta_system.img

#初始化metadata和misc分区
fastboot erase metadata
fastboot erase misc
```

## 第三方镜像

这里整理了第三方提供的镜像,仅供用户体验,sipeed 不保证此类镜像的可用性,稳定性。
Expand Down
Loading

0 comments on commit bd470df

Please sign in to comment.