[SOLVED] bluetooth, pi zero w, No default controller

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
BitHead

[SOLVED] bluetooth, pi zero w, No default controller

Post by BitHead »

Agh! I suppose I could view the hours wasted over the last week as hours I stayed out of trouble. ;-)
All I had to do was wait.
V.157 update worked a miracle. Yay!

Hi all,
New guy on the block here - looking for help finding the magic words that get 'hci0' in response to 'hcitool dev'.
Got all the bluetooth stuff installed - here's some starting point info, starting with the good...
( BT hardware is OK - with Raspy-Stretch-Lite I can scan/find OK with bluetoothctl - but I'm really liking DietPi.)

dmesg...
[ 12.768950] brcmfmac: Firmware version = wl0: Aug 7 2017 00:46:29 version 7.45.41.46 (r666254 CY) FWID 01-f8a78378
root@DietPi:~# dmesg | grep Blue
[198275.358460] Bluetooth: Core ver 2.22
[198275.358644] Bluetooth: HCI device and connection manager initialized
[198275.358670] Bluetooth: HCI socket layer initialized
[198275.358686] Bluetooth: L2CAP socket layer initialized
[198275.358736] Bluetooth: SCO socket layer initialized

status...
root@DietPi:~# systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset
Active: active (running) since Fri 2017-10-20 19:12:01 CDT; 21s ago
Docs: man:bluetoothd(8)
Main PID: 26396 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─26396 /usr/lib/bluetooth/bluetoothd

Oct 20 19:12:00 DietPi systemd[1]: Starting Bluetooth service...
Oct 20 19:12:01 DietPi bluetoothd[26396]: Bluetooth daemon 5.43
Oct 20 19:12:01 DietPi systemd[1]: Started Bluetooth service.
Oct 20 19:12:01 DietPi bluetoothd[26396]: Starting SDP server
Oct 20 19:12:01 DietPi bluetoothd[26396]: kernel lacks bnep-protocol support
Oct 20 19:12:01 DietPi bluetoothd[26396]: System does not support network plugin
Oct 20 19:12:01 DietPi bluetoothd[26396]: Bluetooth management interface 1.14 in

journalctl...
root@DietPi:~# journalctl -b | grep Bluetooth
Oct 20 18:51:52 DietPi kernel: Bluetooth: Core ver 2.22
Oct 20 18:51:52 DietPi kernel: Bluetooth: HCI device and connection manager initialized
Oct 20 18:51:52 DietPi kernel: Bluetooth: HCI socket layer initialized
Oct 20 18:51:52 DietPi kernel: Bluetooth: L2CAP socket layer initialized
Oct 20 18:51:52 DietPi kernel: Bluetooth: SCO socket layer initialized
Oct 20 19:12:00 DietPi systemd[1]: Starting Bluetooth service...
Oct 20 19:12:01 DietPi bluetoothd[26396]: Bluetooth daemon 5.43
Oct 20 19:12:01 DietPi systemd[1]: Started Bluetooth service.
Oct 20 19:12:01 DietPi bluetoothd[26396]: Bluetooth management interface 1.14 initialized

agent...
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful

raspberrypi-sys-mods is already the newest version (20170717).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

modules...
root@DietPi:~# lsmod
Module Size Used by
bluetooth 376811 6
evdev 11764 3
snd_bcm2835 23079 0
ftdi_sio 33164 0
snd_pcm 98097 1 snd_bcm2835
snd_timer 22753 1 snd_pcm
usbserial 29904 1 ftdi_sio
snd 69129 3 snd_timer,snd_bcm2835,snd_pcm
brcmfmac 267622 0
brcmutil 9943 1 brcmfmac
cfg80211 528062 1 brcmfmac
rfkill 21444 6 bluetooth,cfg80211
i2c_bcm2835 6401 0
bcm2835_gpiomem 3751 4
uio_pdrv_genirq 3718 0
uio 10281 1 uio_pdrv_genirq
fixed 3029 0
i2c_dev 6802 0
i2c_bcm2708 5740 0
ip_tables 12448 0
x_tables 21003 1 ip_tables
ipv6 383311 23

You may notice the usbserial/ftdi_sio thing - it is for a usb receiver of 433MHz sensor packets.
I guess this is a good time to reveal the big picture...
I have sensor/transmitters scattered about. Motion, knock, temp, rH, soil moisture, voltage, tilt (garage/doggy door), etc.
They send a packet either at regular intervals or upon event. The packet has Sensor Name and Message.
A python script gets the packet from ttyUSB0, parses Name and Message), inserts the word 'says' in the middle and sends it via 'text-to-speech' > aplay > audio port.
It works fine with old RPI>audio port, but I'm trying to get a solar-powered Pi Zero W to spit it out to a bluetooth speaker (that I can reach over and turn off when I get sick of hearing 'dog door says out'. ;-) - as well as send data to the cloud via wifi link.

Now - the not so good...

[bluetooth]# scan on
No default controller available

root@DietPi:~# hcitool dev
Devices:
root@DietPi:~#

root@DietPi:~# rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

root@DietPi:~# systemctl status hciuart
● hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; disabled; vendor preset: enabled)
Active: inactive (dead)
root@DietPi:~# systemctl start hciuart
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.

root@DietPi:~# systemctl enable hciuart
Created symlink /etc/systemd/system/multi-user.target.wants/hciuart.service → /lib/systemd/system/hciuart.service.

root@DietPi:~# systemctl status hciuart.service
● hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2017-10-20 20:51:18 CDT; 43s ago
Process: 27171 ExecStart=/usr/bin/btuart (code=exited, status=1/FAILURE)

Oct 20 20:51:18 DietPi btuart[27171]: Can't set line discipline: Invalid argument
Oct 20 20:51:18 DietPi btuart[27171]: Can't initialize device: Invalid argument
Oct 20 20:51:18 DietPi btuart[27171]: bcm43xx_init
Oct 20 20:51:18 DietPi btuart[27171]: Flash firmware /lib/firmware/BCM43430A1.hcd
Oct 20 20:51:18 DietPi btuart[27171]: Set BDADDR UART: b8:27:eb:4d:d2:4c
Oct 20 20:51:18 DietPi btuart[27171]: Set Controller UART speed to 3000000 bit/s
Oct 20 20:51:18 DietPi systemd[1]: hciuart.service: Control process exited, code=exited status=1
Oct 20 20:51:18 DietPi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Oct 20 20:51:18 DietPi systemd[1]: hciuart.service: Unit entered failed state.
Oct 20 20:51:18 DietPi systemd[1]: hciuart.service: Failed with result 'exit-code'.

I look forward to seeing/trying your clues.
Post Reply