Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
isix
Posts: 6
Joined: 27 Dec 2010, 20:25
Location: Windhoek, Namibia, Africa

[SOLVED] ZTE/Onda MF180 HSDPA with ID 19d2:2003

Post by isix » 28 Dec 2010, 12:22

Hi all,

I have a device named ZTE Corporation HSDPA USB STICK Model: MF180, when I do lsusb after plugging in I get,

Code: Select all

Bus 001 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub                                                                                                                 
Bus 001 Device 002: ID 04f3:0230 Elan Microelectronics Corp.                                                                                                                   
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub                                                                                                                 
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub                                                                                                      
Bus 002 Device 003: ID 03f0:231d Hewlett-Packard                                                                                                                               
Bus 002 Device 004: ID 03f0:251d Hewlett-Packard                                                                                                                               
Bus 002 Device 005: ID 138a:0007 DigitalPersona, Inc                                                                                                                           
Bus 002 Device 006: ID 5986:03b1 Acer, Inc                                                                                                                                     
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub                                                                                                                 
Bus 003 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub                                                                                                      
Bus 003 Device 006: ID 19d2:2003 ONDA Communication S.p.A. 
I am sure its the last one with the ID being 19d2:2003.

I just plugged it out and back in again and got the following extract from /var/log/messages

Code: Select all

Dec 28 12:02:43 fskidd kernel: usb 3-1.2: USB disconnect, address 6                                                                                                            
Dec 28 12:02:43 fskidd kernel: option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1                                                                     
Dec 28 12:02:43 fskidd kernel: option 3-1.2:1.0: device disconnected                                                                                                           
Dec 28 12:02:43 fskidd kernel: option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2                                                                     
Dec 28 12:02:43 fskidd kernel: option 3-1.2:1.1: device disconnected                                                                                                           
Dec 28 12:02:43 fskidd kernel: option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3                                                                     
Dec 28 12:02:43 fskidd kernel: option 3-1.2:1.2: device disconnected                                                                                                           
Dec 28 12:02:43 fskidd kernel: option1 ttyUSB4: GSM modem (1-port) converter now disconnected from ttyUSB4                                                                     
Dec 28 12:02:43 fskidd kernel: option 3-1.2:1.3: device disconnected                                                                                                           
Dec 28 12:02:52 fskidd kernel: usb 3-1.2: new high speed USB device using ehci_hcd and address 7                                                                               
Dec 28 12:02:52 fskidd kernel: scsi8 : usb-storage 3-1.2:1.0                                                                                                                   
Dec 28 12:02:52 fskidd usb_modeswitch: switching 19d2:2000 (ZTE,Incorporated: ZTE WCDMA Technologies MSM)                                                                      
Dec 28 12:02:58 fskidd kernel: usb 3-1.2: USB disconnect, address 7                                                                                                            
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: new high speed USB device using ehci_hcd and address 8                                                                               
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.0: GSM modem (1-port) converter detected                                                                                         
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB1                                                                                 
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.1: GSM modem (1-port) converter detected                                                                                         
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB2                                                                                 
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.2: GSM modem (1-port) converter detected                                                                                         
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB3                                                                                 
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.3: GSM modem (1-port) converter detected                                                                                         
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB4
In the above, I see that usb_modeswitch is linking it to 19d2:2000, while lsusb said it was 19d2:2003. What could be the implication? Is it a unsupported device?

I have the latest usb_modeswitch

Code: Select all

root@fskidd:/home/fskidd> usb_modeswitch --version                                                                                                                             
                                                                                                                                                                               
 * usb_modeswitch: handle USB devices with multiple modes                                                                                                                      
 * Version 1.1.6 (C) Josua Dietze 2010                                                                                                                                         
 * Based on libusb0 (0.1.12 and above)                                                                                                                                         
                                                                                                                                                                               
 ! PLEASE REPORT NEW CONFIGURATIONS !
and the data package as well. The kernel in use is quite young

Code: Select all

root@fskidd:/home/fskidd> uname -r                                                                                                                                             
2.6.35-pf11
I have a multilib set-up such that libusb is in /usr/lib64

Code: Select all

root@fskidd:/home/fskidd> ls /usr/lib64/libusb*                                                                                                                                
/usr/lib64/libusb-0.1.so.4      /usr/lib64/libusb-1.0.la  /usr/lib64/libusb-1.0.so.0      /usr/lib64/libusb.la                                                                 
/usr/lib64/libusb-0.1.so.4.4.4  /usr/lib64/libusb-1.0.so  /usr/lib64/libusb-1.0.so.0.0.0  /usr/lib64/libusb.so
I tried running usb_modeswitch with a few parameters

