CubieBoard Forum

Cubieboard itself => Beginners => Topic started by: beerstein on October 18, 2015, 03:22:29 pm

Title: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on October 18, 2015, 03:22:29 pm
Hi: I am not able to activate bluetooth. Bluetooth is running.
# bluetooth-agent 4835
does not find a device.
Please help.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on October 20, 2015, 07:15:55 am
Blootooth firmware loading is not started by default.

update-rc.d brcm40183-patch defaults
reboot


I hope it works, since I made some major changes regarding kernel and I haven't tested this feature. Yet.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on October 21, 2015, 07:40:52 am
thank you so much for this - I will try it out today and post back here.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on October 21, 2015, 01:45:24 pm
hi slovenia:
I did the update-rc.d as you recommended in your previous post. After reboot I started the Blueman Device Manager 1.22, which is a GUI based manager to work with bluetooth devices.When I started this manager before I did the  update-rc.d, I did not get an error message. It just started. Now after I did the  update-rc.d I got an error message: "Connection to Bluez failed. Bluez daemon is not running, blueman manager can not continue. This probably means that there were no Bluetooth adapters detected or Bluetooth daemon was not started."

$/etc/init.d/bluetooth status
indicates that is running.

So I started the bluetooth daemon:
$ sudo bluetoothd

No changes. I think the device hci0 is not available, bacause:

$ hcitool dev

shows just the message:
Devices:

but no real device. I assume that within the Devices: Message a Mac address should show up.

What can I do?

Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on October 27, 2015, 09:26:33 am
You can try to switch kernel from linux-image-sun7i to linux-image-sunxi

apt-get install linux-image-sunxi
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on October 28, 2015, 03:30:43 pm
thank you for your hint. I tried it but still no device hci0 visible.
$ hcitool dev
still lists
Device:
and nothing else.
Question: Do I have to modify/adapt one or more of the config files inside the /etc/bloouetoth folder?
Do I have to load (modprobe) any other bluetooth specific kernel modules?

please help
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on October 30, 2015, 08:16:34 am
With old kernel you need to have those modules, in this order:

hci_uart gpio_sunxi bt_gpio wifi_gpio rfcomm hidp sunxi-ir bonding spi_sun7i bcmdhd
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on November 02, 2015, 05:34:15 pm
slovenia, thank you for the hint. I checked:content of /etc/modules-load.d/modules.conf

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

hci_uart
gpio_sunxi
bt_gpio
wifi_gpio
rfcomm
hidp
sunxi-ir
bonding
spi_sun7i
bcmdhd

it has the modules in the right order. But I do not have a:
bluetooth.conf in folder:
/etc/modules-load.d/

It seems to me that it is no easy task to get bluetooth working. I need help to make the bluetooth interface hci0 visible.

please help

cubie@cubietruck:~$ dmesg | grep -i bluetooth
[    9.131808] Bluetooth: Core ver 2.16
[    9.158440] Bluetooth: HCI device and connection manager initialized
[    9.171064] Bluetooth: HCI socket layer initialized
[    9.183733] Bluetooth: L2CAP socket layer initialized
[    9.187629] Bluetooth: SCO socket layer initialized
[    9.206201] Bluetooth: HCI UART driver ver 2.2
[    9.218759] Bluetooth: HCI H4 protocol initialized
[    9.231404] Bluetooth: HCI BCSP protocol initialized
[    9.249344] Bluetooth: HCILL protocol initialized
[    9.262049] Bluetooth: HCIATH3K protocol initialized
[    9.499410] Bluetooth: RFCOMM TTY layer initialized
[    9.512218] Bluetooth: RFCOMM socket layer initialized
[    9.523534] Bluetooth: RFCOMM ver 1.11
[    9.591361] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[   31.163347] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   31.177941] Bluetooth: BNEP filters: protocol multicast
cubie@cubietruck:~$

Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: take on January 05, 2016, 03:41:39 pm
Sorry to bring back this old-ish post but i have the same problem as beerstein stated. I am trying to use the build in bluetooth on my cubietruck for a keyboard but the device does not show up.

I am running Armbian_4.5_Cubietruck_Ubuntu_trusty_3.4.109_desktop and tried the suggested changes with no success. The modules differ however - is this due to the fact that I have the desktop version? What do I have to do to proceed here? Thanks in advance!

