# Logitech diNovo switch to HCI mode failed... :(

## goubs

Hello,

I'm in kernel 2.6.5 and udev.

 I install bluez libs2 and utils2 form cvs

all seem ok (lsusb, ...) 

But when I run hid2hci is failed.

#/usr/local/bluetooth/sbin/hid2hci

Switching device 046d:c704 to HCI mode failed (No such file or directory)

an idea ?

may be missing device.

----------

## stens

Hello,

I have the same problem with my diNovo (2 days old  :Smile: ) under 2.6.5-mm6, but I don't have udev.

Did you find any solution for the problem?

----------

## potens

Hi,

I haven't the same problem (in fact, I have no more this problem) but I use a 2.6.6 kernel and the bluez-lib 2.7 and bluez-utils-2.7

I haven't said that it works !!! My experience is that when you switch to hci mode, your BT hub seems frozen :'(

If you have more luck than me, just wrote a line plz  :Smile: 

Good luck to you two.

Nicolas

----------

## Meeuw

i'm running:

net-wireless/bluez-libs-2.7 (my own version bump)

net-wireless/bluez-utils-2.7 (my own version bump)

kernel-2.6.6 - patch-2.6.6-mh1 (from bluez site)

and hid2hci tells me: 

Switching device 046d:c704 to HCI mode was successful

hcitool con gives me two connections, the Mediapad doesn't seem to connect  :Sad: 

----------

## potens

What modules do you load/are used ? I've tried to use the new hidp but it seems the daemon use it (hidd) but not the keyboard (who use the hci_usb modules).

Could you explain what you've done, it should be great (and boring to do, I know)

Have you tried to conncet the media pad with hcitool -c xx:xx:xx:xx:xx:xx (if

 I remember)

Good luck with your mediapad !

Nicolas

----------

## Meeuw

fyi: the mediapad suddenly seems to work...

my steps:

emerge:

development-sources-2.6.6

linux-headers-2.6.5

bluez-utils-2.7

bluez-libs-2.7

kdebluetooth-20040416

.config:

CONFIG_BT=y

CONFIG_BT_L2CAP=y

CONFIG_BT_SCO=y

CONFIG_BT_RFCOMM=y

CONFIG_BT_RFCOMM_TTY=y

CONFIG_BT_BNEP=y

CONFIG_BT_BNEP_MC_FILTER=y

CONFIG_BT_BNEP_PROTO_FILTER=y

CONFIG_BT_HIDP=y

CONFIG_BT_HCIUSB=m

CONFIG_BT_HCIUSB_SCO=y

CONFIG_BT_HCIUART=y

CONFIG_BT_HCIUART_H4=y

CONFIG_BT_HCIUART_BCSP=y

CONFIG_BT_HCIUART_BCSP_TXCRC=y

CONFIG_BT_HCIBCM203X=m

CONFIG_BT_HCIBFUSB=m

CONFIG_BT_HCIVHCI=m

At the moment it seems to work for me 'out of the box' (after starting /etc/init.d/bluetooth, i've created a gentoo initscript for it)

The hid doesn't seems to be very stable...

you can try:

hcitool scan to find devices

hcitool cc xx:xx:x... to connect

as you might know there are connect buttons at the bottom of the devices...

----------

## stens

My diNovo started to work as a BT device.   :Very Happy: 

My current setup:

 2.6.6-mm5 + mh1 patch

 bluez-libs 2.7

 bluez-utils 2.7

BUT:

1. My mouse very slow if I'm using it through BT HID.

2. I can't connect the Keyboard, MediaPad and the Mouse automatically (I have to press the connect button every time I want to use them as BT device)

3. After reboot I have to do the connect sequence again: connect on Keyboard than connect on the BT hub, without it nothing will work (in the grub menu and in Linux).

4. Booting to Windows after I tried the diNovo in BT mode under Linux, I have to connect everything again under Windows.

Note on 2:

As I recall the hcitool cc xx:xx:... does not worked for me, instaed I used the hidd to do the connect the diNovo..

Any idea?

----------

## Meeuw

I'm using hidd too to connect my keyboard... it takes a while (~5-8 seconds) but it's automatically detected.

when i press the 'connect' button the device gets unusable (maybe i should restart hidd when this happens?)

hcitool cc don't work for me either...

in bios setup / grub pressing the connect button on the bluetooth seems enough to turn the device back in hid mode.

sometimes removing the batteries seems to be required, even windows can't connect the keyboard.

hidd doesn't seem to use the /etc/bluetooth/link_key ... i suppose every device can associate...

i'm using the following procedure when it doens't work

1) reboot (works most at the time, and stable)

2) reboot, hysterically press connect buttons