Code: Select all

root@fskidd:/home/fskidd> usb_modeswitch -W -v 19d2 -p 2003                                                                                                                    
Taking all parameters from the command line                                                                                                                                    
                                                                                                                                                                               
                                                                                                                                                                               
 * usb_modeswitch: handle USB devices with multiple modes                                                                                                                      
 * Version 1.1.6 (C) Josua Dietze 2010                                                                                                                                         
 * Based on libusb0 (0.1.12 and above)                                                                                                                                         
                                                                                                                                                                               
 ! PLEASE REPORT NEW CONFIGURATIONS !                                                                                                                                          
                                                                                                                                                                               
DefaultVendor=  0x19d2                                                                                                                                                         
DefaultProduct= 0x2003                                                                                                                                                         
TargetVendor=   not set                                                                                                                                                        
TargetProduct=  not set                                                                                                                                                        
TargetClass=    not set                                                                                                                                                        
TargetProductList=""                                                                                                                                                           
                                                                                                                                                                               
DetachStorageOnly=0                                                                                                                                                            
HuaweiMode=0                                                                                                                                                                   
SierraMode=0                                                                                                                                                                   
SonyMode=0                                                                                                                                                                     
GCTMode=0                                                                                                                                                                      
KobilMode=0                                                                                                                                                                    
MessageEndpoint=  not set                                                                                                                                                      
MessageContent=""                                                                                                                                                              
NeedResponse=0                                                                                                                                                                 
ResponseEndpoint= not set                                                                                                                                                      
Interface=0x00                                                                                                                                                                 
                                                                                                                                                                               
InquireDevice enabled (default)                                                                                                                                                
Success check disabled                                                                                                                                                         
System integration mode disabled                                                                                                                                               
                                                                                                                                                                               
                                                                                                                                                                               
Looking for default devices ...                                                                                                                                                
  searching devices, found USB ID 1d6b:0003                                                                                                                                    
  searching devices, found USB ID 04f3:0230                                                                                                                                    
  searching devices, found USB ID 1d6b:0002                                                                                                                                    
  searching devices, found USB ID 8087:0020                                                                                                                                    
  searching devices, found USB ID 03f0:231d                                                                                                                                    
  searching devices, found USB ID 03f0:251d                                                                                                                                    
  searching devices, found USB ID 138a:0007                                                                                                                                    
  searching devices, found USB ID 5986:03b1                                                                                                                                    
  searching devices, found USB ID 1d6b:0002                                                                                                                                    
  searching devices, found USB ID 8087:0020                                                                                                                                    
  searching devices, found USB ID 19d2:2003                                                                                                                                    
   found matching vendor ID                                                                                                                                                    
   found matching product ID                                                                                                                                                   
   adding device                                                                                                                                                               
 Found devices in default mode, class or configuration (1)                                                                                                                     
Accessing device 008 on bus 003 ...                                                                                                                                            
Getting the current device configuration ...                                                                                                                                   
 OK, got current device configuration (1)                                                                                                                                      
Using endpoints 0x01 (out) and 0x81 (in)                                                                                                                                       
Using endpoints 0x01 (out) and 0x81 (in)                                                                                                                                       
Not a storage device, skipping SCSI inquiry                                                                                                                                    
                                                                                                                                                                               
USB description data (for identification)                                                                                                                                      
-------------------------                                                                                                                                                      
Manufacturer: ZTE,Incorporated                                                                                                                                                 
     Product: ZTE WCDMA Technologies MSM                                                                                                                                       
  Serial No.: not provided                                                                                                                                                     
-------------------------                                                                                                                                                      
Warning: no switching method given.                                                                                                                                            
-> Run lsusb to note any changes. Bye.
What does "Warning: no switching method given", require from me? Am I too far from success here!
Last edited by isix on 02 Jan 2011, 10:57, edited 1 time in total.

isix
Posts: 6
Joined: 27 Dec 2010, 20:25
Location: Windhoek, Namibia, Africa

Post by isix » 28 Dec 2010, 12:32

--- the relevant extract from the result of the command usb-devices

Code: Select all

T:  Bus=03 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  8 Spd=480 MxCh= 0                                                                                                              
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1                                                                                                                   
P:  Vendor=19d2 ProdID=2003 Rev=00.00                                                                                                                                          
S:  Manufacturer=ZTE,Incorporated                                                                                                                                              
S:  Product=ZTE WCDMA Technologies MSM                                                                                                                                         
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA                                                                                                                                         
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option                                                                                                           
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option                                                                                                           
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option                                                                                                           
I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option  

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

Re: ZTE/Onda MF180 HSDPA with ID 19d2:2003

