PDA

Bekijk de volledige versie : Bluez drivers compilation: 90% done



hugo
08-12-2004, 20:18
Hi,

I've been trying to get my bluetooth CSR dongle to work on the Asus Wl-HDD (I know this is not the right forum, but this is of interest for any user of this firmware) and I'm using uclibc to make it work on Oleg's latest firmware (1.8.1.7-3)

I have already compiled libusb, and the necessary package for bluez (lib and tools). Programs are working, but I need to get hci_usb.o module to compile.

I've been enabling Bluez=m and USB_bluetooth=m in .config for the kernel. The only file I get in return is bluetooth.o which is not working for CSR. I don't find any option to get the ..../linux/drivers/bluetooth/hci_usb.c to compile. Of course, I might try to use a hand made build command, but I never compiled kernel modules without a full makefile.

This is the last stone to get this stack working. Applying the kernel patch for 2.4.20 kernel from bluez website give some errors, including in the hci_usb.c file, so I decided not to use them.

Could anybody give me the last push to make this working? I think the PAN profile could be working with this stack. I just need the hci_usb.o file and the necessary instruction to get it.

Thanks


EDIT: Done it. I'll post the Wiki page later on. Here is the tarball for bluez. a sample bluez script is at root, but it's not fully working. Just need to change a few thinks. Any PAN how to will show you how to end this script. I(ve been testing succesfully with my Ipaq, and i'll post more on this later.

Dex
08-12-2004, 21:33
Hi Hugo,

I have already compiled the tools and modules for bluez. Take a look at
this thread.

http://wl500g.info/showthread.php?t=749

Dex

hugo
08-12-2004, 23:02
Thanks dex for your binary. It was the missing link. May I ask you how you managed to compile the kernel modules? I think I'll create a wiki page for the tutorial because this is an interesting project.

I'll post my binary also, because I've been compiling all the other tools from bluez, so it can be of interest for some.

My purpose was at the begining to get hid2hci working for my dongle, to use affix stack. But it ended up to be compiled wholly.

Dex
09-12-2004, 00:10
Hello hugo,

to compile the bluez module hci_usb.o you have to use the kernel option:

Bluetooth Support -> Bluetooth device drivers -> <M> HCI USB driver (-> hci_usb.o)

The option USB Support -> USB Bluetooth Support must be disabled. The module bluetooth.o
can't be used with the bluez protocol stack.

I got an error message after applying the latest bluez kernel patch too. Therefore I build
the modules from the original WL-HDD GPL v1.1.2.6 and until now my applications using
the bluez protocol stack are running fine. The only problem I recognize is that the WL-HDD
does not recognize the USB Bluetooth dongle (Acer BT 600) at all. I don't know what the
problem is, but I realized that this situation only happens after 10 minutes the WL-HDD is
running and when the device is warm. I assume it's an hardware problem.

Dex

Styno
09-12-2004, 09:17
I think I'll create a wiki page for the tutorial because this is an interesting project.
That would be a terrific contribution, thanks in advance.

hugo
10-12-2004, 20:25
First post edited. Is it possible to change the title in today posts?

Oleg
10-12-2004, 20:34
Hugo, tarball means something produced with tar, not with rar. :) Your attachments looks like a rarball. :D

hugo
10-12-2004, 21:14
Hum, it was a tarball until I realised the upload limit was set to 1 Meg :rolleyes:

hugo
11-12-2004, 14:03
Sorry, my release contains in the bin folder curl and l2send from dex binary. They can be removed if you just need bluez, as they are not a reult from my compilation.

xlephant
03-02-2005, 20:56
@hugo
thx for your answer in the other thread. i think its better to go ahead in this one...

did you already working on a readme for the wiki?
or can you give me just a small tutorial how i have to install the BlueZ stack on my wl500g(fw:1.9.2.7-3b) ?! that will be very nice. thx a lot...

hugo
03-02-2005, 21:41
Sorry xelephant, I don't have much time tonight

Here is the script I use to set up pan:


