# 树莓派开发常见问题记录

# 蓝牙

# src/main.c:parse_controller_config() Key file does not have group “Controller”【解决】

# 查看蓝牙启动状态报错如下

summergao@ubuntu:~$ systemctl status bluetooth
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-04-21 12:13:59 CST; 15s ago
       Docs: man:bluetoothd(8)
   Main PID: 2453 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 8966)
     CGroup: /system.slice/bluetooth.service
             └─2453 /usr/lib/bluetooth/bluetoothd

4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: src/main.c:parse_controller_config() Key file does not have group “Controller”
4月 21 12:13:59 ubuntu bluetoothd[2453]: Starting SDP server
4月 21 12:13:59 ubuntu bluetoothd[2453]: Bluetooth management interface 1.17 initialized


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

历经各种尝试,发现最暴力的解决方式还是卸载重装。

# 解决办法

卸载所有蓝牙相关软件包

sudo apt-get purge  bluez*
1
# 重装 pi-bluetooth
sudo apt-get install pi-bluetooth
1

重新配置,在第二次执行成功

sudo hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
1

# 解决 bcm43xx_init Failed to write reset command Can't initialize device: Success 问题

# 问题描述安装蓝牙初始化配置时报错:

sudo hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
1

# 解决办法卸载重装

sudo apt-get purge  bluez*
1
# 升级重装
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
1
2
3
sudo apt-get install pi-bluetooth blueman
1
# 重试,在第二次执行成功
sudo hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
1

添加pi用户到蓝牙组

sudo usermod -G bluetooth -a pi
1
# 重启
sudo reboot
1

# 安装

# E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2796 (unattended-upgr) 【解决】

# 树莓派4B解决:

E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2796 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it

# 查看进程

ps -aux
1

# 结束报错里面的进程

sudo kill -9 2796
1

# 重新安装

sudo apt-get install libmagickcore-dev
1
Last Updated: 5/19/2021, 1:20:44 PM