How to make Logitech Anywhere MX work in Ubuntu 12.X?
I enhanced the script up top and then also added a udev rule to fire whenever the mouse was plugged in. I am using a Logitech Performance MX but the rule should be similar.
#!/bin/bash
# loop up to 10 times trying to fix the mouse insertion
for i in {1..10}
do
# exit the script if there was no mouse error
if [ `dmesg | grep "logitech-djreceiver" | tail -1 | grep -c "failed with error -32"` -eq 0 ]; then
echo "No logitech receiver error...exiting" ;
exit 0 ;
else
# try to reload the mouse driver
echo `date`" Error detected, trying reload of logitech hid driver" ;
rmmod hid_logitech_dj ;
modprobe hid_logitech_dj ;
sleep 1 ;
fi
done
This tries up to 10 times to reload the driver before exiting.
I named the script /usr/bin/mousefix
and did a chmod +x
.
Here is the udev rule, a line that can be added to /etc/udev/rules.d/10-local.rules
SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB Receiver", ACTION=="add", RUN+="/usr/bin/mousefix"
Hope this helps somebody else. It seemed like an easier thing to do to have the script run whenever the usb connected.
You only need to update the system if you are using 12.04 or 12.10.
I have had several questions related to the Anywhere Mouse and the Touch Mouse M600
Is Logitech's Unifying receiver supported?
Can I use the Logitech Touch Mouse M600?
I even participated in this launchpad bug: https://bugs.launchpad.net/linux/+bug/958174 where several solutions like:
sudo modprobe -r hid_logitech_dj
sudo modprobe hid_logitech_dj
were mentioned but at the end, updating the system fixed all issues with both mouses.
There is even a askubuntu answer about it here: Logitech M515 does not work after upgrade to 12.04
But for all 4 computers I tested this, the solution was to activate all repositories by default not activated (universe, multiverse, proposed, backport), do an update and upgrade. Reboot and the mouse should work out of the box perfectly.
If by chance doing this does not fix the problem, then doing a diagnostic to it will help, for example:
After rebooting disconnect/connect the Logitech Receiver. Open a terminal and type
dmesg
to see the last lines that will mention the receiver. See if an error appeared.Type
lsusb
. You should see a line similar to the one below if everything was detected correctly:Bus 002 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Turn on/off the mouse (The on/off switch in the mouse is below) and test.
This has been tested in USB 2.0 and 3.0 ports. To make sure (at least for most users) that this work, ALL repositories have to be activated. Like the following 3 images:
Here we see main, universe, restricted and multiverse activated. I also changed the server from my country to MAIN
Here I activated since they were off, the Canonical and 3rd party repositories.
Here wee see proposed and backports activated (Beside security and updates).
After all that I did a sudo apt-get update && sudo apt-get upgrade
. Rebooted the PC and done.
The mouse should work every time while turned on, but if this fails, I see a couple or reasons why:
The Anywhere MX mouse actually drains the batteries faster than other mice I have tested. In my tests, Anywhere MX uses 2x more battery than the Touch Mouse M600 and at least 20x more than the Logitech V450. For example, using it everyday, can use the Anywhere MX for 1.5 months to 2 months. The Touch Mouse lasts around 4 to 5 months. The V450 lasts clearly a full year up to 16 months. So check the batteries. I suspect this is due to the Darkfield Technology.
The Anywhere MX mouse when turned on a green light will flash for about 3 seconds then turn off. This does not mean the mouse if off, it just means that the mouse batteries are good. If the lights were red then you need to change them. In either case, the light will turn on with green or red then turn off to preserve the batteries.
The switch to turn on/off the mouse below can be switch any amount of times when using Ubuntu, but it is better to turn the mouse off when not using it. This way it will last longer. For example when sleeping, going to work, etc..
Certain BIOS options might have an impact on the mouse. Check your motherboard's BIOS for USB options. Play with them just in case the mouse does not work.
Change the USB port where the receiver is connected. Some ports (Like the front ports) are known to really suck at having high power devices on them.
Solaar worked for me in 12.04. In terminal type:
sudo add-apt-repository ppa:daniel.pavel/solaar
sudo apt-get update
sudo apt-get install solaar
Once installed, open Solaar from the Dash menu and click on in the upper left corner. The click on in the lower right corner and follow the directions.
If you had the logitech devices paired to another computer before, you may first need to unpair the logitech devices from the other computer(s). After that reboot Ubuntu without logitech receiver in USB, start Solaar from Dash / menu, plug in logitech receiver, click 'add new devices' and switch new device on/off to be recognized. Repeat for each device.
Once paired the devices are recognized every time you start ubuntu (Solaar is automatically installed in 'startup applications').
Also check this link as source http://www.webupd8.org/2013/07/pair-unpair-logitech-unifying-devices.html or for more trouble shooting