* [Bluez-users] USB Bluetooth works manually, but won't hotplug with the SAME script
@ 2005-02-19 18:24 Alfredo Meraz
2005-02-20 16:45 ` [Bluez-users] " Sebastian Roth
0 siblings, 1 reply; 4+ messages in thread
From: Alfredo Meraz @ 2005-02-19 18:24 UTC (permalink / raw)
To: bluez-users
I have a TDK USB Bluetooth dongle, installed on a
computer with RedHat 9. After much research, I managed
to get it working with only bluez-libs 2.8-1 and
bluez-utils 2.8-1 installed with no kernel patch at
all (despite all the information I'd found saying
otherwise). So I thought about automating it with
hotplug and writing a mini-howto... but to my
surprise, the same script I'd used manually to bring
up the connection, loads all the drivers and runs the
programs needed (hcid, sdpd, rfcomm & dund) when run
from the hotplug functions, but there's a sort of
timing error with SDPD reported in all the devices
that try to connect. If I disable the loading through
hotplug and do it manually, it works again :S
I read the source and traced the hotplug programs
(/sbin/hotplug, /etc/hotplug/usb.agent), and found out
the way it works. First it loads the drivers from 3
different driver configuration files. Then, the script
gets loaded by adding a line in usb.usermap, so I
added it. There are actually 2 ways to make it load
the script, one by naming the script as the driver it
loads, the other naming it differently: none worked.
(To be honest, my head is fogged with this point at
the moment :( )
Then I tried to do everything manually through the
script, blacklist-ing the drivers: doesn't work.
I tried the log messages, which other than an error
reported with hcid with SIGCHLD and SIG_IGN, the logs
are the same when loaded manually and hotplugged. I
corrected this problem, by wait'ing for hcid in the
script, and again: doesn't work.
I thought also that it was the environment, but I
didn't try anything because I found nothing to try.
The script goes like this:
#!/bin/bash
/usr/sbin/hcid -f /etc/bluetooth/hcid.conf
/usr/sbin/sdpd
/usr/bin/rfcomm -f /etc/bluetooth/rfcomm.conf bind all
insmod hci_usb
hciconfig hci0 up
wait `pidof hciconfig`
sdptool add --channel=3 SP
dund --listen --channel 3 --msdun noauth
:192.168.1.240 crtscts 115200 ms-dns 192.168.1.1 lock
The only wait left, is my last try, since the PDA's
say something about a timing problem with sdp, which
didn't solve the problem :(
Any help, IS REALLY APPRECIATED. Even something just
to try, I'm willing to try ANYTHING (logic :) )
Thanx.
Alfredo.
_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bluez-users] Re: USB Bluetooth works manually, but won't hotplug with the SAME script
2005-02-19 18:24 [Bluez-users] USB Bluetooth works manually, but won't hotplug with the SAME script Alfredo Meraz
@ 2005-02-20 16:45 ` Sebastian Roth
2005-02-21 18:50 ` Alfredo Meraz
0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Roth @ 2005-02-20 16:45 UTC (permalink / raw)
To: bluez-users
Hi Alfredo,
I can't say what exactly the problem is but IMHO the script
is not structured very wise. Maybe the script is executed before
the needed modules are loaded when used for hotplugging.
Here is my suggestion for a script:
#!/bin/sh
# get the bluetooth things ready
PATH=/bin:/sbin:/usr/bin:/usr/sbin
# load all modules
modprobe bluetooth
modprobe hci_usb
modprobe l2cap
modprobe rfcomm
# start the deamons
# AFAIK the configfile paths are default
# so there is no need to specify these
hcid
sdpd
rfcomm bind all
# this is done by hcid!
# hciconfig hci0 up
# don't really know what these
# commands do but seems ok to me
sdptool add --channel=3 SP
dund --listen --channel 3 --msdun noauth
:192.168.1.240 crtscts 115200 ms-dns 192.168.1.1 lock
I have not tested this script but it _should_ work.
Best regards,
Sebastian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-users] Re: USB Bluetooth works manually, but won't hotplug with the SAME script
2005-02-20 16:45 ` [Bluez-users] " Sebastian Roth
@ 2005-02-21 18:50 ` Alfredo Meraz
2005-02-21 23:02 ` Marcel Holtmann
0 siblings, 1 reply; 4+ messages in thread
From: Alfredo Meraz @ 2005-02-21 18:50 UTC (permalink / raw)
To: bluez-users
Hi Sebastian :)
Thanks for your prompt help.
I've tried the script... unfortunately, again, it
works manually, but doesn't work with hotplug :( ... I
had to remove the "modprobe bluetooth", because it
didn't find the module, but AFAIK, the functionality
is implemented in hci_usb... I might be wrong on this
:(
What the last 2 lines do, is what other people are
suggesting to do with an rfcomm-kernel patch :)...
basically, the second to last line:
sdptool add --channel=3 SP
adds the Serial Port service to sdpd, and the last
line, fires up a pppd connection everytime a
connection request comes from channel 3, establishing
a connection to the palm :)
Is there a chance that the problem is caused by the
environment the kernel uses to execute the script is
more restricted than when I do it manually? If so, how
do I determine the difference? :S
Best regards.
Alfredo
--- Sebastian Roth <sebiroth@web.de> escribió:
> Hi Alfredo,
>
> I can't say what exactly the problem is but IMHO the
> script
> is not structured very wise. Maybe the script is
> executed before
> the needed modules are loaded when used for
> hotplugging.
> Here is my suggestion for a script:
>
> #!/bin/sh
> # get the bluetooth things ready
> PATH=/bin:/sbin:/usr/bin:/usr/sbin
>
> # load all modules
> modprobe bluetooth
> modprobe hci_usb
> modprobe l2cap
> modprobe rfcomm
>
> # start the deamons
> # AFAIK the configfile paths are default
> # so there is no need to specify these
> hcid
> sdpd
> rfcomm bind all
>
> # this is done by hcid!
> # hciconfig hci0 up
>
> # don't really know what these
> # commands do but seems ok to me
> sdptool add --channel=3 SP
> dund --listen --channel 3 --msdun noauth
:192.168.1.240 crtscts 115200 ms-dns 192.168.1.1
> lock
>
>
> I have not tested this script but it _should_ work.
>
> Best regards,
> Sebastian
>
>
>
>
-------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT
> Products from real users.
> Discover which products truly live up to the hype.
> Start reading now.
>
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/bluez-users
>
_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-users] Re: USB Bluetooth works manually, but won't hotplug with the SAME script
2005-02-21 18:50 ` Alfredo Meraz
@ 2005-02-21 23:02 ` Marcel Holtmann
0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2005-02-21 23:02 UTC (permalink / raw)
To: BlueZ Mailing List
Hi Alfredo,
> I've tried the script... unfortunately, again, it
> works manually, but doesn't work with hotplug :( ... I
> had to remove the "modprobe bluetooth", because it
> didn't find the module, but AFAIK, the functionality
> is implemented in hci_usb... I might be wrong on this
> :(
don't start any daemons from hotplug. You can run them without having
any device plugged in.
> What the last 2 lines do, is what other people are
> suggesting to do with an rfcomm-kernel patch :)...
> basically, the second to last line:
> sdptool add --channel=3 SP
> adds the Serial Port service to sdpd, and the last
> line, fires up a pppd connection everytime a
> connection request comes from channel 3, establishing
> a connection to the palm :)
This specific stuff is only needed for WinCE connection and actually
someone should test the --mrouter option from dund and report or fix any
problems.
> Is there a chance that the problem is caused by the
> environment the kernel uses to execute the script is
> more restricted than when I do it manually? If so, how
> do I determine the difference? :S
Don't call it from hotplug. There is no need for it.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-02-21 23:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-19 18:24 [Bluez-users] USB Bluetooth works manually, but won't hotplug with the SAME script Alfredo Meraz
2005-02-20 16:45 ` [Bluez-users] " Sebastian Roth
2005-02-21 18:50 ` Alfredo Meraz
2005-02-21 23:02 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.