Automatic Activation, Hotplug and UDEV, Configuration
Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 01 Nov 2010, 09:11

O.K., read your report only after receiving the mail.

The best way to analyze your situation is to switch on logging in /etc/usb_modeswitch.conf. See paragraph "Troubleshooting" on the main doc page.

Don't try to switch manually for now because it can interfere with a working auto-switch process (which may take a while).


lili87
Posts: 21
Joined: 29 Oct 2010, 15:50

Post by lili87 » 01 Nov 2010, 11:34

[
The best way to analyze your situation is to switch on logging in /etc/usb_modeswitch.conf. See paragraph "Troubleshooting" on the main doc page.
Actually the Enablelogging was set to 1 all the time, i was wondering why there are no related log files appeared in /var/log/ or it may hidden somewhere else.

Speak of the troubleshooting,
In case of trouble, look into "unusual_devs.h" in the "drivers/usb/storage" folder of your kernel source. If your default ID (vendor and product ID of the storage part) can be found there and you get errors when running USB_ModeSwitch, try first to blacklist "usb-storage".
If that helps, you should consider rebuilding your kernel with the entry in "unusual_devs.h" deactivated. The only thing that will happen is that usb-storage works in the default way afterwards.
i found the "12d1:1001" in the /home/lee1/project/dist/linux/src/linux/drivers/usb/storage/unusual_dev.h.i have no idea whether it will affect.
/* Reported by fangxiaozhi <huananhu@huawei.com>
* This brings the HUAWEI data card devices into multi-port mode
*/
UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000,
"HUAWEI MOBILE",
"Mass Storage",
US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
0),
Annother way of influencing the kernel behaviour is the parameter "delay_use" of "usb-storage" which sets the time in seconds after plugging when the storage device will actually be used (and probably automounted). The default value is 5; this might affect the switching result under certain conditions.
To change the default add in /etc/modprobe.conf:

options usb-storage delay_use=1 (or 10, or other)
Another problem, there are no modprobe.conf in /etc, Should i create it or it was another name in old kernel like mine ?

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 01 Nov 2010, 13:48

If you don't get any logs at all, check if you have the "tcl" package installed.

The entry in "unusual_devs.h" is harmless because it looks for the Product string "Mass Storage", which a modem never has. So it does not touch your device, because it has 0x1446 in "Mass Storage" mode and 0x1001 in modem mode.

These entries are for very old Huawei models only.

Before you try anything else regarding module parameters etc., let's make sure the usb_modeswitch wrapper is at least starting to run.


lili87
Posts: 21
Joined: 29 Oct 2010, 15:50

Post by lili87 » 01 Nov 2010, 16:47

If you don't get any logs at all, check if you have the "tcl" package installed.
I do got no logs and also i checked with code"tclsh",there is "%"which means that i got "tcl" installed.
Also, I found that there are two in /usr/bin: tcl and tcl8.4, I wonder if they would conflict which may causes that they don’t work well.
Otherwise, maybe the conf file was never used by usb_modeswitch causing no logs generates.

Before you try anything else regarding module parameters etc., let's make sure the usb_modeswitch wrapper is at least starting to run.
Do you mean the parametes usage of usb_modeswitch when switching manually?
At first i use "usb_modeswitch -W", the results turns out that no config file was read. So i try "usb_modeswitch -W -c /etc/usb_modeswitch.setup" and truly configuration was read, but the switching was still no success.

Let me try "usb_modeswitch -v 0x12d1 -p 0x1001 -d" and "usb_modeswitch -v 0x12d1 -p 0x1001 -H" tomorrow to see what will happen.Thanks for your reply.

I am a newbie learning Linux no more than a month and I am quite confused now cause each time when ec 169 plugged in ,the system gives different response.
Sometime no ttyUSB* appears in /dev,sometime ttyUSB0/1/2 just showed up. However each time the address of "lsusb" is "12d1:1001" which means it was indeed switched. May the problem lie in the point that whether my old kernel could recognize the modem with correct port or there is sth else interfereing with the switching of ec169 ?

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 01 Nov 2010, 22:24

