View previous topic :: View next topic |
Author |
Message |
javeree Guru

Joined: 29 Jan 2006 Posts: 459
|
Posted: Tue Dec 20, 2011 10:56 am Post subject: bluetooth startup and udev timing issue |
|
|
I have a usb-based bluetooth dongle.
When the pc is started, the bluetooth service is also started by dynamic runlevel 'hotplugged'
However, after the startup, when I execute 'hcitool dev', no device is visible.
After some investigation, I found that in the case that bluetooth fails after startup, that lsmod shows the module rfcomm to be loaded, but that the module 'bnep' is missing.
If I then execute on the command line
Code: | udevadm trigger --subsystem-match=bluetooth --action=add |
then I see that the module 'bnep' gets loaded, after which the device is detected by 'hcitool dev'.
Since this does not happen at each reboot, I assume there is some timing issue between udev and the bluetooth device.
I am thinking about changing /etc/init.d/bluetooth to
Code: |
ebegin "Starting Bluetooth"
udevadm trigger --subsystem-match=bluetooth --action=add
# the line above has trouble loading all needed modules. Try to catch that using settle
udevadm settle
eend $?
|
but maybe there is a better way (e.g. changing the depend() statement). Any suggestions ? |
|
Back to top |
|
 |
ultraincognito Guru


Joined: 03 Jun 2011 Posts: 346 Location: Ukraine
|
Posted: Tue Dec 20, 2011 5:15 pm Post subject: |
|
|
I store the service /etc/init.d/bluetooth in the 'default' runlevel. And you? |
|
Back to top |
|
 |
javeree Guru

Joined: 29 Jan 2006 Posts: 459
|
Posted: Thu Dec 22, 2011 12:46 am Post subject: |
|
|
It is just autostarted with hotplugging because the presence of the usb bluetooth dongle is detected. |
|
Back to top |
|
 |
|