insmod /tmp/hd/conf/lib/bluez.o
insmod /tmp/hd/bluetooth/result/lib/modules/hci_usb.o
insmod /tmp/hd/conf/lib/l2cap.o
insmod /tmp/hd/bluetooth/result/lib/modules/bnep.o
export LD_LIBRARY_PATH='/tmp/hd/conf/usr/lib'
/tmp/hd/bluetooth/result/sbin/sdpd
/tmp/hd/bluetooth/result/sbin/hcid
/tmp/hd/bluetooth/result/bin/sdptool add NAP
/tmp/hd/bluetooth/result/bin/sdptool add DUN
/tmp/hd/bluetooth/result/bin/pand --listen --role NAP
/tmp/hd/bluetooth/result/sbin/hciconfig hci0 up

Please set export line to your lib path (the one for bluetooth in my tarball) and all other line to your path to this files.

You can then take your PPC and go to network settings to set up an ip adress for your PPC. Use 10.0.0.2 and netmask 255.0.0.0 and 10.0.0.1 as gateway and dns server.create a bluetooth network. Once connected, use ifconfig pan0 10.0.0.1 and test pinging 10.0.0.2

Please check using ifconfig the name pan0 as I'm not sure and not enough time to check.

You can make this automatic, using some files, and I'll post more about this later on.

hugo
03-02-2005, 21:44
For automatic step ifconfig and all, create a file
/tmp/etc/bluetooth/pan/dev-up

with the following code:

#!/bin/sh
ifconfig $1 10.0.0.1


Don't forget to set up bluetooth IP adress on pocket pc using settings -network-bluetooth pan driver

xlephant
14-03-2005, 15:04
hi hugo,

thx for the answer and help. sorry that i reply so late, but time is rare :o .

i tried so you describe above but i think it is not working. see yourself:



[root@myrouter bluetooth]$ ./bluez
No devices in HCI mode found
Using /tmp/harddisk/bluetooth/result/lib/modules/bluez.o
Using /tmp/harddisk/bluetooth/result/lib/modules/hci_usb.o
Using /tmp/harddisk/bluetooth/result/lib/modules/l2cap.o
Using /tmp/harddisk/bluetooth/result/lib/modules/bnep.o
NAP service registered
interface bnep0 does not exist!


i 'm not a linux genius, but i think i have to setup the interface bnpe0 right(how?)? furthermore i think bluez didn't find my bt stick, because of "no devices in hci...". but i think my device (MSI pc2pc MS-6967) must be supportet. it was running well with suse linux 9.1 and bluez stack.

if i try to send a file to the router, my ppc found it but i can't send any files.
do i have to send up the profiles (e.g. pan, pim etc ?)

thx for your help...

xlephant
14-03-2005, 15:49
the router interface tells me the following:

Mar 14 15:52:56 kernel: BlueZ Core ver 2.2 Copyright (C) 2000,2001 Qualcomm Inc
Mar 14 15:52:56 kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Mar 14 15:52:56 kernel: BlueZ HCI USB driver ver 2.1 Copyright (C) 2000,2001 Qualcomm Inc
Mar 14 15:52:56 kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Mar 14 15:52:56 kernel: usb.c: registered new driver hci_usb
Mar 14 15:52:56 kernel: BlueZ L2CAP ver 2.1 Copyright (C) 2000,2001 Qualcomm Inc
Mar 14 15:52:56 kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Mar 14 15:52:56 kernel: BNEP: BNEP2 ver 1.0
Mar 14 15:52:56 kernel: BNEP: Copyright (C) 2002 Inventel
Mar 14 15:52:56 kernel: BNEP: Written 2001,2002 by
Mar 14 15:52:56 kernel: BNEP: ^IClement Moreau <clement.moreau@inventel.fr> David Libault <david.libault@inventel.fr>
Mar 14 15:52:56 kernel: BNEP: Copyright (C) 2002 Maxim Krasnyanskiy <maxk@qualcomm.com>
Mar 14 15:52:57 sdpd[165]: Bluetooth SDP daemon
Mar 14 15:52:57 hcid[167]: Bluetooth HCI daemon
Mar 14 15:52:57 hcid[167]: Can not open /etc/bluetooth/hcid.conf
Mar 14 15:52:57 hcid[167]: Config load failed
Mar 14 15:52:57 hcid[167]: Can't open PIN file /etc/bluetooth/pin. No such file or directory(2)
Mar 14 15:52:57 pand[170]: Bluetooth PAN daemon
Mar 14 15:52:57 hcid[167]: HCI dev 0 up