Are you running Linux as a virtual system? This may bring in additional sources of trouble regarding USB.

The -d and -H parameter for usb_modeswitch won't help you, believe me.

Again, if you see your device in "1001" mode, it was switched.

And if you see "option" and "GSM modem" in the dmesg output, the driver was loaded.


lili87
Posts: 21
Joined: 29 Oct 2010, 15:50

Post by lili87 » 02 Nov 2010, 03:25

Are you running Linux as a virtual system? This may bring in additional sources of trouble regarding USB.
Yes , my Linux is running as a virtual system. Maybe there is sth to do with it.

Again, if you see your device in "1001" mode, it was switched.

And if you see "option" and "GSM modem" in the dmesg output, the driver was loaded.
I did believe that it has been switched too ,but sometime i just can't find any modems in /dev and even if sometimes ttyUSB0 appears ,i never succeed dialing with it. I suspect the modem is not perfect for using since the ec 169 work well in Windows.I'll try more times to find out why the switching is unstable.Thanks for your eply.

lili87
Posts: 21
Joined: 29 Oct 2010, 15:50

Post by lili87 » 02 Nov 2010, 07:44

Another odd thing is that when i just plug in and wait a while, there is no ttyUSB*, but when i run the code below , ttyUSB0/1/2 showed up although the running results show that it was unsuccessful. I am curious that whether the manual code just spur the appearence of the modem. :?:
root@lee1-desktop:~/deskstop/usb# usb_modeswitch -W -c /etc/usb_modeswitch.setup
Reading config file: /etc/usb_modeswitch.setup
* usb_modeswitch: handle USB devices with multiple modes
* Version 1.1.4 (C) Josua Dietze 2010
* Based on libusb0 (0.1.12 and above)

! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor= 0x12d1
DefaultProduct= 0x1001
TargetVendor= not set
TargetProduct= not set
TargetClass= 0xff
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=1
SierraMode=0
SonyMode=0
GCTMode=0
MessageEndpoint= not set
MessageContent=""
NeedResponse=0
ResponseEndpoint= not set
Interface=0x00

InquireDevice enabled (default)
Success check disabled
System integration mode disabled

usb_set_debug: Setting debugging level to 15 (on)
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 018 on 001
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device

Looking for target devices ...
searching devices, found USB ID 0000:0000
searching devices, found USB ID 12d1:1001
found matching vendor ID
found matching product ID
target class ff not matching
searching devices, found USB ID 0e0f:0002
searching devices, found USB ID 0000:0000
No devices in target mode or class found
Looking for default devices ...
searching devices, found USB ID 0000:0000
searching devices, found USB ID 12d1:1001
found matching vendor ID
found matching product ID
target class ff not matching
adding device as default
searching devices, found USB ID 0e0f:0002
searching devices, found USB ID 0000:0000
Found devices in default mode or class (1)
Accessing device 018 on bus 001 ...
Using endpoints 0x08 (out) and 0x87 (in)
Using endpoints 0x08 (out) and 0x87 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass Storage
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUA�WEI TECHNOLOGIES
Product: HUAWEI Mobile
Serial No.: �������������������
-------------------------
Sending Huawei control message ...
USB error: error sending control message: Invalid or incomplete multibyte or wide character
Error: sending Huawei control message failed (error -84). Aborting.

I wonder also why wvdial can't work smoothly with ttyUSB0 since it was indeed the modem in ec169. I tried many times dialing using the modem but none successed. That does make me doubt of the availablity of the switched modem although it appears there .

