提交 53af31e7 编写于 作者: Y yafen

音频/蓝牙/wifi相关文档 更新镜像

上级 d94010c1
...@@ -32,13 +32,13 @@ You can get introduction of openEuler RaspberryPi SIG from [sig-RaspberryPi](htt ...@@ -32,13 +32,13 @@ You can get introduction of openEuler RaspberryPi SIG from [sig-RaspberryPi](htt
## How to download latest image ## How to download latest image
Alpha version of openEuler 20.03 LTS image for Raspberry Pi, [download](https://isrc.iscas.ac.cn/EulixOS/repo/dailybuild/1/isos/20200427/openEuler_20200427121211.img.xz). Alpha version of openEuler 20.03 LTS image for Raspberry Pi, [download](https://isrc.iscas.ac.cn/EulixOS/repo/dailybuild/1/isos/20200508/openEuler_20200508151847.img.xz).
Basic information of the above image: Basic information of the above image:
- [ChangeLog](documents/changelog.en.md) - [ChangeLog](documents/changelog.en.md)
- Release date: 2020-04-27 - Release date: 2020-05-11
- Size: 240 MiB - Size: 245 MiB
- OS version: openEuler 20.03 LTS - OS version: openEuler 20.03 LTS
- Kernel version: 4.19.90-2003.4.0.0036 - Kernel version: 4.19.90-2003.4.0.0036
- Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) - Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree)
......
...@@ -30,14 +30,14 @@ SIG 组基本信息位于 [sig-RaspberryPi](https://gitee.com/jianminw/community ...@@ -30,14 +30,14 @@ SIG 组基本信息位于 [sig-RaspberryPi](https://gitee.com/jianminw/community
## 最新镜像 ## 最新镜像
openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/EulixOS/repo/dailybuild/1/isos/20200427/openEuler_20200427121211.img.xz) openEuler 20.03 LTS 的内测版本镜像,[下载](https://isrc.iscas.ac.cn/EulixOS/repo/dailybuild/1/isos/20200508/openEuler_20200508151847.img.xz)
该镜像的基本信息: 该镜像的基本信息:
- [更新日志](documents/changelog.md) - [更新日志](documents/changelog.md)
- 发布时间:2020-04-27 - 发布时间:2020-05-11
- 大小:240 MiB - 大小:245 MiB
- 操作系统版本:openEuler 20.03 LTS - 操作系统版本:openEuler 20.03 LTS
- 内核版本:4.19.90-2003.4.0.0036 - 内核版本:4.19.90-2003.4.0.0036
- 固件来源:[firmware](https://github.com/raspberrypi/firmware)[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree) - 固件来源:[firmware](https://github.com/raspberrypi/firmware)[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree)
......
...@@ -2,6 +2,24 @@ ...@@ -2,6 +2,24 @@
English | [简体中文](./changelog.md) English | [简体中文](./changelog.md)
### 2020-05-09
#### Basic information
- Release date: 2020-05-11
- Size: 245 MiB
- OS version: openEuler 20.03 LTS
- Kernel version: 4.19.90-2003.4.0.0036
- Firmware source: [firmware](https://github.com/raspberrypi/firmware), [bluez-firmware](https://github.com/RPi-Distro/bluez-firmware), [firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree)
- Repository of rootfs: [openEuler-20.03-LTS](http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/)
- Repository inside the image: [openEuler 20.03 LTS repository](https://gitee.com/openeuler/raspberrypi/blob/master/config/openEuler-20.03-LTS.repo)
#### Updates
##### Bluetooth
Start related services of bluetooth and bind Bluetooth devices by default.
### 2020-04-27 ### 2020-04-27
#### Basic information #### Basic information
......
...@@ -2,6 +2,24 @@ ...@@ -2,6 +2,24 @@
[English](./changelog.en.md) | 简体中文 [English](./changelog.en.md) | 简体中文
### 2020-05-09
#### 基本信息
- 发布时间:2020-05-11
- 大小:245 MiB
- 操作系统版本:openEuler 20.03 LTS
- 内核版本:4.19.90-2003.4.0.0036
- 固件来源:[firmware](https://github.com/raspberrypi/firmware)[bluez-firmware](https://github.com/RPi-Distro/bluez-firmware)[firmware-nonfree](https://github.com/RPi-Distro/firmware-nonfree)
- 构建文件系统的源仓库:[openEuler-20.03-LTS](http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/)
- 镜像内置源仓库:[openEuler 20.03 LTS 源仓库](https://gitee.com/openeuler/raspberrypi/blob/master/config/openEuler-20.03-LTS.repo)
#### 更新说明
##### 蓝牙
默认启动蓝牙相关服务,并绑定蓝牙设备。
### 2020-04-27 ### 2020-04-27
#### 基本信息 #### 基本信息
......
...@@ -105,9 +105,21 @@ ...@@ -105,9 +105,21 @@
`console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait` `console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait`
### boot 内容完善
#### 将内核放进引导
`cp ${WORKDIR}/output/Image ${WORKDIR}/firmware/boot/kernel8.img`
#### 将设备树文件放进引导
`cp ${WORKDIR}/output/*.dtb ${WORKDIR}/firmware/boot/`
`cp ${WORKDIR}/output/overlays/* ${WORKDIR}/firmware/boot/overlays/`
## 树莓派固件 ## 树莓派固件
### 下载固件 ### 下载固件和应用
1. 进入下载目录 1. 进入下载目录
...@@ -125,11 +137,17 @@ ...@@ -125,11 +137,17 @@
得到文件 ${WORKDIR}/firmware-nonfree。 得到文件 ${WORKDIR}/firmware-nonfree。
# 制作openEuler的rootfs 4. 下载 pi-bluetooth
`git clone https://github.com/RPi-Distro/pi-bluetooth`
得到文件 ${WORKDIR}/pi-bluetooth。
# 制作 openEuler 的 rootfs
操作目录:${WORKDIR} 操作目录:${WORKDIR}
## 创建RPM数据库 ## 创建 RPM 数据库
`mkdir ${WORKDIR}/rootfs` `mkdir ${WORKDIR}/rootfs`
...@@ -137,7 +155,7 @@ ...@@ -137,7 +155,7 @@
`rpm --root ${WORKDIR}/rootfs/ --initdb` `rpm --root ${WORKDIR}/rootfs/ --initdb`
## 下载安装openEuler发布包 ## 下载安装 openEuler 发布包
`rpm -ivh --nodeps --root ${WORKDIR}/rootfs/ http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/Packages/openEuler-release-20.03LTS-33.oe1.aarch64.rpm` `rpm -ivh --nodeps --root ${WORKDIR}/rootfs/ http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/Packages/openEuler-release-20.03LTS-33.oe1.aarch64.rpm`
...@@ -145,9 +163,9 @@ ...@@ -145,9 +163,9 @@
etc/ usr/ var/ etc/ usr/ var/
## 安装yum ## 安装 yum
### 添加yum ### 添加 yum
`mkdir ${WORKDIR}/rootfs/etc/yum.repos.d` `mkdir ${WORKDIR}/rootfs/etc/yum.repos.d`
...@@ -173,7 +191,7 @@ baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/ ...@@ -173,7 +191,7 @@ baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/
enabled=1 enabled=1
``` ```
### 安装dnf ### 安装 dnf
`dnf --installroot=${WORKDIR}/rootfs/ install dnf --nogpgcheck -y` `dnf --installroot=${WORKDIR}/rootfs/ install dnf --nogpgcheck -y`
...@@ -181,21 +199,21 @@ enabled=1 ...@@ -181,21 +199,21 @@ enabled=1
`dnf --installroot=${WORKDIR}/rootfs/ makecache` `dnf --installroot=${WORKDIR}/rootfs/ makecache`
`dnf --installroot=${WORKDIR}/rootfs/ install -y wpa_supplicant vim net-tools iproute iputils NetworkManager openssh-server passwd hostname ntp` `dnf --installroot=${WORKDIR}/rootfs/ install -y alsa-utils wpa_supplicant vim net-tools iproute iputils NetworkManager openssh-server passwd hostname ntp bluez pulseaudio-module-bluetooth`
## 添加配置文件 ## 添加配置文件
### 添加hosts ### 添加 hosts
`cp /etc/hosts ${WORKDIR}/rootfs/etc/hosts` `cp /etc/hosts ${WORKDIR}/rootfs/etc/hosts`
### 网络相关 ### 网络相关
1. 设置DNS 1. 设置 DNS
`cp -L /etc/resolv.conf ${WORKDIR}/rootfs/etc/resolv.conf` `cp -L /etc/resolv.conf ${WORKDIR}/rootfs/etc/resolv.conf`
编辑添加nameserver: 编辑添加 nameserver:
`vim ${WORKDIR}/rootfs/etc/resolv.conf` `vim ${WORKDIR}/rootfs/etc/resolv.conf`
...@@ -205,7 +223,7 @@ nameserver 8.8.8.8 ...@@ -205,7 +223,7 @@ nameserver 8.8.8.8
nameserver 114.114.114.114 nameserver 114.114.114.114
``` ```
2. 设置IP自动获取 2. 设置 IP 自动获取
`mkdir ${WORKDIR}/rootfs/etc/sysconfig/network-scripts` `mkdir ${WORKDIR}/rootfs/etc/sysconfig/network-scripts`
...@@ -232,6 +250,32 @@ DEVICE=eth0 ...@@ -232,6 +250,32 @@ DEVICE=eth0
``` ```
## rootfs 内容完善
### 将固件放进 rootfs
```
mkdir -p ${WORKDIR}/rootfs/lib/firmware ${WORKDIR}/rootfs/usr/bin ${WORKDIR}/rootfs/lib/udev/rules.d ${WORKDIR}/rootfs/lib/systemd/system
cp ${WORKDIR}/bluez-firmware/broadcom/* ${WORKDIR}/rootfs/lib/firmware/`
cp -r ${WORKDIR}/firmware-nonfree/brcm/ ${WORKDIR}/rootfs/lib/firmware/
wget https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules -P ${WORKDIR}/rootfs/lib/udev/rules.d/
cp pi-bluetooth/usr/bin/* ${WORKDIR}/rootfs/usr/bin/
cp pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules ${WORKDIR}/rootfs/lib/udev/rules.d/
cp pi-bluetooth/debian/pi-bluetooth.bthelper\@.service ${WORKDIR}/rootfs/lib/systemd/system/bthelper\@.service
cp pi-bluetooth/debian/pi-bluetooth.hciuart.service ${WORKDIR}/rootfs/lib/systemd/system/hciuart.service
```
蓝牙相关固件放到 ${WORKDIR}/rootfs/lib/firmware/brcm/ 下:
```
mv ${WORKDIR}/rootfs/lib/firmware/BCM43430A1.hcd ${WORKDIR}/rootfs/lib/firmware/brcm/`
mv ${WORKDIR}/rootfs/lib/firmware/BCM4345C0.hcd ${WORKDIR}/rootfs/lib/firmware/brcm/
```
### 将内核模块放进rootfs
`cp -r ${WORKDIR}/output/lib/modules ${WORKDIR}/rootfs/lib/`
## rootfs设置 ## rootfs设置
1. 挂载必要的路径 1. 挂载必要的路径
...@@ -246,7 +290,7 @@ DEVICE=eth0 ...@@ -246,7 +290,7 @@ DEVICE=eth0
`chroot ${WORKDIR}/rootfs /bin/bash` `chroot ${WORKDIR}/rootfs /bin/bash`
3. 启用开机自启ssh 3. 开机自启ssh
`systemctl enable ssh` `systemctl enable ssh`
...@@ -258,13 +302,21 @@ DEVICE=eth0 ...@@ -258,13 +302,21 @@ DEVICE=eth0
5. 设置主机名 5. 设置主机名
`hostname OpenEuler` `echo openEuler > /etc/hostname`
6. 退出 6. 设置默认时区为东八区
`ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime`
7. 开机自启 hciuart
`systemctl enable hciuart`
8. 退出
`exit` `exit`
7. 取消临时挂载的目录 9. 取消临时挂载的目录
`umount -l ${WORKDIR}/rootfs/dev` `umount -l ${WORKDIR}/rootfs/dev`
...@@ -274,38 +326,6 @@ DEVICE=eth0 ...@@ -274,38 +326,6 @@ DEVICE=eth0
# 制作镜像 # 制作镜像
## rootfs内容完善
### 将固件放进rootfs
`mkdir -p ${WORKDIR}/rootfs/lib/firmware`
`cp ${WORKDIR}/bluez-firmware/broadcom/* ${WORKDIR}/rootfs/lib/firmware/`
`cp -r ${WORKDIR}/firmware-nonfree/brcm/ ${WORKDIR}/rootfs/lib/firmware/`
蓝牙相关固件放到 ${WORKDIR}/rootfs/lib/firmware/brcm/ 下:
`mv ${WORKDIR}/rootfs/lib/firmware/BCM43430A1.hcd ${WORKDIR}/rootfs/lib/firmware/brcm/`
`mv ${WORKDIR}/rootfs/lib/firmware/BCM4345C0.hcd ${WORKDIR}/rootfs/lib/firmware/brcm/`
### 将内核模块放进rootfs
`cp -r ${WORKDIR}/output/lib/modules ${WORKDIR}/rootfs/lib/`
## boot内容完善
### 将内核放进引导
`cp ${WORKDIR}/output/Image ${WORKDIR}/firmware/boot/kernel8.img`
### 将设备树文件放进引导
`cp ${WORKDIR}/output/*.dtb ${WORKDIR}/firmware/boot/`
`cp ${WORKDIR}/output/overlays/* ${WORKDIR}/firmware/boot/overlays/`
## 生成镜像并分区挂载 ## 生成镜像并分区挂载
### 计算镜像大小 ### 计算镜像大小
......
...@@ -105,4 +105,262 @@ ...@@ -105,4 +105,262 @@
至此,根目录分区扩容结束。扩容过程见下图: 至此,根目录分区扩容结束。扩容过程见下图:
![](images/分区扩容.jpg) ![](images/分区扩容.jpg)
\ No newline at end of file
# wifi 连接
## 查看 IP 和网卡信息
`ip a`
获取无线网卡 wlan0 信息:
```
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether dc:a6:32:50:de:57 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.108/24 brd 192.168.31.255 scope global dynamic noprefixroute eth0
valid_lft 41527sec preferred_lft 41527sec
inet6 fe80::bda0:3318:35ba:7583/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 7e:f1:16:71:7e:69 brd ff:ff:ff:ff:ff:ff
```
## 扫描可以连接的 wifi 信息
`nmcli dev wifi`
## 连 接wifi
`nmcli dev wifi connect SSID password PWD`
其中,`SSID` 为上一步扫描到的可供连接的 wifi 的 SSID,`PWD` 为对应 wifi 的密码。例如:`nmcli dev wifi connect xxx password yyy`,连接成功:
```
Device 'wlan0' successfully activated with 'dca7d2f4-00af-44e7-8374-13ef5efe1f9a'.
```
## 查看 IP 和无线网卡信息
`ip a`
```
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether dc:a6:32:50:de:57 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.108/24 brd 192.168.31.255 scope global dynamic noprefixroute eth0
valid_lft 42966sec preferred_lft 42966sec
inet6 fe80::bda0:3318:35ba:7583/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether dc:a6:32:50:de:58 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.109/24 brd 192.168.31.255 scope global dynamic noprefixroute wlan0
valid_lft 43190sec preferred_lft 43190sec
inet6 fe80::7a67:44e2:b596:fc01/64 scope link noprefixroute
valid_lft forever preferred_lft forever
```
# 音频
## 开启音频
编辑 /boot/config.txt:
`vim /boot/config.txt`
添加内容:
```
dtparam=audio=on
```
重启树莓派。
## 安装音频播放软件
这里以使用 mpg123 为例。
```
dnf install mpg123
```
### 播放音频
`mpg123 xxx.mp3`
### 音频输出配置
详细信息可参考[树莓派官方文档](https://www.raspberrypi.org/documentation/),如:[audio-config](https://www.raspberrypi.org/documentation/configuration/audio-config.md)
树莓派有两种音频输出模式:HDMI 和耳机插孔。可以根据需要更换输出模式。
如果您的 HDMI 显示器或电视具有内置扬声器,则可以通过 HDMI 电缆播放音频,但您可以将其切换到耳机或插入耳机插孔的其他扬声器。如果显示器有扬声器,则默认情况下声音通过 HDMI 输出;如果没有,则通过耳机插孔输出。这可能不是所需的输出设置,或者自动检测不准确,在这种情况下,您可以手动切换输出。
可以通过输入命令将音频输出切换到对应模式。
#### HDMI
`amixer cset numid=3 2`
#### 耳机插孔
`amixer cset numid=3 1`
#### 自动(默认)
`amixer cset numid=3 0`
# 蓝牙
## 开启蓝牙
需要保证蓝牙已经开启,例如,如果树莓派启用了串口功能,`/boot/config.txt` 中会有配置项 `dtoverlay=pi3-disable-bt`,使用蓝牙则需要取消该配置项,请删除或注释。如果修改过`/boot/config.txt`的配置内容,需要重启树莓派。
## 查看蓝牙设备
`hciconfig`
例如,这里查看到的信息如下:
```
hci0: Type: Primary Bus: UART
BD Address: AA:AA:AA:AA:AA:AA ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:66475718 acl:151850 sco:0 events:1760 errors:0
TX bytes:13827 acl:117 sco:0 commands:996 errors:0
```
## 连接蓝牙
使用 `bluetoothctl` 交互命令连接蓝牙设备。
### 进入交互命令
`bluetoothctl`
### 开启控制器电源
`power on`
### 启用代理
`agent on`
### 设置代理为默认代理
`default-agent`
### 扫描
`scan on`
这里看到要连接的蓝牙设备对应的 MAC 地址,记为 `target-MAC`
### 配对
`pair target-MAC`
### 添加信任
这一步可忽略。
`trust target-MAC`
### 连接
`connect target-MAC`
连接成功,则会在该交互命令界面显示进入到目标蓝牙设备。
这里,可能会出现的问题:
1. Attempting to connect to XX:XX:XX:XX:XX:XX
Failed to connect: org.bluez.Error.Failed
解决:重启 pluseaudio。
```
pulseaudio -k
pulseaudio --start
```
如果重启多次仍然无效。在 `bluetoothctl` 交互命令中删除对应蓝牙设备信息:`remove target-MAC`,然后按照 `pair``trust``connect` 的过程连接蓝牙。
## 播放音乐
`target-MAC` 对应的设备上`设置->蓝牙`会显示已经连接到树莓派的蓝牙设备。该设备播放音乐,就可以通过树莓派收听。注意,需要保证树莓派已经开启音频。
## 文件传输
### 下载软件 obexftp
```
wget https://rpmfind.net/linux/mageia/distrib/cauldron/aarch64/media/core/release/lib64obexftp0-0.24-17.mga8.aarch64.rpm
wget https://rpmfind.net/linux/mageia/distrib/cauldron/aarch64/media/core/release/lib64openobex1-1.7.2-3.mga8.aarch64.rpm
wget https://rpmfind.net/linux/mageia/distrib/cauldron/aarch64/media/core/release/obexftp-0.24-17.mga8.aarch64.rpm
```
### 安装 obexftp
```
rpm -i lib64obexftp0-0.24-17.mga8.aarch64.rpm
rpm -i lib64openobex1-1.7.2-3.mga8.aarch64.rpm
rpm -i obexftp-0.24-17.mga8.aarch64.rpm
```
### 文件传输
#### 查看文件传输的 channel
`sdptool browse target-MAC`
查看结果:
```
Browsing target-MAC ...
...
Browsing target-MAC ...
Service Search failed: Invalid argument
Service Name: OBEX Phonebook Access Server
Service RecHandle: 0x1000b
Service Class ID List:
"Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 19
"OBEX" (0x0008)
Profile Descriptor List:
"Phonebook Access" (0x1130)
Version: 0x0101
Service Name: OBEX Object Push
Service RecHandle: 0x1000c
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 12
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0102
...
```
看到其中 `Service Name: OBEX Object Push` 下的 ` Channel: 12`
#### 传输文件
文件路径记为 `file-path`
`obexftp -b target-MAC -B 12 -U NONE -p file-path`
之后就可以在`target-MAC` 对应的设备上选择接收文件,进行文件传输。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册