do i have to copy the etc files to the root/etc/bluetooth folder?

hugo
14-03-2005, 16:54
Don't worry for the HCI not found, this is a special trick to make my Dlink work, as it boot up in HID mode.

You can even remove this line.

Your problem is in the syslog: the hcid.conf config file must exist in /etc/bluetooth

It should then run fine. The bnep0 interface is created when you connect using your BT device. It won't exist before that. But the error you get is because the hcid is not running.

After the initial connection, the ppp script is readen to set up the ip.

hugo
14-03-2005, 16:58
You must use participate to a local area network profile on your Pocket PC to connect. It is the PAN profile. Rfcomm profile won't work (ie connect as modem). But if you get a working setup on this, i'll glad to hear. Problem is to get a working rfcomm.o with tty support. Even user mode rfcomm doesn't work with this

xlephant
15-03-2005, 08:57
hi hugo,

thanks for the reply and help. i've a MDA Compact (Imate Jam) with the MS bluetooth stack. and that is bad. because it is not supporting PAN profile. i tried with an other stuck from here:
http://forum.xda-developers.com/viewtopic.php?t=18537

but doesn't work with headsets ;-). so i need (i think) the DUN profile. do you know how to integred it? i'm not sure about the DUN profile but i hope it will be work. if you understand german. see here:
http://www.ppc-welt.info/community/showpost.php?p=500530&postcount=9

hope you can help me. thx a lot.

hugo
15-03-2005, 11:44
I know what you want, and I tryed also as wel, even on stuff not present here. DUN is not possible ATM with bluez. You might have more chance with affix stack.

You might try also the cab file with the widcomm stack, if oyu are not afraid of a hard reset to go back to the previous one (do a full backup before installing so you can go back quickly).

You can activate headset profile with a registry setting if you need.

For DUN, you need a working rfcomm program. If you try the one from my distrib, it won't work, because rfcomm.o doesn't include tty.o, and it must be included in kernel to work, not as module.

You also need chat program (from the compilation source of pppd) to establish the communication. But it won't work before we get a valid rfcomm.o

xlephant
15-03-2005, 11:52
You might try also the cab file with the widcomm stack,

a lot of people tried already the widcomm stack from toshiba, see here:

http://forum.xda-developers.com/viewtopic.php?t=15604