Now,it seems that there is problem with wvdial too because each time i dial, it may setup a link "ppp0" (sometime even a "ppp0" can't be setup) ,but just no send or receiving data . It could not be the problem of the card since it can work fine on Windows. Could you check the dialing message for me ? Thanks again.
root@lee1-desktop:~/deskstop/usb# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
^MODE: 8
^RSSILVL:20
^HRSSILVL:40
CONNECT
--> Carrier detected. Waiting for prompt.
^HRSSILVL:40
--> Don't know what to do! Starting pppd and hoping for the best.
--> Starting pppd at Tue Nov 2 15:11:25 2010
--> Pid of pppd: 15211
--> Using interface ppp0
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> local IP address 118.115.177.112
--> pppd: ��[06][08]��[06][08]
--> remote IP address 172.22.212.124
--> pppd: ��[06][08]��[06][08]
--> primary DNS address 61.139.2.69
--> pppd: ��[06][08]��[06][08]
--> secondary DNS address 202.98.96.68
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> Connect time 5.5 minutes.
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> Disconnecting at Tue Nov 2 15:17:01 2010
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
^MODE: 2
^RSSILVL:20
^HRSSILVL:0
CONNECT
--> Carrier detected. Waiting for prompt.
--> Don't know what to do! Starting pppd and hoping for the best.
--> Starting pppd at Tue Nov 2 15:17:49 2010
--> Pid of pppd: 15313
--> Using interface ppp0
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> pppd: ��[06][08]��[06][08]
--> local IP address 118.115.177.112
--> pppd: ��[06][08]��[06][08]
--> remote IP address 172.22.212.124
--> pppd: ��[06][08]��[06][08]
--> primary DNS address 61.139.2.69
--> pppd: ��[06][08]��[06][08]
--> secondary DNS address 202.98.96.68
--> pppd: ��[06][08]��[06][08]
It seems that the connection has been set up but i just can't open any page and the result of running code "ifconfig ppp0 just shows that there are no data streaming.
I believe that it was not the problem of signal cause it connect quite well on Windows. And i googled that it is said it has sth to do with /etc/ppp/options, IS that true?? I remember i dialed successfully before just without regarding that file.
These are also some info in /var/log/messages:
Nov 2 15:11:25 lee1-desktop pppd[15211]: pppd 2.4.4 started by root, uid 0
Nov 2 15:11:25 lee1-desktop pppd[15211]: Using interface ppp0
Nov 2 15:11:25 lee1-desktop pppd[15211]: Connect: ppp0 <--> /dev/ttyUSB0
Nov 2 15:11:25 lee1-desktop pppd[15211]: CHAP authentication succeeded
Nov 2 15:11:25 lee1-desktop pppd[15211]: CHAP authentication succeeded
Nov 2 15:11:25 lee1-desktop pppd[15211]: local IP address 118.115.177.112
Nov 2 15:11:25 lee1-desktop pppd[15211]: remote IP address 172.22.212.124
Nov 2 15:11:25 lee1-desktop pppd[15211]: primary DNS address 61.139.2.69
Nov 2 15:11:25 lee1-desktop pppd[15211]: secondary DNS address 202.98.96.68
Nov 2 15:16:55 lee1-desktop pppd[15211]: No response to 4 echo-requests
Nov 2 15:16:55 lee1-desktop pppd[15211]: Serial link appears to be disconnected.
Nov 2 15:16:55 lee1-desktop pppd[15211]: Connect time 5.5 minutes.
Nov 2 15:16:55 lee1-desktop pppd[15211]: Sent 0 bytes, received 0 bytes.
Nov 2 15:17:01 lee1-desktop pppd[15211]: Connection terminated.
Nov 2 15:17:01 lee1-desktop pppd[15211]: Modem hangup
Nov 2 15:17:01 lee1-desktop pppd[15211]: Exit.
Nov 2 15:17:49 lee1-desktop pppd[15313]: pppd 2.4.4 started by root, uid 0
Nov 2 15:17:49 lee1-desktop pppd[15313]: Using interface ppp0
Nov 2 15:17:49 lee1-desktop pppd[15313]: Connect: ppp0 <--> /dev/ttyUSB0
Nov 2 15:17:50 lee1-desktop pppd[15313]: CHAP authentication succeeded
Nov 2 15:17:50 lee1-desktop pppd[15313]: CHAP authentication succeeded
Nov 2 15:17:50 lee1-desktop pppd[15313]: local IP address 118.115.177.112
Nov 2 15:17:50 lee1-desktop pppd[15313]: remote IP address 172.22.212.124
Nov 2 15:17:50 lee1-desktop pppd[15313]: primary DNS address 61.139.2.69
Nov 2 15:17:50 lee1-desktop pppd[15313]: secondary DNS address 202.98.96.68
Nov 2 15:26:29 lee1-desktop pppd[15313]: Terminating on signal 15
Nov 2 15:26:29 lee1-desktop pppd[15313]: Connect time 8.7 minutes.
Nov 2 15:26:29 lee1-desktop pppd[15313]: Sent 0 bytes, received 0 bytes.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 03 Nov 2010, 14:27

The connection seems to be made, you even get your IP address assigned and the remote DNS addresses are provided. So you are properly logged in.

See if your /etc/ppp/options file contains "defaultroute". And check the output of the "route" command (you may have to be superuser) when ppp0 is present. It should be the standard gateway.

I suspect that there is a problem with running virtual. Hardware virtualization is the trickiest part and may have issues. Perhaps you can use a more recent Ubuntu.

My best suggestion would be to use a native Linux system.


lili87
Posts: 21
Joined: 29 Oct 2010, 15:50

Post by lili87 » 04 Nov 2010, 05:36

See if your /etc/ppp/options file contains "defaultroute". And check the output of the "route" command (you may have to be superuser) when ppp0 is present. It should be the standard gateway.
I found no "defaultroute" in /etc/ppp/options. When i add "defaultroute" there and try "wvdial" again ,nothing changed.
Then i use the code bellow to find what's active in that file. Do they have anything to do with the ppp dialing?
root@lee1-desktop:~# egrep -v '#|^ *$' /etc/ppp/options
asyncmap 0
noauth
crtscts
lock
hide-password
modem
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
noipx
I check the output of "route" that when ppp0 is setup. Here it is.It seems it was the default .
root@lee1-desktop:~# route
内核 IP 路由表
目标(destination) 网关(gateway) 子网掩码(genmask) 标志 跃点 引用 使用 接口
172.22.212.123 * 255.255.255. UH 0 0 0 ppp0
192.168.17.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0
default 192.168.17.2 0.0.0.0 UG 0 0 0 eth0
I suspect that there is a problem with running virtual. Hardware virtualization is the trickiest part and may have issues. Perhaps you can use a more recent Ubuntu.
I also believe it now cause i found out that the instability of switching is mostly due to the device connection on VMware. Could it be the reason that ppp0 can be setup but just can't connect to the net? But the info from google says people could use 3G cards in linux easily under WMware .

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 04 Nov 2010, 13:37

Code: Select all

172.22.212.123 *            255.255.255.     UH 0 0 0 ppp0
192.168.17.0   *            255.255.255.0     U 0 0 0 eth0
link-local     *            255.255.0.0       U 1000 0 0 eth0
default        192.168.17.2 0.0.0.0           UG 0 0 0 eth0
This is not good, the "default" line should have "ppp0" at the end.
The default route is the one that is used for Internet access, and your route points to your LAN interface.
This is what the "defaultroute" entry is for; it should replace the old default against the ppp0 interface.

Try adding it again to the "options" file and see if the "route" output is different.

Also, check if you have sufficient permissions if you are running "wvdial". If you are not sure, use it with "sudo".


lili87
Posts: 21
Joined: 29 Oct 2010, 15:50

Post by lili87 » 05 Nov 2010, 05:49

This is what the "defaultroute" entry is for; it should replace the old default against the ppp0 interface.

Try adding it again to the "options" file and see if the "route" output is different.
Problems solved. You are right! This time i add it to the options and when ppp0 is setup,i run "route add default ppp0" to check whether it is added. ( if it is added, then the words " File already exists") And i dialed successfully. It's true when i run "route" the result is following:
172.22.212.124 * 255.255.255.255 UH 0 0 0 ppp0
link-local * 255.255.0.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
Many,many thanks again!!!

Post Reply