1 (edited by markushx 2005-06-17 07:20:48)

Topic: Bluez and OpenWRT experimental [success]

Hello all,

just wanted to inform you on successful building bluez for openwrt.

Packages created are:
bluez-utils, bluez-libs, kmod-bluetooth

Currently available at:
http://www.comnets.uni-bremen.de/~mab/openwrt/packages/

Hope someone is interested in this.....

Bye,
Markus

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

Good job, I was looking for this for a while.

Do you also have compiled the rfcomm module, without it there is less fun with bluetooth.

I'm using it to transfer files to my phone using OBEX.


My config: Asus WL-500gx and USB Belkin bluetooth module.

Re: Bluez and OpenWRT experimental [success]

Hi,

I just forgot to copy the respective object file. rfcomm.o should be in the updated packages at the same location now, but I haven't tested it yet.

Regards,
Markus

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

markusx,

The rfcomm module loads fine:

Jun  9 15:56:35 (none) kern.info kernel: BlueZ Core ver 2.4 Copyright (C) 2000,2001 Qualcomm Inc
Jun  9 15:56:35 (none) kern.info kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Jun  9 15:56:46 (none) kern.info kernel: BlueZ L2CAP ver 2.3 Copyright (C) 2000,2001 Qualcomm Inc
Jun  9 15:56:46 (none) kern.info kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Jun  9 15:57:17 (none) kern.info kernel: BlueZ RFCOMM ver 1.1
Jun  9 15:57:17 (none) kern.info kernel: Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
Jun  9 15:57:17 (none) kern.info kernel: Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
Jun  9 15:57:42 (none) kern.info kernel: BlueZ HCI USB driver ver 2.7 Copyright (C) 2000,2001 Qualcomm Inc
Jun  9 15:57:42 (none) kern.info kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Jun  9 15:57:42 (none) kern.info kernel: usb.c: registered new driver hci_usb


But if you run rfcomm at the prompt it's exiting with the following error:

root@Yarfid:/lib/modules/2.4.30# rfcomm
Can't get device list: Operation not supported


So I guess it's not working sad

Re: Bluez and OpenWRT experimental [success]

I guess you're right. I forgot to enable BT_RFCOMM_TTY, which is needed. I am currently working on it, but unfortunately the images with tty enabled can't be booted (WL-500g not pingable). It seems like I broke my build environment and now I am going to start with a new build environment and integrate my changes into it....

I'll post more information next week (hopefully ;-) )

Bye,
Markus

Using Asus WL-500g and WL-500gx

6 (edited by markushx 2005-07-04 09:43:38)

Re: Bluez and OpenWRT experimental [success]

OK,

I enabled BT_RFCOMM_TTY and restarted with a new build environment and voila it works.

A very short HowTo(WorksForMeTM):

##add to /etc/ipkg.conf:
#src mab http://www.comnets.uni-bremen.de/~mab/openwrt/packages

ipkg update

#install bluetooth and usb packages
ipkg install kmod-bluetooth
ipkg install bluez-libs
ipkg install bluez-utils
ipkg install kmod-usb-core
ipkg install kmod-usb-ohci
ipkg install kmod-usb2
ipkg install libusb
ipkg install lsusb

#insert bluetooth and usb modules
insmod usbcore
insmod usb-ohci
insmod bluez
insmod hci_usb
insmod hci_uart
insmod sco
insmod l2cap
insmod rfcomm

#modify /etc/bluetooth/hcid.conf
#pin_helper /etc/bluetooth/givepin;

#create /etc/bluetooth/givepin:
#echo "PIN:1234"
chmod +x /etc/bluetooth/givepin

#start hcid (otherwise 'hcitool dev' does not find devices)
hcid

#mount usbdevfs for debugging
mount -t usbdevfs none /proc/bus/usb

#find the bluetooth dongle
hcitool dev

#find bluetooth devices
hcitool scan

#might not be necessary, see posts below
(#create /dev/rfcomm0
makedevs /dev/rfcomm c 216 0 0 0)

#connect
rfcomm -i hci0 connect /dev/rfcomm0 <remote_bluetooth_address> 1

Have fun with your mobile.....
Markus

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

Markus,

Works perfectly!

Thanks for your time and effort.

regards,
yarfid

8 (edited by samot 2005-06-25 07:19:41)

Re: Bluez and OpenWRT experimental [success]

