Author Message

<  Everything Coding  ~  No /dev/gsmmodem with new laptop

PostPosted: Wed Sep 07, 2011 12:50 pm
Posts: 11Location: AustraliaJoined: Tue Dec 07, 2010 2:52 pm
I recently purchased a laptop, Acer Aspire 5742G, and /dev/gsmmodem no longer gets created.

I have tested with usb-modeswitch 1.1.7 and 1.1.9, 2.6.32.x and 2.6.39.x kernels, and three different USB modems. On any of my other computers, /dev/gsmmodem gets created for all three modems.

On this laptop, modem switching occurs ok, and I get /dev/ttyUSB*, and get the "switch success" message in the log. But, no /dev/gsmmodem.

Note, I also tested with both the old libusb0 and libusb0-compat libraries.

Josh, could you advise me how I could manually test this? I have just now plugged in my Vodafone modem, which uses 'option' driver, and the log creates these files:

usb_modeswitch_2-1.3:1.0
usb_modeswitch_ttyUSB0
usb_modeswitch_ttyUSB1
usb_modeswitch_ttyUSB2
usb_modeswitch_ttyUSB3
usb_modeswitch_ttyUSB4

However, all of the *ttyUSB* files have the same thing in them, for example, file usb_modeswitch_ttyUSB4:

---------------------------------
Code:
USB_ModeSwitch log from Wed Sep  07 18:39:34 GMT-8 2011

* called with --symlink-name: params /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.4/ttyUSB4/tty/ttyUSB4 *

My name is ttyUSB4
Could not find interface number in path
 /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.4/ttyUSB4/tty/ttyUSB4. Aborting

---------------------------------

Does this information help?:

---------------------------------------
Code:
# cd /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.4/ttyUSB4/tty/ttyUSB4
# ls
dev  device  power  subsystem  uevent
# cat /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.4/ttyUSB4/tty/ttyUSB4/uevent
MAJOR=188
MINOR=4
DEVNAME=ttyUSB4
# cat /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.4/ttyUSB4/tty/ttyUSB4/dev   
188:4

---------------------------------------

Regards,
Barry Kauler


Offline Profile WWW
PostPosted: Wed Sep 07, 2011 1:49 pm
Site AdminPosts: 4699Joined: Sat Nov 03, 2007 12:30 am
The check for interrupt interfaces is quite un-sophisticated. I guess the laptop is using a hub internally which doesn't agree with usb_modeswitch's expectation of the attribute tree path. It might be a simple issue with extracting information from the pathnames in the Tcl script.

Will have a look when back from work.


Offline Profile
PostPosted: Wed Sep 07, 2011 7:51 pm
Site AdminPosts: 4699Joined: Sat Nov 03, 2007 12:30 am
I think I found the culprit. This regular expression (line 704 in the Tcl script) did not take hubs into account:
Code:
if {![regexp "$dev_top:\[0-9\]" /sys$path ifRoot]} {
    Log "Could not find interface number in path\n $path. Aborting"
    return ""
}
Besides, the log message was copied and pasted from annother line and thus pretty useless.
This should be correct:
Code:
if {![regexp "$dev_top\[\\.0-9+\]*:\[0-9\]" $path ifRoot]} {
    Log "Could not find device chain in path\n $path. Aborting"
    return ""
}
Thanks for reporting this bug!



Offline Profile
PostPosted: Wed Sep 14, 2011 11:12 am
Posts: 11Location: AustraliaJoined: Tue Dec 07, 2010 2:52 pm
Josh,
Thanks for your feedback. No, that doesn't fix it. When I applied your patch, I still didn't get gsmmodem, also there were no usb_modeswitch_ttyUSB* files logged.

I have done some more investigation, and it seems that your code is not looking in the right place.

For my Vodafone modem, I get /var/log/usb_modeswitch_ttyUSB3:

Code:
USB_ModeSwitch log from Wed Sep  14 16:51:10 GMT-8 2011

* called with --symlink-name: params /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.3/ttyUSB3/tty/ttyUSB3 *

My name is ttyUSB3
Could not find interface number in path
 /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.3/ttyUSB3/tty/ttyUSB3. Aborting


However, the interface number "03" is in this file:
Code:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.3/bInterfaceNumber


The interface type, file 'type' with content "Interrupt" is here:

Code:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.3/ep_84/type


Hope that helps.

Regards,
Barry Kauler


Offline Profile WWW
PostPosted: Wed Sep 14, 2011 1:56 pm
Posts: 11Location: AustraliaJoined: Tue Dec 07, 2010 2:52 pm
Ha ha, I have been amusing myself, tried to see what I could do with Linux utilities and a long pipe:

Code:
find /sys/devices -regex '/sys/devices/.*/ep_[8][0-9]/type' | grep '/usb[0-9]' | xargs grep 'Interrupt' | sed -e 's%/ep_[8].*%%' | xargs -I ABCDEF find ABCDEF -name 'ttyUSB*' | rev | cut -f 1 -d '/' | rev | sort -u | head -n 1


...on my laptop, "ttyUSB3" pops out the end of this!


Offline Profile WWW
PostPosted: Thu Sep 15, 2011 9:24 am
Site AdminPosts: 4699Joined: Sat Nov 03, 2007 12:30 am
Hmm, the regular expression I posted as a fix has worked with your path when testing. Strange.

Note that it does not need the attribute itself, the interface number is taken from the device path, in your case "2-1.3:1.3" with the last ".3" denoting the interface.


Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 1
6 posts
Users browsing this forum: No registered users and 0 guests
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum