3G modem doesn't work when connected to an USB hub

I’m not sure if this is a question as much as a bug report, but I found it fitting for the forum since someone else should investigate further. I have a 3G modem from Vodafone (Huawei K4510) which I use on my PC and laptop when I don’t have cable internet (both running the latest version of openSUSE). In 12.3, the card was detected by the KDE Network Manager when plugging it into an USB port. However, since I upgraded to 13.1, I noticed it no longer works on my PC. I spent last night and this morning investigating the problem and finding a solution. Throughout numerous tests and debug attempts, those are the relevant parts worth mentioning:

lsusb and dmesg always detected the modem, and the led on the device was also flashing accordingly. But neither ifconfig or any network manager saw it. The first thing that worked was manually sending the modeswitch message to the device. For my model of card (located in /usr/share/usb_modeswitch/12d1:14c5) I had to type in the following command as root:

usb_modeswitch -v 0x12d1 -p 0x14c5 -M 55534243123456780000000000000011062000000100000000000000000000

The confusion afterward was why this doesn’t happen automatically when I connect the modem, and I have to manually type that line to fix it. So I went in /etc/usb_modeswitch.conf and set EnableLogging=1, which generated the file /var/log/usb_modeswitch_1-1.4.1. This is what I found there:

USB_ModeSwitch log from Thu Nov 21 15:18:35 EET 2013

Raw args from udev: /1-1.4.1

Using global config file: /etc/usb_modeswitch.conf
Called by new rules file - remember to check class of first interface ...
Using top device dir /sys/bus/usb/devices/1-1.4
   Warning: USB attribute "manufacturer" not found
Check class of first interface ...
 Device is not in install mode. Exiting

A bit later, I decided to plug the modem into my laptop, also running 13.1. To my surprise it worked perfectly there. I kept googling the errors even more curious at this stage, until I came across a page mentioning a problem with USB hubs. So for the first time, I decided to plug the modem into an USB port on the back of my computer rather than my hub. I was again surprised to see that it now worked automatically on my desktop as well. Other devices on my USB hub work fine and I never had problems with it before.

The conclusion is that something in 13.1 (which wasn’t the case in 12.3) related to udev or usb_modeswitch broke, when it comes to connecting 3G modems through an USB hub. Since it only appears to affect hubs it’s not so drastic, but I thought to let people know about the issue and what I found.

The conclusion is that something in 13.1 (which wasn’t the case in 12.3) related to udev or usb_modeswitch broke, when it comes to connecting 3G modems through an USB hub. Since it only appears to affect hubs it’s not so drastic, but I thought to let people know about the issue and what I found.

That’s a good catch MirceaKitsune. I have read of some USB devices behaving strangely, or not being correctly handled when attached to external USB hubs, but often that has been due to power issues. It appears in this as if the cascaded hubs cause confusion to usb_modeswitch with respect to the sysfs path as outlined in this thread

USB_ModeSwitch • View topic - Mode is not switched when modem is connected through hub

I’ll remember this thread for future debugging - essentially try running usb_modeswitch manually and watch the kernel messaging for modem detection.