Good work, thanks Markus!

I was looking for bluetooth on openwrt for half an year.

After destroing a half year old openwrt version by installing bluez kmod ipkgs and solving some problems with whiterussian stability (switching to gcc 3.4.3, can you use 3.4.4??) I finally got the bluetooth working.

I managed to connect SonyEricsson P900 phone (an mRouter beast) to the Internet directly by wl500g and i-tec BT USB dongle (Cambridge radio). openwrt BT is now much more stable than P900's one.

Markus, please, fix the URL of your ipkg repository in HowTo.
You can also left out
       makedevs /dev/rfcomm c 216 0 0 0
as desired device is in /dev/bluetooth/rfcomm/0... and you better use
      rfcomm connect 1 <remote_bluetooth_address> 1
I wasted time recompiling busybox to get makedevs before I figured this out.

Now I'm looking for obex.
Yarfid, did you make an openobex ipkg? Do you have some patches?

Another goal is an IAX based Voip connection to bluetooth handsfree. I hope that everythink is in the asterisk and the only work needed is to port the bluetooth channel. Somebody cares?

Tom

Re: Bluez and OpenWRT experimental [success]

Samot,

I have a debian sarge rootfs installed on an external HD connected with the router so I use the debian compiled openobex applications and libs.

Did you have problems connecting your phone to the router? I guess your using dund.
In the beginning I had some strange loss of connection and I only managed to get it work again by disconnecting the trust bt-1800tp and connecting it again. I had the same problem with the Belkin F8T001 (uses also a broadcom chipset)
Later I found a solution by decreasing the packets in "hciconfigure hci0 aclmtu xxx:packets", now it works superstable.

Good luck with your IAX based voip.

regards,
Yarfid

Re: Bluez and OpenWRT experimental [success]

I think for voice/handsfree you need snd-bt-sco which itself requires alsa, which probably is hard to compile for openwrt.

But it would definitely be worth a try.....

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

Sry may poor english.

bluez working correctly as above , big thanks smile

can connect from asus as above and using pand,
can connect to asus using there pand --listen ... NAP without --master and client also pand --connect,
can NOT connect to asus using pand --listen ... without/with --master from windows,
can NOT connect to asus if hcid.conf contains accept, master;
can NOT pair from other devices (windows, palm tungsten), bluetooth is working correctly on them as i use zipslack10.0 computer in paralel.

Can anybody help, please smile

Re: Bluez and OpenWRT experimental [success]

Hi, very good and appreciated work! smile

For Iax I successfully compiled the miax ( http://miax.sf.net ) for Openwrt and it is working with the bluez packages, the only problem is that I have not any idea on how to make an ipkg, if someone has time to do it please let me know, it could be nice to share the work...

Re: Bluez and OpenWRT experimental [success]

waouw, this is great!
I'm new to openwrt, but have seen ipkg howtos on the web. seems not complicated.
still have to install asterisk on a pc first, then I'll try in openwrt with your miax.

My hotspot managed by http://worldspot.net with openwrt and coovachilli

Re: Bluez and OpenWRT experimental [success]

kvborg wrote:

Sry may poor english.

bluez working correctly as above , big thanks smile

can connect from asus as above and using pand,
can connect to asus using there pand --listen ... NAP without --master and client also pand --connect,
can NOT connect to asus using pand --listen ... without/with --master from windows,
can NOT connect to asus if hcid.conf contains accept, master;
can NOT pair from other devices (windows, palm tungsten), bluetooth is working correctly on them as i use zipslack10.0 computer in paralel.

Can anybody help, please smile

From http://www.jeremythompson.uklinux.net/RH8-0/bluezhowto.pdf :
For using the role switch function you will need hardware that supports this feature.

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

ubaldo wrote:

Hi, very good and appreciated work! smile

For Iax I successfully compiled the miax ( http://miax.sf.net ) for Openwrt and it is working with the bluez packages, the only problem is that I have not any idea on how to make an ipkg, if someone has time to do it please let me know, it could be nice to share the work...

Have a look at his thread:
http://forum.openwrt.org/viewtopic.php?id=1864

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

to build a package, there is a wiki here (not tested yet)
http://wiki.openwrt.org/BuildingPackages

My hotspot managed by http://worldspot.net with openwrt and coovachilli

Re: Bluez and OpenWRT experimental [success]

Thanx Sophana, Markus already did it and sent me a precompiled miax, so now it is clear how it works.

I hope to have the new miax ready for this weekend.

Another question, Markus when is bluez going to be part of the experimental on openwrt site?

18 (edited by markushx 2005-08-18 13:28:59)

Re: Bluez and OpenWRT experimental [success]

Another question, Markus when is bluez going to be part of the experimental on openwrt site?

It is part of CVS HEAD at the moment.

Ubaldo,
I have now also an asterisk running and miax is connected and authenticated to it. How can I tell asterisk to connect
t610 <-bt-> asus <-miax-> asterisk <-sip-> sipprovider
so that i can call from landline to the mobile using voip? Do you have examples for sip.conf, iax.conf, extensions.conf?

Markus

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

I don't know whom to contact for this. But before it can be released, there should be some kind of start script for the hcid and the ipkg should automatically insert the modules in /etc/modules. Nevertheless I contacted Nico to insert my repository into his tracker.

The usb modules are not that packaged. we still have to add lines into /etc/modules.
it seems quite easy to add packages in cvs, i've looked into it a little bit.
Maybe you should propose a patch to have it included in cvs.

My hotspot managed by http://worldspot.net with openwrt and coovachilli

Re: Bluez and OpenWRT experimental [success]

sophana wrote:

Maybe you should propose a patch to have it included in cvs.

To whom?

Using Asus WL-500g and WL-500gx

21

Re: Bluez and OpenWRT experimental [success]

markushx wrote:
sophana wrote:

Maybe you should propose a patch to have it included in cvs.

To whom?

For example to me, nbd, mbm or Kaloz.

It is nothing for whiterussian, but I would integrate it to HEAD, if you send me a fine patch.
(mail me wbx@thinknow.de)

Re: Bluez and OpenWRT experimental [success]

wbx wrote:

For example to me, nbd, mbm or Kaloz.

It is nothing for whiterussian, but I would integrate it to HEAD, if you send me a fine patch.
(mail me wbx@thinknow.de)

OK, wbx checked it into CVS HEAD.
Thanks.

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

I had problems with connecting bluetooth handsfree to usb bt dongle in my router. Sound was sometimes chopped, sometimes just a noise in both playing and recording. It also caused GP faults and even system crashes.

Firstly I suspected asterisk and chan_bluetooth, however hstest from blues-utils was doing almost the same. After a week of bug hunting I discovered mad (probably DMA) writes to isoc buffers. SCO in hci_usb.c uses 17 bytes chunks to transfer. And those beginning at odd address got written sometimes from buf[-1], some had unwritten second dword and some had an extra byte after the end of a buffer.

Aligning buffers word boundary magically resolved all problems. Asterisk now works great and I can make and answer voip call with PC switched off.

There is the base of a patch (which I send it to wbx):

--- linux-2.4.30/drivers/bluetooth/hci_usb.c    2004-08-08 01:26:04.000000000 +0200
+++ linux-2.4.30/drivers/bluetooth/hci_usb.c    2005-07-25 20:12:11.000000000 +0200
@@ -259,6 +259,9 @@
        void *buf;

        mtu  = husb->isoc_in_ep->wMaxPacketSize;
+#ifdef CONFIG_BCM4710
+       mtu = (mtu + 1) & ~1;           /* brcm: isoc buffers must be aligned on word boundary */
+#endif
         size = mtu * HCI_MAX_ISOC_FRAMES;

        buf = kmalloc(size, GFP_ATOMIC);

I'm not sure what brcm chips have that bug. I have ASUS WL-500G, hardware_version=WL500-02-02-01-00, boardtype=bcm94710dev, clkfreq=125.
Powered by OpenWRT from cvs HEAD.
I'm using BT dongles iTec, CSR chip ver 2.72 and BlueTrek G2 HF.

Re: Bluez and OpenWRT experimental [success]

For some progress on Asterisk, chan_bluetooth, bluez and Headset working together with SIP see thread:
http://forum.openwrt.org/viewtopic.php?id=2187

Using Asus WL-500g and WL-500gx

Re: Bluez and OpenWRT experimental [success]

Updated Image and Packages for Whiterussian RC4 can be found here:
http://www.comnets.uni-bremen.de/~mab/openwrt/whiterussian/

Using Asus WL-500g and WL-500gx