Post by Josh » 28 Dec 2010, 16:40

Code: Select all

Dec 28 12:02:52 fskidd kernel: usb 3-1.2: new high speed USB device using ehci_hcd and address 7
Dec 28 12:02:52 fskidd kernel: scsi8 : usb-storage 3-1.2:1.0
This is device 19d2:2000. usb_modeswitch sees the device and switches with the configuration file of the same name ("/etc/usb_modeswitch.d/19d2:2000").

Code: Select all

Dec 28 12:02:52 fskidd usb_modeswitch: switching 19d2:2000 (ZTE,Incorporated: ZTE WCDMA Technologies MSM)
Dec 28 12:02:58 fskidd kernel: usb 3-1.2: USB disconnect, address 7
The switching command makes the device disappear for a moment.

Code: Select all

Dec 28 12:03:03 fskidd kernel: usb 3-1.2: new high speed USB device using ehci_hcd and address 8
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.0: GSM modem (1-port) converter detected
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB1
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.1: GSM modem (1-port) converter detected
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB2
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.2: GSM modem (1-port) converter detected
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB3
Dec 28 12:03:03 fskidd kernel: option 3-1.2:1.3: GSM modem (1-port) converter detected
Dec 28 12:03:03 fskidd kernel: usb 3-1.2: GSM modem (1-port) converter now attached to ttyUSB4
The device comes back with ID 19d2:2003 and the "option" driver is bound to it. Now it's ready to use.

Everything worked as it was supposed to ...


isix
Posts: 6
Joined: 27 Dec 2010, 20:25
Location: Windhoek, Namibia, Africa

Post by isix » 28 Dec 2010, 19:06

this is really satisfying information: but now if the device is ready to use, what more should I do apart from plugging in. I have wicd as network manager, on Slackware running KDE desktop?

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

Post by Josh » 28 Dec 2010, 21:15

There is a catch regarding the choice of the right ttyUSB port. If usb_modeswitch worked right, you should have a symbolic link to one of your four ports. If not, you have to test all of them or analyze the output of "lsusb -v -d 19d2:2003" for the interface that has an endpoint with transfer type "Interrupt".