Some more meta:


~# hcitool dev
Devices:



# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

hci_uart
gpio_sunxi
rfcomm
hidp
sunxi-ir
bonding
spi_sun7i
ap6210



# dmesg | grep -i bluetooth
[    7.215653] Bluetooth: Core ver 2.16
[    7.224598] Bluetooth: HCI device and connection manager initialized
[    7.228439] Bluetooth: HCI socket layer initialized
[    7.249034] Bluetooth: L2CAP socket layer initialized
[    7.252940] Bluetooth: SCO socket layer initialized
[    7.269936] Bluetooth: HCI UART driver ver 2.2
[    7.273707] Bluetooth: HCI H4 protocol initialized
[    7.277635] Bluetooth: HCI BCSP protocol initialized
[    7.286954] Bluetooth: HCILL protocol initialized
[    7.290974] Bluetooth: HCIATH3K protocol initialized
[    7.327019] Bluetooth: RFCOMM TTY layer initialized
[    7.331301] Bluetooth: RFCOMM socket layer initialized
[    7.334032] Bluetooth: RFCOMM ver 1.11
[    7.370840] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[   12.057465] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   12.062078] Bluetooth: BNEP filters: protocol multicast



# dmesg | grep -i err
[    0.000000] start_kernel(): bug: interrupts were enabled early
[    0.382358] sunxi_gpio_probe script_parser_fetch '[gpio_para]' 'gpio_pin_3' err
[    0.996882] [spi-err] Get spi devices number failed
[    1.001615] [spi-err] register spi devices board info failed
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on January 06, 2016, 12:01:25 am
You need to load Bluetooth firmware with this script:

insserv brcm40183-patch

Note that its unstable. Sometimes works, sometime not.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: take on January 06, 2016, 09:40:29 am
I did try


update-rc.d brcm40183-patch defaults
reboot


with no luck. Shouldn't that also do the trick? This is on a fresh install btw. I did not do anything else yet.


/etc/init.d/bluetooth status


also suggests it is running. Any clue?
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on January 06, 2016, 12:23:29 pm
Yes, that's correct but as i mentioned it's very unstable and I never tested this after changing the kernel source from dan-and to linux-sunxi (default community kernel).

There is one other solution on the forum, which should work better.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on January 07, 2016, 11:16:25 am
where exactly can i find the other solution in the Armbian forum?
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on January 18, 2016, 01:07:39 pm
It's actually on this forum and here you have a summary:

https://github.com/phelum/CT_Bluetooth
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on January 19, 2016, 06:47:55 am
hi slovenia: Thank you for your last post. What does it exactly mean:
" (working with supported external keys)" in your description of image file.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on January 21, 2016, 04:49:24 am
Quote from: beerstein on January 19, 2016, 06:47:55 am
hi slovenia: Thank you for your last post. What does it exactly mean:
" (working with supported external keys)" in your description of image file.


Certain USB BT keys are supported by the kernel and if you plug one of those this is all you need to do. Bluetooth stack is pre-installed.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: beerstein on January 21, 2016, 07:48:51 am
OK thank you for this slovenia. This means that the internal Bluetooth of CT does not work with Armbian.
I need a USB bluestooth stick. Am I right ?
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on February 01, 2016, 01:34:41 pm
It's possible to get internal BT working but it was never done to the perfection. Sometimes it works, sometimes it doesn't. That was the case with my solution. When you did not bring it on, you need to power cycle. When it was initialized properly, than it was working good .. until next reboot.

Solution from Phelum is better and suppose it work. Until I don't find time to implement it or you do it on your own ...

... yes, you need to use some USB BT if you need Bluetooth.
Title: Re: bluetooth on cubietruck - how to activate in Armbian 4.5 Deb.Wheezy 3.4.109
Post by: slovenia on February 28, 2016, 02:45:38 pm
I fixed BT issues in v5.04, kernel 3.4.110

Now BT works with on board chip.

http://mirror.igorpecovnik.com/Armbian_5.04_Cubietruck_Debian_jessie_3.4.110.zip

It's disabled by default - how to enable:

http://www.armbian.com/cubietruck/