3) shutdown, remove batteries

4) reboot to windows and connect, reboot to linux

btw. I'm running 2.6.7-rc1-mh2, the patch applied smoothless (some warnings on 'reverse patch')

once i had a kernel oops, but only at boot...

I hope linus soon applies the hiddev patch  :Smile: 

----------

## stens

I can connect my mouse without pressing the connect button on it, but it's still slow  :Shocked: .

When I try to connect my Keyboard or the MediaPad I receive the following error:

```
hidd --connect xx:xx:xx...

Can't create HID control channel: Invalid exchange
```

Now what...???

If I press the connect button on the Keyboard or on the MediaPad it will connect without any complains, but than in Windows I have to reconnect both of them again.

Also after reboot I can't use my keyboard in the Grub menu (OK, I have not tried to do the connect-connect thing), so I can't boot to Windows to reconnect the diNovo again. If I want to boot to Windows - after playing with BT, I have to turn off the comp for around 1 min than my keyboard will be connected, so I can select Windows from the Grub menu (Gentoo is the default  :Smile: ).

Booting into Linux, ssh to the box and switch to BT mode and connect the parts works.

My bigest problem right now the mouse. It feels slow and a bit sticky (not as smooth as when I'm not using it in BT mode).

I can live with the fact, that I have to reconnect the diNovo in Windows (I'm booting to Windows 3 or 4 times in a month anyway).

I only want my keyboard (and the MOUSE) to work under Linux using BT HID mode.

----------

## Meeuw

the best way would be a way to share the BT key in both windows and linux...

does someone know how to set the bt key for the 'native' hid?

----------

## scoon

 *Meeuw wrote:*   

> i'm running:
> 
> net-wireless/bluez-libs-2.7 (my own version bump)
> 
> net-wireless/bluez-utils-2.7 (my own version bump)
> ...

 

Hey there, 

I just got the mx900 bt combo and was wondering what modules are you loading for the bluetooth or are you compiling them in ?

thanks, 

scoon

----------

## Meeuw

i'm using the following modules: uhci_hcd, hci_usb and hidp

the most simple sequence is:

modprobe uhci_hcd

modprobe hci_usb

hciconfig hci0 up

modprobe hidp

hidd --server

hidd --search

if hidd can't find device you should re-run hidd --search and press the connect buttons, that always works for me.

I've wrote a simple hidd init script which keeps searching for my input devices until they are found, I will post it later!

----------

## scoon

 *Meeuw wrote:*   

> i'm using the following modules: uhci_hcd, hci_usb and hidp
> 
> the most simple sequence is:
> 
> modprobe uhci_hcd
> ...

 

Hey there, 

Thanks for your help.  I have it now working (for the most part).  I hacked together a perl script to get it all working on boot.  The thing is that the mx900 combo can work in EITHER bluetooth or wireless mode.  So, if the mouse works in bt mode and the keyboards don't get recognized then they do not work.  But if anyone is interested in my script, let me know and I will post it here and would appreciate some comments on it.

scoon

----------

## Meeuw

this is my hidd init script:

```
#!/sbin/runscript

KEYBOARDS="046d:b303"

MICE="046d:b001"

HIDDKEYBOARD=false

HIDDMOUSE=false

depend() {

        after bluetooth

}

scanforhid() {

        while ! ${HIDDKEYBOARD} || ! ${HIDDMOUSE} ; do

                for KEYBOARD in ${KEYBOARDS} ; do

                        if ! ${HIDDKEYBOARD} && OUTPUT=$(hidd --show|grep ${KEYBOARD}) ; then

                                HIDDKEYBOARD="true"

                                echo ${OUTPUT}

                                break

                        fi

                done

                for MOUSE in ${MICE} ; do

                        if ! ${HIDDMOUSE} && OUTPUT=$(hidd --show|grep ${MOUSE}) ; then

                                HIDDMOUSE="true"

                                echo ${OUTPUT}

                                break

                        fi

                done

                if ! ${HIDDKEYBOARD} || ! ${HIDDMOUSE} ; then

                        ${HIDDKEYBOARD} || echo "No keyboard"

                        ${HIDDMOUSE} || echo "No mouse"

                        hidd --search

                fi

        done

}

start() {

        ebegin "Starting Bluetooth hidd"

        local RETVAL

        [ -x /usr/bin/hidd ] && \

                start-stop-daemon --start --quiet --exec /usr/bin/hidd -- --server

        RETVAL=$?

        [ -x /usr/sbin/hid2hci ] && \

                /usr/sbin/hid2hci

        scanforhid &

        eend ${RETVAL}

}

stop() {

        start-stop-daemon --stop --quiet --exec /usr/bin/hidd

        eend ${RETVAL}

}
```

It's quite noisy on the console, but it works like a charm  :Wink: 

----------

## scoon

Hey there, 

That looks good but here is my perl solution: 

```

#!/usr/bin/perl

use strict;

our $DEBUG = 1;

eval {

        `hid2hci`;

        `hciconfig hci0 up`;

}; warn $@ if $@;

#-- may pass this into ARGV for other devices

my $brand_string = "Logitech Bluetooth";

my $hid_show = `hidd --show`;

print "Setting up connections to keyboard and mouse...\n";

my ($connected, $tries, $complete_failure) = 0;

while($connected == 0){

        eval {

                `hid2hci`;

                #`hciconfig hci0 up`; #-- maybe it didn't connect.

                `hidd --search`; #-- try and connect to some devices.

        }; warn $@ if $@;

        

        $hid_show = `hidd --show`; #-- see what we are connected to.

        print "Couldn't connect, will sleep for 8 seconds...\n";

        print "DEBUG MSG: '$hid_show'\n" if $DEBUG;

        $tries++;

        sleep(8);

        print "tries: $tries\n" if $DEBUG;        

        if($hid_show =~ m/keyboard/i) {

                $connected = 1;

        } elsif($tries == 5 ){

                if($complete_failure == 0){

                        `hciconfig hci0 reset`;

                        print "We have tried to connect 5 times already....\n";

                        print "You MUST UNPLUG/REPLUG the USB dongle to reset it and";

                        print " we will try again.\n";

                        print "You have 30 SECONDS to disconnect/reconnect the dongle!!!\n";

                        $complete_failure++;

                        $tries = 0;

                        sleep(30);

                } else {

                        print "Tried 5 times and could not connect, EXITING!!!!!\n";

                        sleep(5); 

                        exit(-1);

                }

        }

}

print "Finished setting up connections to keyboard and mouse, ENJOY!!!\n";

```

I just execute this from /etc/conf.d/local

I am having quite a time "waking" bluetooth up when I leave my computer for a bit.   Any suggs ?

scoon

----------

## Meeuw

indeed, it take some seconds, but I've got used to it.

Have you enabled encryption and authentication? (/etc/bluetooth/hcid.conf 'auth enable' / 'encrypt enable')

----------

## scoon

 *Meeuw wrote:*   

> indeed, it take some seconds, but I've got used to it.
> 
> Have you enabled encryption and authentication? (/etc/bluetooth/hcid.conf 'auth enable' / 'encrypt enable')

 

Hey there, 

No I didn't.  But I am not really certain how that will help me.  My problem is that when my bluetooth "sleeps", due an hour or so of inactivity, I need to unplug the hardware and plug it in again.  Next I need to reset the connections by pusing buttons on mouse then bt hub then kb and finally the bt hub again.  But at this point I only have a wireless connection, not bluetooth.  If I rerun that script, then I have everything as bluetooth.  What are your experiences with idle bt connections ?

scoon

----------

## Meeuw

I suppose you can prevent that by starting 'hidd --server', I tought you were complaining about the ~ 5 seconds wakeup time  :Wink: 

----------

## scoon

 *Meeuw wrote:*   

> I suppose you can prevent that by starting 'hidd --server', I tought you were complaining about the ~ 5 seconds wakeup time 

 

Hey there, 

Lemme try that and see what happens.  Thanks again.

scoon

----------

## scoon

 *Meeuw wrote:*   

> I suppose you can prevent that by starting 'hidd --server', I tought you were complaining about the ~ 5 seconds wakeup time 

 

Hey there, 

Thanks a bunch.  It was hidd --server that I was missing.  I mis-read the /etc/init.d/bluetoothh file that gentoo has.

Thanks again. 

scoon

----------

## Neskweek

Hi 

 I've just made an howto on this subject 

https://forums.gentoo.org/viewtopic.php?t=231506&highlight=dinovo

 It works for me 

 and I use the dongle to connect my phone and the Ipaq by Bluetooth

----------

## pro

Meeuw,

your hid2hci script is really good!!!

i used to run hid2hci few times to get the doggle to change to hci mode. But now i just stick in ur init script. THANKS!!

----------

## Neskweek

It didn't work ?

You get stuck during the init ?

----------

