You are not logged in.
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
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
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
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
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
Last edited by dvdhrm (2011-01-22 21:00:22)
Offline
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
I had to add "bluetooth", not "bluetoothd" to the DAEMONS array. Anyway, big thanks for pointing out the direction to the solution.
Offline