[MinnowBoard] Adding Bluetooth modules to Angstrom kernel

Robert robertdegruijl at hotmail.com
Mon Aug 25 16:39:08 UTC 2014


Hey Darren,

Thanks for this little goldmine of info! I managed to pair my phone with my Minnowboard through bluetooth. Not without trial and error, so let me recount my steps for anyone who's interested:

Per your suggestion I added a reference to a new file bluetooth.cfg to the SRC_URT in my linux-yocto_3.10.bbappend file. I added the following config options to get it to work, likely a few of these are not required:

CONFIG_BT=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_CMTP=m
CONFIG_BT_HIDP=m
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
CONFIG_BT_HCIUSB=m
CONFIG_BT_HCIUSB_SCO=m
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
CONFIG_BT_HCIDTL1=m
CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
CONFIG_BT_MRVL=m
CONFIG_BT_MRVL_SDIO=m
CONFIG_BT_ATH3K=m
CONFIG_BT_WILINK=m

Initially I thought adding all my desired packages to setup-scripts/conf/local.conf was a great idea, but it's not trivial. For example, even adding all this:

IMAGE_INSTALL_append=" make"
IMAGE_INSTALL_append=" gcc"
IMAGE_INSTALL_append=" libgcc"
IMAGE_INSTALL_append=" binutils"

does not give me a healthy gcc environment, I have to go in and do a

opkg install gcc-dev

on the minnowboard after building and downloading the image in order to get the full set of gcc header files in /usr/include. I did not find this gcc-dev as part of the list shown by 'bitbake-layers show-recipes'. Let me know if I missed a 'super' package taking care of all these dependencies.

Similarly, other packages I tried to install were incomplete. Most notably, the 'bluez-simple-agent' script, useful for bluetooth pairing, did not appear in the image after installing the bluez4 package, so I had to snatch that from my Ubuntu system. So next time, I'd probably build a clean systemd-image and install everyting using opkg.

Once the image was built, written to SD (I tried a 64GB microsd card, but that uses an exfat file system which ran into trouble, so I reverted to an 8GB microsd) and booted on my Minnowboard, I could pair using the following commands on the minnowboard:

-----------------------------
systemctl enable bluetooth.service   # only had to do this once,
rfkill unblock all && rfkill list              # apparently this releases bluetooth device
hciconfig hci0 up piscan
hciconfig hci0 name minnow
hciconfig hci0 sspmode 1                 # Simple pairing mode, no passwords
hciconfig hci0
sdptool  add SP                                # Serial protocol between phone and minnow
hcitool scan                                      #lists available devices, my phone was found

bluez-simple-agent hci0 <my phone mac address>   # Note I had to copy this script from another system, it was not on my image

#  Minnow and phone will ask a few questions, after which they are paired
# Now set up serial connection through phone

rfcomm listen hci0 &

# Now I start a 'Bluetooth Terminal' app on my android phone, and connect to my paired minnow. Once connection is set up, I now have a /dev/rfcomm0 in my minnowBoard. Test out serial communication:

minicom -D /dev/rfcomm0

# now I can type text between phone and minnowboard.

--------------------------------------

Let me know if there are better methods you guys have found, and thanks again Darren for your help.

Robert









Date: Wed, 20 Aug 2014 11:54:23 -0500
From: dvhart at linux.intel.com
To: elinux-minnowboard at lists.elinux.org
Subject: Re: [MinnowBoard] Adding Bluetooth modules to Angstrom kernel

From:  Robert <robertdegruijl at hotmail.com>Reply-To:  MinnowBoard Development and Community Discussion <elinux-minnowboard at lists.elinux.org>
Date:  Tuesday, August 19, 2014 at 22:59
To:  "." <elinux-minnowboard at lists.elinux.org>
Subject:  [MinnowBoard] Adding Bluetooth modules to Angstrom kernel

Hi,
I'm trying to use a usb bluetooth adapter to work with a Minnowboard (LM506, which has a Broadcom Chipset). I installed Bluez, but I can't get it up and running (e.g. hci_config fails), which is, from what I can tell, due to the fact that my linux Angstrom kernel is missing bluetooth modules (at least btusb, but maybe more). lsusb shows the broadcom chipset, lsmod shows no sign of btusb, and n sign of any btusb.* on my micro-SD card that came with the Minnowboard).
I tried re-configuring the Angstrom kernel with bluetooth modules, but apparently the image that got distributed wiht my Minnowboard does not even have the sourcecode of these bluetooth kernel modules (no btusb.c anywhere).
Does anyone know:
- Is there anyway I can manually add the bluetooth modules to my Angstrom kernel? Do I cross-compile a new Angstrom kernel from scratch and copy the modules over to my Minnowboard? Is there an easier way?  
Angstrom is using the linux-yocto kernel, the recipe is in the meta-minnow layer. You'll find a configuration fragment in the meta-minnow linux-yocto recipe files dir which you can simply add the drivers you want to.
The file you want to modify is this one:http://git.yoctoproject.org/cgit/cgit.cgi/meta-minnow/tree/recipes-kernel/linux/linux-yocto_3.10.bbappend
Add a file://bluetooth.cfg to the SRCURI. Then create a directory "linux-yocto" and add a configuration fragment called bluetooth.cfg. It should just be a subset of the Linux .config with the specific CONFIGs you need. E.g.:
CONFIG_BLUETOOTH=m
Please use modules over built-in whenever possible.
Then send me a patch :)
- Can I re-compile my current angstrom kernel with bluetooth modules? Where can I find the full source of the Angstrom distribution as it was compiled for the Minnowboard, including these bluetooth modules? Just starting from scratch from the source from angstrom-distribution.org seems insufficient, because there seem to be multiple Minnowboard-specific modules I would be missing then).
There are instructions for building Angstrom for Minnow, and that includes all the Yocto Project meta-data you need to do that, and that downloads all the sources.
http://elinux.org/Minnowboard:Building_Angstrom_Linux_for_the_MinnowBoard
--Darren

Thanks!

  		 	   		  _______________________________________________
elinux-MinnowBoard mailing list
elinux-MinnowBoard at lists.elinux.org
http://lists.elinux.org/mailman/listinfo/elinux-minnowboard


_______________________________________________
elinux-MinnowBoard mailing list
elinux-MinnowBoard at lists.elinux.org
http://lists.elinux.org/mailman/listinfo/elinux-minnowboard 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.elinux.org/pipermail/elinux-minnowboard/attachments/20140825/60da8a13/attachment-0001.html>


More information about the elinux-MinnowBoard mailing list