OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Security and Networking => Topic started by: knuth on March 15, 2004, 04:04:43 am

Title: Bluetooth PPP: Invalid argument(22)
Post by: knuth on March 15, 2004, 04:04:43 am
I connect to a PC using the pand daemon using the service GN as suggested elsewhere in the forum. The PC states that the zaurus is now using the connection, but immediately afterwards the connection is closed.
the pand command is as follows:
pand --role PANU --service GN --connect 00:0D:88:BE:A6:FF --nodetach

It returns: Connect to ... failed: Invalid argument (22)

If I use --service NAP it returns invalid permission (13) error. I have a widcomm stack on the PC (windows 2000).

Any hints? Any logfiles to look at?
Title: Bluetooth PPP: Invalid argument(22)
Post by: pakman on March 15, 2004, 12:27:54 pm
knuth - this sounds pretty similar to my configuration, and it works for me. However, check that you are using the latest version of the widcomm drivers. I am using 1.4.2.8 on Win2k (SP2), with a TDK systems USB bluetooth dongle . Before I upgraded I was using version 1.3.2 of the driver, and it didn\'t work for me either.

There may also be dependencies on the chipsets of of the BT cards that you are using. Perhaps if you post more details about your BT hardware, one of the knowledgeable readers on this forum may be able to make other suggestions.

P.
Title: Bluetooth PPP: Invalid argument(22)
Post by: knuth on March 16, 2004, 03:09:03 am
I reinstalled all the software on the PC (widcomm 1.4.1 build 6) and the bluez (2.3-2.4d und csr_serial01) and rebooted anything and now nothing works?
I have a dlink 650BT  CF card and a dlink 120BT USB dongle.
I can see the zaurus on my pc and can pair the two. But when I try to discover services on the zaurus, there are none.
Now calling pand, gives a \"failed to open control socket \"

hcid is running.

Do I have to install additional bluez packages (I found a bluez-sdp, etc.)?
Title: Bluetooth PPP: Invalid argument(22)
Post by: tumnus on March 16, 2004, 03:35:41 am
You should only install the bluez and bluez-csr-serial packages as stated here:
http://www.zaurususergroup.com/modules.php...ename=Bluetooth (http://www.zaurususergroup.com/modules.php?op=modload&name=phpWiki&file=index&pagename=Bluetooth)
You may well need the bluez-susp-resume package as explained in that howto also.

For a note about your CF card, please see this page:
http://www.zaurususergroup.com/modules.php...oothCardSupport (http://www.zaurususergroup.com/modules.php?op=modload&name=phpWiki&file=index&pagename=BluetoothCardSupport)
Title: Bluetooth PPP: Invalid argument(22)
Post by: pakman on March 16, 2004, 01:28:11 pm
knuth - I have had another look through my scripts, and I realised that I forgot about something. pand needs the bnep module to be loaded, and this does not always happen automatically for some reason - do \'lsmod\' from the console to check whether it is or not. If it does not appear on the list, do:

Code: [Select]
modprobe bnep

as root to load it, and then try pand again. You can also control which bnep interface is used with the -i argument to pand. For reference, here are the scripts that I use to connect to my PC:

Code: [Select]
#!/bin/bash



/home/QtPalmtop/bin/bton



# Set this to the Bluetooth address to connect to

baddr=XX:XX:XX:XX:XX:XX

# Set this to the IP number of the zaurus, or the name you have attached

# to the number in /etc/hosts, if applicable.

thishost=111.222.333.444

if=bnep0



# Check that we are not already connected

lsmod | grep -q ^bnep && pand -l | grep -q "$if  *$baddr" && exit



/usr/bin/sudo modprobe bnep

sleep 2



# -d form of --service does not always work

# Is it valid to specify bnep0 here?

# pand always seems to return 0, even if it fails

/usr/bin/sudo pand -i $if -r PANU --service GN -c $baddr -n

pand -l | grep -q "$if  *$baddr" &&

   /usr/bin/sudo ifconfig $if $thishost


where /home/QtPalmtop/bin/bton just ensures that Bluetooth is on:

Code: [Select]
#!/bin/bash

if [ ! -e /var/lock/subsys/bluetooth ]; then

   cardctl ident |

      grep -q \'product info: "Socket", "CF+ Personal Network Card Rev 2.5"\'

         || exit

   cardctl status | grep -q suspended && cardctl resume

   /usr/bin/sudo /etc/rc.d/init.d/bluetooth start 2>&1 >/var/log/bt.txt

fi


Edit this for your own card\'s cardctl info.

The corresponding scripts to disconnect and turn bluetooth off are:

Code: [Select]
#!/bin/bash

/usr/bin/sudo pand -k XX:XX:XX:XX:XX:XX


and

Code: [Select]
#!/bin/bash

if [ -e /var/lock/subsys/bluetooth ]; then

   /usr/bin/sudo pand -K

   /usr/bin/sudo killall pand

   /usr/bin/sudo modprobe -r bnep

   /usr/bin/sudo /etc/rc.d/init.d/bluetooth stop 2>&1 >/var/log/bt.txt

fi


I also use the bluez suspend/resume scripts that are referred to in tumnus\' howto.

I think that covers everything that I did to get this working.

Good luck,
P.
Title: Bluetooth PPP: Invalid argument(22)
Post by: knuth on March 17, 2004, 05:48:56 am
hello pakman,
the modprobe did it. my bluetooth network is now working. thanks a lot!