Page 1 of 1

Cant get bluetooth to work. RPI 2b

Posted: Thu Aug 29, 2019 6:22 pm
by xsw2_2wsx
Hi,

I want to use bluetooth connectivity for my project, but cant get it to work. I have RPI 2b and a usb bluetooth dongle.

When i plug it in, lsusb sees it:

Code: Select all

root@raspberrypi:~# lsusb
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
hciconfig sees interface:

Code: Select all

root@raspberrypi:~# hciconfig
hci0:   Type: Primary  Bus: USB
        BD Address: 33:03:30:0B:E9:8D  ACL MTU: 360:4  SCO MTU: 0:0
        DOWN
        RX bytes:1106 acl:0 sco:0 events:56 errors:0
        TX bytes:736 acl:0 sco:0 commands:60 errors:0
It says interface DOWN. I try to bring it up:

Code: Select all

root@raspberrypi:~# hciconfig hci0 up
Can't init device hci0: Operation not supported (95)
dmesg:

Code: Select all

[    7.939928] Bluetooth: Core ver 2.22
[    7.940093] NET: Registered protocol family 31
[    7.940105] Bluetooth: HCI device and connection manager initialized
[    7.940143] Bluetooth: HCI socket layer initialized
[    7.940163] Bluetooth: L2CAP socket layer initialized
[    7.940237] Bluetooth: SCO socket layer initialized
[    7.987584] usbcore: registered new interface driver btusb
[    9.672901] Under-voltage detected! (0x00050005)
[    9.716892] random: crng init done
[    9.716916] random: 7 urandom warning(s) missed due to ratelimiting
[   10.072536] Bluetooth: hci0: command 0x2003 tx timeout
[   12.152476] Bluetooth: hci0: command 0x2007 tx timeout
[   13.376213] 8021q: 802.1Q VLAN Support v1.8
[   13.432829] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   13.432852] Bluetooth: BNEP filters: protocol multicast
[   13.432903] Bluetooth: BNEP socket layer initialized
[   13.534160] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   13.635497] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   13.656942] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   13.855539] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   15.468197] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[   16.232489] Bluetooth: hci0: command 0x2003 tx timeout
[   18.312473] Bluetooth: hci0: command 0x2007 tx timeout
[   20.072547] Voltage normalised (0x00000000)
[   26.312555] Under-voltage detected! (0x00050005)
[   30.472564] Voltage normalised (0x00000000)
[   42.952637] Under-voltage detected! (0x00050005)
[   47.112538] Voltage normalised (0x00000000)
[  546.313716] Under-voltage detected! (0x00050005)
[  552.553688] Voltage normalised (0x00000000)
[  731.035284] Bluetooth: hci0: command 0x2003 tx timeout
[  733.115253] Bluetooth: hci0: command 0x2007 tx timeout

hcitool dev lists nothing. More things that could help:

Code: Select all

root@raspberrypi:~# bluetoothctl
Agent registered
[bluetooth]# show
No default controller available
[bluetooth]#

Code: Select all

root@raspberrypi:~# systemctl status hciuart.service
‚óŹ hciuart.service - Configure Bluetooth Modems connected by UART
   Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

Aug 29 18:55:50 raspberrypi systemd[1]: Dependency failed for Configure Bluetooth Modems connected by UART.
Aug 29 18:55:50 raspberrypi systemd[1]: hciuart.service: Job hciuart.service/start failed with result 'dependency'.

Code: Select all

root@raspberrypi:~# sudo systemctl start hciuart.service
A dependency job for hciuart.service failed. See 'journalctl -xe' for details.

Code: Select all

