# Billionton PCBTC1A-B Bluetooth PCMCIA - not working?

## JSylvia007

Just wondering if anyone has gotten the Billionton PCBTC1A-B PCMCIA card to work correctly in Gentoo...  I have't had any luch what-so-ever.  I would appreciate the help if anyone has.  Also, recommendations on other PCMCIA bluetooth cards - because my 700m doesnt have internal support for it...

~Jake

----------

## HomerJ

Any luck with that??  I'm in the same boat.

----------

## JSylvia007

Still nothing...  I keep trying though...

----------

## JSylvia007

IT WORKS!!!!  After weeks of googling and trying everything under the sun i've gotten it to work.  To make a long story short, do the following...

Eject and replug your PCMCIA card... perform a DMESG... at the end the device should be assigned to a tty...  Mine shows up as ttyS0 (thats Capital S zero).

Once you have that number, issue the following commands as root:

```

setserial /dev/ttyS0 baud_base 152000 #notice here that that i am using MY tty number... everything else should remain the same

hciattach -s 152000 /dev/ttyS0 bcsp # same goes for this line - just change the tty number

hcid # this launches the bluetooth HCI daemon (gives you mouse and keyboard support

killall -9 hidd # this line is to kill any other hidd processes that started on startup... I was having trouble if there was a HIDD loaded

```

This line here is how i connect to my MX1000 mouse:

```
hidd --connect XX:XX:XX:XX:XX:XX
```

NOW...  I need all of your help...

Here i have stated that one must remove and reinsert the card to get it mapped to a tty device...  There MUST be a way to get this to happen at startup via UDEV... but i am totally green to udev.  Also, if i understand udev rules correctly, i should be able to call the setserial and hciattach lines once the device is mapped to ttyS0...

Any thoughts or ideas?

~Jake

----------

## JSylvia007

Ok... so reading the UDEV tutorial...  I figured this out... I think...

This is a possible UDEV rule:

```
beowulf-laptop jsylvia # cat /etc/udev/rules.d/99-personal.rules

#Insertion, serial mapping of Bluetooth PCMCIA Card:

KERNEL=="0.0", SUBSYSTEM=="pcmcia_socket", SYSFS{card_id}=="0x950b", SYSFS{manf_id}=="0x0279", SYSFS{prod_id2}=="Bluetooth Card", RUN+="/bin/setserial /dev/ttyS0 baud_base 152000 && /usr/sbin/hciattach -s 152000 /dev/ttyS0 bcsp && hcid"
```

This however... doesnt do anything... it doesnt error... nothing...  Am i doing something wrong?

~Jake

----------

## JSylvia007

Ok... so i noticed that the line in the above post needed to be in 10-local.rules... Its there now, but still not working.  Here is more information basically...  I just need a UDEV rule based on this information:

```
$udevinfo -ap /sys/class/pcmcia_socket/pcmcia_socket0/device/0.0

looking at class device '/sys/class/pcmcia_socket/pcmcia_socket0/device/0.0':

    KERNEL=="0.0"

    SUBSYSTEM=="pcmcia_socket"

    SYSFS{card_id}=="0x950b"

    SYSFS{func_id}=="0x02"

    SYSFS{function}=="0x00"

    SYSFS{manf_id}=="0x0279"

    SYSFS{modalias}=="pcmcia:m0279c950Bf02fn00pfn00pa281F1C5Dpb7664FB1Dpc00000000pd00000000"

    SYSFS{prod_id1}=="PCMCIA"

    SYSFS{prod_id2}=="Bluetooth Card"
```

----------

## muhr

Hi

I also have a PCMCIA Bluetooth card. My udev rules look like this:

```
# IBM Bluetooth PC Card II

KERNEL=="ttyS?", ACTION=="add", SYSFS{card_id}=="0x4254", SYSFS{manf_id}=="0x0105", RUN+="/etc/udev/scripts/ibm_bluetooth.sh %n"

KERNEL=="ttyS?", ACTION=="remove", RUN+="/etc/udev/scripts/ibm_bluetooth.sh %n"
```

The problem with this is that in the "remove"-event you can't filter for the card_id and manf_id parameters. That's why I've written a special script. It looks more or less like this:

```
#!/bin/sh

#

# UDEV run-script for IBM Bluetooth PC Card II

#

case $ACTION in

        add)

                /usr/sbin/hciattach -p -s 230400 /dev/tts/$1 bcsp >/var/run/hciattach.$1.pid

                # BEGIN DEBUG

                logger "ibm_bluetooth.sh: attach to /dev/tts/$1"

                # END DEBUG

                ;;

        remove)

                if [[ -f /var/run/hciattach.$1.pid ]]; then

                        kill `cat /var/run/hciattach.$1.pid`

                        rm /var/run/hciattach.$1.pid

                        # BEGIN DEBUG

                        logger "ibm_bluetooth.sh: detach from /dev/tts/$1"

                        # END DEBUG

                fi

                ;;

esac
```

Another problem with my IBM card is that I only get these udev-events when my card is listed in /usr/src/linux/drivers/serial/serial_cs.c, but I guess this is the case for your card as you get a /dev/ttySX device when you insert it.

Hope this helps.

-- muhr

----------

## JSylvia007

Alright... now we are getting somewhere!!  I guess good things really do come to those who wait... and are persistent...  Ok... here is the situation now...

using muhr's hints above, i modified my udev rule to reflect this:

```
KERNEL=="ttyS0", ACTION=="add", SYSFS{card_id}=="0x950b", RUN+="/etc/udev/scripts/startMouse.sh"
```

contents of /etc/uev/scripts/startMouse.sh:

```

#!/bin/bash

/bin/setserial /dev/ttyS0 baud_base 115200

/usr/sbin/hciattach -s 115200 /dev/ttyS0 bcsp

/usr/sbin/hcid

```

So this now works.  If i boot the system without the card in, and then insert the card...  my mouse device comes up perfectly.  

BUT... if i bootup the computer with the PCMCIA card already in the slot, i must eject it, and reinsert it to get it mapped to ttyS0.  

Is there any way to get this detected automatically at boot so I don't need to unplug / reinsert?

~Jake

[edit] changed the speed from 152000 to 115200 [/end edit]

----------

## muhr

Do you have coldplug installed?

For me, it works somehow like this:

1. Coldplug registers serial_cs with the PCMCIA card, which triggers the udev rule for the card

2. Bluetooth init script starts hcid which brings up hci0

By then, it is fully working.

-- uhrm

----------

## JSylvia007

This is strange...  Coldplug doesnt seem to do this for me until i eject/insert the card...

~Jake

----------

## JSylvia007

Can anyone here shed light on my predicament?

~Jake

----------

