You are not logged in.

#1 2011-01-22 09:55:22

haohaolee
Member
Registered: 2011-01-17
Posts: 3

[solved]Udev bluetooth rules not triggered during booting

Hi guys,

I have a bluetooth usb dongle, and the default udev bluetooth rule works well (97-bluetooth.rules), which starts the bluetoothd

But this only works when I plug the dongle in after the system boots, if I remain the usb plugged during booting, the bluetooth service doesn't start up.

So how can I solve this?

it seems its related to the dbus, i'm not sure.

Thanks

Last edited by haohaolee (2011-01-23 01:58:14)

Offline

#2 2011-01-22 17:19:53

dvdhrm
Member
From: Germany
Registered: 2011-01-22
Posts: 23

Re: [solved]Udev bluetooth rules not triggered during booting

Are you sure the udev bluetooth rule is not started? Or could it also be that the daemon stops right after starting? Try looking at the "dmesg" output right after plugging in your bluetooth dongle and then compare the lines with the ones you find in dmesg right after booting your machine.
What does "lsusb" say after you booted your machine with the dongle plugged in? What does "lsmod" (if you compiled your bluetooth kernel code as module) say?

Offline

#3 2011-01-22 19:13:39

haohaolee
Member
Registered: 2011-01-17
Posts: 3

Re: [solved]Udev bluetooth rules not triggered during booting

dvdhrm wrote:

Are you sure the udev bluetooth rule is not started? Or could it also be that the daemon stops right after starting? Try looking at the "dmesg" output right after plugging in your bluetooth dongle and then compare the lines with the ones you find in dmesg right after booting your machine.
What does "lsusb" say after you booted your machine with the dongle plugged in? What does "lsmod" (if you compiled your bluetooth kernel code as module) say?

thanks for your reply.
No matter whether I plug in the dongle before or after the booting, lsusb will list the bluetooth device and, hciconfig will list it too.

And I now have a solution or workaround. I launch a "udevadam trigger" command in the rc.loca filel, and the bluetoothd is up if the dongle is in.

I don't know why, but it works now. Maybe you guys know the cause.

Offline

#4 2011-01-22 20:56:54

dvdhrm
Member
From: Germany
Registered: 2011-01-22
Posts: 23

Re: [solved]Udev bluetooth rules not triggered during booting

I just looked at my own system and I have the same problem, however, the udevd debug log says:
"udevd-work: '/usr/sbin/bluetoothd --udev' returned with exitcode 1"
That is the bluetooth daemon is definitely started but seems to exit directly after it. When running
"udevadm trigger" the same line occurs but it returns with exitcode 0 so it started correctly.

Since the bluez guys refused providing decent documentation, log-files or debug facilities I can't get to
see why the daemon does not start, however, I assume it's because the syslog-daemon is not started yet
or some other requirement is not met.

In your case I would recommend adding "bluetoothd" to your startup-daemons by adding "bluetooth" to
the DAEMONS variable in /etc/rc.conf instead of retriggering all udev events with "udevadm trigger".
The bluetooth daemon should shut down if there is no bluetooth device available, anyway, so starting it
should have the same effects as your udevadm trick wink

EDIT:
After some more investigation the main() function of bluetoothd simply returns 1 if no dbus connection could
be established so adding "bluetoothd" behind "dbus" in the DAEMONS array should solve your problem wink

Last edited by dvdhrm (2011-01-22 21:00:22)

Offline

#5 2011-01-24 11:41:15

bzt
Member
From: Germany
Registered: 2010-04-11
Posts: 39

Re: [solved]Udev bluetooth rules not triggered during booting

dvdhrm wrote:

EDIT:
After some more investigation the main() function of bluetoothd simply returns 1 if no dbus connection could
be established so adding "bluetoothd" behind "dbus" in the DAEMONS array should solve your problem wink

I had to add "bluetooth", not "bluetoothd" to the DAEMONS array. Anyway, big thanks for pointing out the direction to the solution. smile

Offline

Board footer

Powered by FluxBB