Any connection tool you use should have the option to enter the modem device manually (Gnome's NetworkManager does not). Then you enter "/dev/gsmmodem" (if you have the symlink) or "/dev/ttyUSBx" as the connection device.

Edit: I personally would not trust any "modem autodetection" attempt of said connection tools; they often get it wrong if the right port is not ttyUSB0 ...


isix
Posts: 6
Joined: 27 Dec 2010, 20:25
Location: Windhoek, Namibia, Africa

Post by isix » 30 Dec 2010, 17:12

Please allow me a few moments to demonstrate stupidity:

After a whole lot of trouble connecting to the device's account. I can now get the green light of the USB Modem flickering, and I get from running wvdial the following:

Code: Select all

root@fskidd:/home/fskidd> --> WvDial: Internet dialer version 1.61
--> 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*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 3600000
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Thu Dec 30 16:53:10 2010
--> Pid of pppd: 3650
--> Using interface ppp0
--> pppd: ¦[7f]
--> pppd: ¦[7f]                                                                                                                                                                
--> pppd: ¦[7f]                                                                                                                                                                
--> pppd: ¦[7f]                                                                                                                                                                
--> pppd: ¦[7f]                                                                                                                                                                
--> pppd: ¦[7f]                                                                                                                                                                
--> pppd: ¦[7f]                                                                                                                                                                
--> local  IP address 41.63.xx.yy                                                                                                                                          
--> pppd: ¦[7f]                                                                                                                                                                
--> remote IP address 10.64.xx.yy                                                                                                                                              
--> pppd: ¦[7f]                                                                                                                                                                
--> primary   DNS address 10.40.xx.yy                                                                                                                                         
--> pppd: ¦[7f]                                                                                                                                                                
--> secondary DNS address 10.40.xx.yy                                                                                                                                         
--> pppd: ¦[7f]
In fact the above terminal output stalls at the last line, I have to hit ENTER to get the command prompt back again. But the light is green, but flickering on and off.

Before all this, I should mention that I had to disable the PIN request option of the SIM card under Windows 7. So that I write I the following as /etc/wvdial.conf

Code: Select all

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB3
ISDN = 0
Phone = *99#
Password = mustnotbeblank
Username = mustnotbeblank
Stupid Mode = yes
Now the username and the password are not needed but must not be blank, hence I wrote some characters for those.

With all this good looking stuff, I cannot still get on to the internet --- nothing is connected, command line pinging results in 100% packet loss.

What am I not seeing!

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

Post by Josh » 30 Dec 2010, 17:45

What's lacking is the access point setting. If your provider is - say - MTC, then your access point name is "ppsinternet". If not, google for provider name and "access point".

If I were you I'd scrap the long modem init line (which once was useful for old analogue modems but not anymore) and replace it with the AP setting:

Code: Select all

Init2 = AT+CGDCONT=1,"IP","ppsinternet"
Some recommend to set username and password to "ppsuser" but I doubt it does matter as long as there is anything set at all.

A good reference to the important AT commands is here:
http://www.shapeshifter.se/2008/04/30/l ... -commands/


isix
Posts: 6
Joined: 27 Dec 2010, 20:25
Location: Windhoek, Namibia, Africa

Post by isix » 02 Jan 2011, 10:56

OK, now my Netman device from MTC is up and running in Slackware, the moment I get the following from running the command "wvdial"

Code: Select all

root@fskidd:/home/fskidd> --> WvDial: Internet dialer version 1.61
--> 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*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 3600000
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Thu Dec 30 16:53:10 2010
--> Pid of pppd: 3650
--> Using interface ppp0
--> pppd: ¦[7f]
--> pppd: ¦[7f]                                                                                                                                                               
--> pppd: ¦[7f]                                                                                                                                                               
--> pppd: ¦[7f]                                                                                                                                                               
--> pppd: ¦[7f]                                                                                                                                                               
--> pppd: ¦[7f]                                                                                                                                                               
--> pppd: ¦[7f]                                                                                                                                                               
--> local  IP address 41.63.xx.yy                                                                                                                                         
--> pppd: ¦[7f]                                                                                                                                                               
--> remote IP address 10.64.xx.yy                                                                                                                                             
--> pppd: ¦[7f]                                                                                                                                                               
--> primary   DNS address 10.40.xx.yy                                                                                                                                         
--> pppd: ¦[7f]                                                                                                                                                               
--> secondary DNS address 10.40.xx.yy                                                                                                                                         
--> pppd: ¦[7f] 
then, I must apparently know that wvdial does not export the DNS addresses to other applications on the system. On a Slackware system I had to edit the file /etc/resolve.conf such that it looks like

Code: Select all

# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line
nameserver 10.40.10.xx
nameserver 10.40.10.yy
that is put this DNS address that wvdial picks up after the keyword "nameserver". Thats all in my case, and voila I can surf the net. Ofcourse I do not have all the full functionalities of the device such as sending/receiving SMSes, checking my account status, etc. For these, I have to boot into Windows 7.

Extra Problem: I hope someone can assist with this minor problem. At each boot, it seems Slacky overwrites the file /etc/resolve.conf with the default file, so I safe my resolve.conf as resolve.conf-MTC so that when I need it I quickly do

Code: Select all

cp /etc/resolve.conf-MTC /etc/resolve.conf
I hope these thread will help someone else in the future as well. Josh!, thanks all these is due to your smart software and your cool ideas --- happy new year!

isix
Posts: 6
Joined: 27 Dec 2010, 20:25
Location: Windhoek, Namibia, Africa

Post by isix » 02 Jan 2011, 11:09

Oops I forgot, I disabled the PIN request from Win 7, and now my /etc/wvdial.conf looks like

Code: Select all

[Dialer netman]   
Init1 = ATZ
Init2 = AT+CGDCONT=1, "IP", "ppsinternet", "0.0.0.0"
Stupid Mode = yes
Modem Type = USB Modem
ISDN = 0                  
New PPPD = yes
Phone = *99#  
#Phone = *99***1#
Modem = /dev/ttyUSB4
Username = ppsuser  
Password = ppsuser  
Baud = 9600
where the values for Username and Password are not allowed to be empty. I guess, one could enter the PIN through

Code: Select all

Init1 = AT + CPIN=1234
I am not sure!

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

Post by Josh » 02 Jan 2011, 13:31

The AT+CPIN command should work in theory but reportedly does not do so in some cases. The safest bet is to disable the PIN function alltogether.

Regarding the "resolv.conf" issue:

pppd stores the values received when using "usepeerdns" in a separate file, either (depending on the program version) in "/etc/ppp/resolv.conf" or in "/var/run/ppp/resolv.conf".
You can use this file to do something useful, or you can have a closer look at the "ip-up" script (most likely existing in "/etc/ppp"). pppd will run this upon connection and will set the variables "DNS1" and "DNS2" to the peer-provided values so that you could dynamically change your main "resolv.conf" (like echo "nameserver $DNS1" > /etc/resolv.conf).

This should really be done by the existing script if it's worth its price ... :wink:

I wish you a very good year too - and plenty of rain !!!


Post Reply