Sunday, January 8, 2012

[Linux]Logitech DiNovo Edge

The Logitech DiNovo Edge Bluetooth adapter can be used in two different modes.

Device mode
In this mode the keyboard and its adapter behaves like a USB-keyboard (and mouse). This mode requires no installation and is the preferred mode for non-experts. It is also the default mode of the keyboard on most operating systems.

Raw mode
In this mode the Bluetooth adapter appears as a Bluetooth adapter. This requires installation of the keyboard through Bluetooth pairing by the user. It also enabled the user to connect other devices through the adapters such as phones, headsets etc. As it requires additional configuration to get the keyboard up and running, it is not recommended for non-experienced users.

Linux
On current Linux (3.x), the mode of the Bluetooth adapter is controlled by udev and its rules in rules.d. These rules can be found in the following path /lib/udev/rules.d/ and the the related file including the rule/configuration for Logitech devices can be found in the following file (depending on the Bluetooth driver installed):
Arch Linux (Bluez): yx-bluetooth-hid2hci.rules 
Ubuntu 11.10: yx-bluez-hid2hic.rules (x & y = [0-9])

In the above file there is a couple of lines used to identify a Logitech device upon connected to the system. These lines looks something like this on most systems (Arch Linux showed):

# Logitech devices
KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \
  RUN+="hid2hci --method=logitech-hid --devpath=%p"


This snippet shows that udev is told to register a device matching the product number for Logitech DiNovo (mine is C714) as a raw device(see above for definition) on the system.
If you, as administrator, change the string saying "hidraw" to "hiddev", and save the changes, the device will be registered as a device the next time it is connected (reboot or unplug/plugin).
Note! Since you haven't paired the keyboard and adapter the keyboard will appear as "non-functional", changing to device mode requires some kind of alternative input device (USB-keyboard, on-screen keyboard etc.) until you have  paired the keyboard with the Bluetooth adapter using your Bluetooth manager (gnome, blueman, hcitool etc.).

System upgrade etc.
It has been noted, several times, that a system upgrade some times overwrites your udev rules and restores them to whatever state your system has as default. Hence, the change to the udev rules described above might be necessary to perform more than once during your system's lifetime.

Also, a lot of users are reporting there DiNovo keyboard as non-functional in forum threads all over the Internet. This is however not totally true. What they are experiencing is probably that their adapter has switched mode (from whatever they had before). They could probably fix this by editing their Bluetooth udev rule, as mentioned above, to the inverse of what they currently have.

Related info
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/872940


Update
After an upgrade of my system (Arch Linux) udev does not detect the USB adapter as a Bluetooth adapter even though the rules are set as above. But I found a solution for this:
* Unplug the USB adapter
* Hold the connect button while inserting the USB adapter again and do not release it until, in Gnome, the Bluetooth icon appears in the indicator panel.
If you are not using bluetooth-applet (or equivalent) then tailing the system log (ex. /var/log/messages) could be an alternative way of verifying that the adapter is identified.