but not with success. :-(


You can activate headset profile with a registry setting if you need.

what do you mean with that? in context to the widcomm stack or the Bluesoleil stack? do YOU know how?

anyway, maybe i have to try the affix stack again. i tried before but it didn't run who knows why?

thx hugo maybe we can get the rfcomm running :o

hugo
15-03-2005, 12:28
On widcomm stack, there is a registry setting to activate headset profile. I know this for sure on my Ipaqs. The widcomm stack you can install is probably not different. I can search the registry setting for you, but it is heavily posted on brighthand forum. This is if you want to go on the PAN road. For the DUN, I've given up the rfcomm way, but I can post my finding if somebody want's to go further.

m.scholze
24-07-2005, 11:11
Hi there,

in accordance with this Hugo&Dex's how-to thread I've been trying to get BT dongle (MSI MS-6967) to work on the Asus WL-500gx with Oleg's firmware 1.9.2.7-CR6b.

Everything works well until the last line of this script:


insmod /tmp/harddisk/bluetooth/lib/modules/bluez.o
insmod /tmp/harddisk/bluetooth/lib/modules/hci_usb.o
insmod /tmp/harddisk/bluetooth/lib/modules/l2cap.o
insmod /tmp/harddisk/bluetooth/lib/modules/bnep.o
export LD_LIBRARY_PATH='/tmp/harddisk/bluetooth/lib'
/tmp/harddisk/bluetooth/sbin/sdpd
/tmp/harddisk/bluetooth/sbin/hcid
/tmp/harddisk/bluetooth/bin/sdptool add NAP
/tmp/harddisk/bluetooth/bin/sdptool add DUN
/tmp/harddisk/bluetooth/bin/pand --listen --role NAP
When I start pand, there are a lot of these lines in syslog:


Jul 24 10:48:06 pand[2590]: Accept failed. Resource temporarily unavailable(11) and their amount rapidly increases (aprox. 100 lines per second) until I kill pand.

Can someone tell me what's wrong and how to set it right?

Thank you.

remixme
15-10-2005, 02:41
Yep, I am definitely having the same problem as m.scholze on 1.9.2.7-5a using an Acer BT500.

My script is setup the same as m.scholzes with all the files in the appropriate places. I have also copied the correct files to /etc/bluetooth/

My script is slightly different to m.scholze as it has the -M

/tmp/harddisk/bluetooth/bin/pand --listen --role NAP -M

But I just get that same error:
Jan 1 00:17:17 pand[549]: Bluetooth PAN daemon
Jan 1 00:17:17 pand[549]: Accept failed. Resource temporarily unavailable(11)
Jan 1 00:17:17 pand[549]: Accept failed. Resource temporarily unavailable(11)
Jan 1 00:17:17 pand[549]: Accept failed. Resource temporarily unavailable(11)
Jan 1 00:17:18 pand[549]: Accept failed. Resource temporarily unavailable(11)

Any ideas?

hugo
15-10-2005, 10:29
Don't forget the drivers are usually compiled using one version of the system, and there has been one major evolution in Oleg's firmware since then. I guess there is some incompatibility, but I haven't tested. I don't want to go back to this, because there is already a bluez project available as a package, and it should be this one to be maintained from now on.

remixme
15-10-2005, 14:08
Okay, I understand, I'm willing to have a go at getting this working again in any case......

Ironically I am in a similar situation to xlephant in that I have an mda compact.
I got the bluesoleil stack detailed forums.xda-developers.com working for PAN on my device, and I managed to get good internet access over bluetooth and ran SkyPE on my pocketpc! Now I just want the bluetooth intregrated with the router!

I mean I even had to install a hacked stack to get my dongle working under XP SP2, as mine is no longer supported, I guess since I've come this far, I may as well carry on.

Xlephant judging my his log entries managed to get pand running using 1.9.2.7-3b, so I may try downgrading to that to see if I get the same result.

I can also try another bluetooth dongle, failing these options I presume I'd have to go and recompile the modules against the lastest source.

hugo
15-10-2005, 17:19
You can try an older version, if you have PAN profile on your XDA compact. I've been testing this also for a pocket pc, but lost interest because all my pocket pc have wi-fi. Actually, you can get a full network connection using the firmware version that was up to date at the date of my first post in the thread, but I wanted to make DUN working to automaticaly connect. PAN was perfectly operational for me, but needed to be activated by hand, and also needed a fixed IP on pocket pc side (on the bluetooth network card).
Your dongle should be working because you don't have any error message in the loading of the modules ( .o files)

remixme
16-10-2005, 02:05
Well it works with 1.9.2.7-3b, so at least now I have an option.

Basically under 3b it doesnt display the behaviour mentioned above, furthermore if I do a bluetooth discovery on my mda compact it appears as 'bluez'

I can find and join the PAN service, and a ping from the router to 10.0.0.2 brings back results in the 100-200ms range, I couldn't quite get internet to work under pocket IE but I suspect there is a setting wrong on pocket pc.

btw Hugo, thank's for all the hard work you have put into this thread!

I understand the fact that you have to wish to return to this stuff as it is quite time consuming! But I appreciate the fact that you took the time to reply!

Maybe if I can figure out which exact revision that has broke bluez, a fix can be found, as compiling from different sources seems like a bit of a stab in the dark without knowing the exact cause.

remixme
16-10-2005, 02:42
Well I can confirm one thing and that is that the upgrade to 1.9.2.7-4 is the one that breaks bluez :confused: 1.9.2.7-3c works fine.

All firmwares beyond this point exhibit the resource unavailable problem. Now to figure out what has changed between these two points that could have broken pand support?

I guess I could always try compiling from scratch with certain patches removed to try and find out more. But I suspect it is the fact that the uclibc chain has been updated?
http://wl500g.info/showthread.php?t=1917

hugo
16-10-2005, 10:38
have you tryed using a mix between my bluez version, and the 2 packages available as ipkg? I remember compiling the pan drive separatly by recompiling this with kernel from the source. I think somebody can try to just select then bluez PAN support in kernel and compile the module from one of the latest working environment. I cannot do it as I don't have a proper compiling setup anymore. The basic would be to setup the firmware compile environment as described by oleg, and to test it without any change. Then you have to modufy the kernel .config file to add the BNEP line (you have to search for this one cause my memory is too far away). You will end up with the bnep.o module that should make the trick. Hope this work.

remixme
16-10-2005, 18:41
Thanks for the tip,

I have gentoo linux almost setup on another partition, just need to get around to sorting a networking problem and then I can do the recompile. May take me a while but I shall report back results.

remixme
22-10-2005, 22:24
Right, after getting my linux install back on my computer.
I went and recompiled the modules using the lastest 1.9.2.7-6b sources.
Basically I went and compiled the firmware normally, I just changed the option for bluez in kernel.config to =m

And then got the newly compiled files, they are present in the attached file.

I had some success with the new files in that, when I replaced all four of the module files with my new ones, the script runs succesfully and pand doesn't panic.

My device detects the pan network and I can connect to it.
The router log shows my device connecting, so then I run


ifconfig bnep0 10.0.0.1
brctl addif br0 bnep0

I can then ping 10.0.0.1 but the problem is that I cannot ping 10.0.0.2!

My device is setup as before when I had it working with -3c, so I am doubtful that it is a device problem.

Here's my (edited) log:


Oct 22 20:18:30 login[131]: root login on `pts/0'
Oct 22 20:18:50 kernel: BlueZ Core ver 2.2 Copyright (C) 2000,2001 Qualcomm Inc
Oct 22 20:18:50 kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Oct 22 20:18:50 kernel: BlueZ HCI USB driver ver 2.1 Copyright (C) 2000,2001 Qualcomm Inc
Oct 22 20:18:50 kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Oct 22 20:18:50 kernel: usb.c: registered new driver hci_usb
Oct 22 20:18:50 kernel: BlueZ L2CAP ver 2.1 Copyright (C) 2000,2001 Qualcomm Inc
Oct 22 20:18:50 kernel: Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
Oct 22 20:18:51 kernel: BNEP: BNEP2 ver 1.0
Oct 22 20:18:51 kernel: BNEP: Copyright (C) 2002 Inventel
Oct 22 20:18:51 kernel: BNEP: Written 2001,2002 by
Oct 22 20:18:51 kernel: BNEP: ^IClement Moreau <clement.moreau@inventel.fr> David Libault <david.libault@inventel.fr>
Oct 22 20:18:51 kernel: BNEP: Copyright (C) 2002 Maxim Krasnyanskiy <maxk@qualcomm.com>
Oct 22 20:18:51 sdpd[161]: Bluetooth SDP daemon
Oct 22 20:18:51 hcid[164]: Bluetooth HCI daemon
Oct 22 20:18:51 hcid[164]: HCI dev 0 up
Oct 22 20:18:51 hcid[164]: Starting security manager 0
Oct 22 20:18:51 pand[170]: Bluetooth PAN daemon
Oct 22 20:19:33 pand[188]: New connection from 00:02:5B:00:A1:A1 bnep0 // Connection from the device
Oct 22 20:19:57 kernel: device bnep0 entered promiscuous mode
Oct 22 20:20:07 kernel: br0: port 3(bnep0) entering listening state
Oct 22 20:20:07 kernel: br0: port 3(bnep0) entering learning state
Oct 22 20:20:07 kernel: br0: port 3(bnep0) entering forwarding state
Oct 22 20:20:07 kernel: br0: topology change detected, propagating
Oct 22 20:20:29 kernel: br0: port 3(bnep0) entering disabled state // I manually disconnect the device
Oct 22 20:20:29 kernel: br0: port 3(bnep0) entering disabled state
Oct 22 20:20:29 kernel: device bnep0 left promiscuous mode

hugo
23-10-2005, 10:39
Did you set up a fixed IP on your pocket pc? DHCP will not work here. After connecting, try to ping from the pocket PC, and also, don't get stuck by a firewall problem. Do you still have internet connectivity after establishing the connection?

remixme
24-10-2005, 20:16
The firewall was turned off in the web interface whilst testing, I have the pocket pc set as 10.0.0.2 as before, I have not changed any configuration on the pocket pc from when it worked before.

I have internet connectivity from my computer.

But pinging 10.0.0.2 results in 100% packet loss.

So I'm at a complete loss now :-(

But I am going back to check that there is not an error in my script as, I was typing all the commands by hand before.