root@raspberrypi:~# journalctl -xe
Aug 29 19:03:22 raspberrypi systemd[1]: Started Session c1 of user pi.
-- Subject: A start job for unit session-c1.scope has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit session-c1.scope has finished successfully.
--
-- The job identifier is 493.
Aug 29 19:03:25 raspberrypi sudo[488]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/bash
Aug 29 19:03:25 raspberrypi sudo[488]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Aug 29 19:03:27 raspberrypi kernel: Voltage normalised (0x00000000)
Aug 29 19:06:26 raspberrypi kernel: Bluetooth: hci0: command 0x2003 tx timeout
Aug 29 19:06:28 raspberrypi kernel: Bluetooth: hci0: command 0x2007 tx timeout
Aug 29 19:09:42 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
-- Subject: A start job for unit systemd-tmpfiles-clean.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit systemd-tmpfiles-clean.service has begun execution.
--
-- The job identifier is 554.
Aug 29 19:09:42 raspberrypi systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit systemd-tmpfiles-clean.service has successfully entered the 'dead' state.
Aug 29 19:09:42 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
-- Subject: A start job for unit systemd-tmpfiles-clean.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit systemd-tmpfiles-clean.service has finished successfully.
--
-- The job identifier is 554.
Aug 29 19:09:44 raspberrypi kernel: Under-voltage detected! (0x00050005)
Aug 29 19:09:48 raspberrypi kernel: Voltage normalised (0x00000000)
Aug 29 19:15:43 raspberrypi sudo[518]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl start hciuart.service
Aug 29 19:15:44 raspberrypi sudo[518]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Aug 29 19:17:01 raspberrypi CRON[526]: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 29 19:17:01 raspberrypi CRON[530]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 29 19:17:01 raspberrypi CRON[526]: pam_unix(cron:session): session closed for user root
Aug 29 19:17:14 raspberrypi systemd[1]: dev-serial1.device: Job dev-serial1.device/start timed out.
Aug 29 19:17:14 raspberrypi systemd[1]: Timed out waiting for device /dev/serial1.
-- Subject: A start job for unit dev-serial1.device has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit dev-serial1.device has finished with a failure.
--
-- The job identifier is 559 and the job result is timeout.
Aug 29 19:17:14 raspberrypi systemd[1]: Dependency failed for Configure Bluetooth Modems connected by UART.
-- Subject: A start job for unit hciuart.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit hciuart.service has finished with a failure.
--
-- The job identifier is 558 and the job result is dependency.
Aug 29 19:17:14 raspberrypi systemd[1]: hciuart.service: Job hciuart.service/start failed with result 'dependency'.
Aug 29 19:17:14 raspberrypi systemd[1]: dev-serial1.device: Job dev-serial1.device/start failed with result 'timeout'.
Aug 29 19:17:14 raspberrypi sudo[518]: pam_unix(sudo:session): session closed for user root
If i should add something let me know.
Thanks for help

Re: Cant get bluetooth to work. RPI 2b

Posted: Thu Aug 29, 2019 7:58 pm
by Douglas6
Try:
sudo hciconfig hci0 up

[EDIT: I see now you are running as root; nevermind.

I believe I've seen that "Operation not supported (95)" error before, and it was the result of a bum dongle (it happens). Can you try a different dongle, preferably one that costs more than a dollar or two?]

Re: Cant get bluetooth to work. RPI 2b

Posted: Thu Aug 29, 2019 8:22 pm
by xsw2_2wsx
Thanks for your answer,

This is the only dongle i have right now. Its new, straight out of the box Esperanza EA159. It was marketed for RPI. I've plugged it in to windows pc had no problem pairing with speaker and keyboard. Speaker didnt work, but i suppose its a windows issue. And even if it was a dongle, i should be at least able to pair with rpi right?

Thanks again.

Re: Cant get bluetooth to work. RPI 2b

Posted: Thu Aug 29, 2019 8:38 pm
by Douglas6
Having taken a look at the Esperanza EA159, I double down on my previous recommendation. It's a cheap, no-name dongle with no chipset specified, and support only for Windows mentioned.

If you can't bring the dongle up, there's nothing you can do with it (including pairing). Try to find a dongle using the Broadcom(Cyprus) or CSI chipsets, and from a source you trust. You're only out a couple of bucks.

Could you post the results of 'hciconfig -a'?