Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 12:53

Hello Forum,

The ZTE MF60 uses VID 19d2 PID 2000 in CDROM mode.
I can eject it manually and get the two serial ports, the MMC, CDROM and WWAN ports, but the WWAN port doesn't give me an IP address.
I'm running raspbian Wheezy with kernel 3.12.35 on my Raspberry.
I installed the modeswitch utility version 2.2.1 from January 14th 2015.
Initially the usb_modeswitch rule didn't trigger at all.

Code: Select all

udevadm info -a -p $(udevadm info -q path -n /dev/sr0)
gives me this:

Code: Select all

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15/target15:0:0/15:0:0:0/block/sr0':
    KERNEL=="sr0"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{ro}=="0"
    ATTR{size}=="13452"
    ATTR{stat}=="      24       24      192      180        0        0        0        0        0      180      180"
    ATTR{range}=="1"
    ATTR{discard_alignment}=="0"
    ATTR{events}=="media_change eject_request"
    ATTR{ext_range}=="1"
    ATTR{events_poll_msecs}=="-1"
    ATTR{alignment_offset}=="0"
    ATTR{inflight}=="       0        0"
    ATTR{removable}=="1"
    ATTR{capability}=="119"
    ATTR{events_async}==""

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15/target15:0:0/15:0:0:0':
    KERNELS=="15:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sr"
    ATTRS{rev}=="2.31"
    ATTRS{type}=="5"
    ATTRS{scsi_level}=="3"
    ATTRS{model}=="USB SCSI CD-ROM "
    ATTRS{state}=="running"
    ATTRS{queue_type}=="none"
    ATTRS{iodone_cnt}=="0x6d"
    ATTRS{iorequest_cnt}=="0x6d"
    ATTRS{evt_capacity_change_reported}=="0"
    ATTRS{timeout}=="30"
    ATTRS{evt_media_change}=="0"
    ATTRS{max_sectors}=="240"
    ATTRS{ioerr_cnt}=="0x1b"
    ATTRS{queue_depth}=="1"
    ATTRS{vendor}=="ZTE     "
    ATTRS{evt_soft_threshold_reached}=="0"
    ATTRS{device_blocked}=="0"
    ATTRS{evt_mode_parameter_change_reported}=="0"
    ATTRS{evt_lun_change_reported}=="0"
    ATTRS{evt_inquiry_change_reported}=="0"
    ATTRS{iocounterbits}=="32"
    ATTRS{eh_timeout}=="10"

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15/target15:0:0':
    KERNELS=="target15:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3/host15':
    KERNELS=="host15"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.3':
    KERNELS=="1-1.3.4:1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb-storage"
    ATTRS{bInterfaceClass}=="08"
    ATTRS{bInterfaceSubClass}=="06"
    ATTRS{bInterfaceProtocol}=="50"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceNumber}=="03"

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4':
    KERNELS=="1-1.3.4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="1.3.4"
    ATTRS{idVendor}=="19d2"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="21"
    ATTRS{configuration}=="ZTE Configuration"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0000"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="MF60__ZTED010000"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="399"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="ZTE,Incorporated"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="2000"
    ATTRS{bDeviceClass}=="00"
    ATTRS{product}=="ZTE WCDMA Technologies MSM"

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3':
    KERNELS=="1-1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{devpath}=="1.3"
    ATTRS{idVendor}=="1a40"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="5"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="100mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="4"
    ATTRS{bcdDevice}=="0111"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="396"
    ATTRS{ltm_capable}=="no"
    ATTRS{removable}=="removable"
    ATTRS{idProduct}=="0101"
    ATTRS{bDeviceClass}=="09"
    ATTRS{product}=="USB 2.0 Hub"

  looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="02"
    ATTRS{devpath}=="1"
    ATTRS{idVendor}=="0424"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="2"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="2mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="5"
    ATTRS{bcdDevice}=="0200"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="57"
    ATTRS{ltm_capable}=="no"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="9514"
    ATTRS{bDeviceClass}=="09"

  looking at parent device '/devices/platform/bcm2708_usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{devpath}=="0"
    ATTRS{idVendor}=="1d6b"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{authorized_default}=="1"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="1"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="0mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="1"
    ATTRS{bcdDevice}=="0312"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="bcm2708_usb"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="26"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 3.12.35+ dwc_otg_hcd"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0002"
    ATTRS{bDeviceClass}=="09"
    ATTRS{product}=="DWC OTG Controller"

  looking at parent device '/devices/platform/bcm2708_usb':
    KERNELS=="bcm2708_usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc_otg"
    ATTRS{hnp}=="HstNegScs = 0x0"
    ATTRS{srp}=="SesReqScs = 0x1"
    ATTRS{regvalue}=="invalid offset"
    ATTRS{hsic_connect}=="HSIC Connect = 0x1"
    ATTRS{guid}=="GUID = 0x2708a000"
    ATTRS{mode}=="Mode = 0x1"
    ATTRS{srpcapable}=="SRPCapable = 0x1"
    ATTRS{regdump}=="Register Dump"
    ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
    ATTRS{ggpio}=="GGPIO = 0x00000000"
    ATTRS{hprt0}=="HPRT0 = 0x00001005"
    ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 370 msecs (37 jiffies)"
    ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
    ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
    ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
    ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
    ATTRS{busconnected}=="Bus Connected = 0x1"
    ATTRS{hcddump}=="HCD Dump"
    ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
    ATTRS{spramdump}=="SPRAM Dump"
    ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
    ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
    ATTRS{gusbcfg}=="GUSBCFG = 0x00001700"
    ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
    ATTRS{devspeed}=="Device Speed = 0x0"
    ATTRS{fr_interval}=="Frame Interval = 0x1d4c"
    ATTRS{rem_wakeup_pwrdn}==""
    ATTRS{bussuspend}=="Bus Suspend = 0x0"
    ATTRS{buspower}=="Bus Power = 0x1"
    ATTRS{hnpcapable}=="HNPCapable = 0x1"
    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1150 msecs (115 jiffies)"
    ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
    ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
    ATTRS{regoffset}=="0xffffffff"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
There's no ATTR{idProduct}=="2000" so I changed the rule to ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000".
Now the rule fires bit it didn't call the script in /lib/udev.
I checked this by adding an debug line into the script.
When udev calls a script PWD is / and PATH is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

so I forced execution of /lib/udev/usb_modeswitch in the rule.
now '%b/%k gives me 1-1.3.4/1-1.3.4:1.3
looking into /lib/udev/usb_modeswitch it seems it expects something entirely different.

Can somebody tell me how to solve this problem?

Regards
Aydan

PS: some more device info:
before eject

Code: Select all

T:  Bus=01 Lev=03 Prnt=05 Port=03 Cnt=01 Dev#= 21 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=2000 Rev=00.00
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE WCDMA Technologies MSM
S:  SerialNumber=MF60__ZTED010000
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:  If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
after eject
usb-devices

Code: Select all

T:  Bus=01 Lev=03 Prnt=05 Port=03 Cnt=01 Dev#= 22 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=1402 Rev=00.00
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE WCDMA Technologies MSM
S:  SerialNumber=MF60__ZTED010000
C:  #Ifs= 4 Cfg#= 1 Atr=c0 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= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
I:  If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
lsusb -t

Code: Select all

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=vend., Driver=rt2800usb, 480M
        |__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 22, If 0, Class=vend., Driver=option, 480M
            |__ Port 4: Dev 22, If 1, Class=vend., Driver=option, 480M
            |__ Port 4: Dev 22, If 2, Class=vend., Driver=qmi_wwan, 480M
            |__ Port 4: Dev 22, If 3, Class=stor., Driver=usb-storage, 480M
dmesg

Code: Select all

[ 4077.639193] usb 1-1.3.4: new high-speed USB device number 22 using dwc_otg
[ 4077.742235] usb 1-1.3.4: New USB device found, idVendor=19d2, idProduct=1402
[ 4077.742270] usb 1-1.3.4: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[ 4077.742286] usb 1-1.3.4: Product: ZTE WCDMA Technologies MSM
[ 4077.742303] usb 1-1.3.4: Manufacturer: ZTE,Incorporated
[ 4077.742316] usb 1-1.3.4: SerialNumber: MF60__ZTED010000
[ 4077.754116] usb-storage 1-1.3.4:1.3: USB Mass Storage device detected
[ 4077.760186] scsi16 : usb-storage 1-1.3.4:1.3
[ 4077.858823] usbcore: registered new interface driver usbserial
[ 4077.858949] usbcore: registered new interface driver usbserial_generic
[ 4077.861130] usbserial: USB Serial support registered for generic
[ 4077.866199] usbcore: registered new interface driver cdc_wdm
[ 4077.908116] usbcore: registered new interface driver option
[ 4077.908252] usbserial: USB Serial support registered for GSM modem (1-port)
[ 4077.910529] qmi_wwan 1-1.3.4:1.2: cdc-wdm0: USB WDM device
[ 4077.920244] qmi_wwan 1-1.3.4:1.2 wwan0: register 'qmi_wwan' at usb-bcm2708_usb-1.3.4, WWAN/QMI device, 22:51:4d:e6:56:78
[ 4077.920537] usbcore: registered new interface driver qmi_wwan
[ 4077.933107] option 1-1.3.4:1.0: GSM modem (1-port) converter detected
[ 4077.936872] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB0
[ 4077.937449] option 1-1.3.4:1.1: GSM modem (1-port) converter detected
[ 4077.938638] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 4078.760875] scsi 16:0:0:0: CD-ROM            ZTE      USB SCSI CD-ROM  2.31 PQ: 0 ANSI: 2
[ 4078.763380] sr0: scsi-1 drive
[ 4078.764195] sr 16:0:0:0: Attached scsi CD-ROM sr0
[ 4078.765331] sr 16:0:0:0: Attached scsi generic sg0 type 5
[ 4078.767329] scsi 16:0:0:1: Direct-Access     ZTE      MMC Storage      2.31 PQ: 0 ANSI: 2
[ 4078.772280] sd 16:0:0:1: [sda] Attached SCSI removable disk
[ 4078.772414] sd 16:0:0:1: Attached scsi generic sg1 type 0
[ 4079.160352] sr 16:0:0:0: ioctl_internal_command return code = 8070000
[ 4079.160387]    : Sense Key : 0x4 [current]
[ 4079.160406]    : ASC=0x0 ASCQ=0x0
[ 4079.904491] sr 16:0:0:0: ioctl_internal_command return code = 8070000
[ 4079.904522]    : Sense Key : 0x4 [current]
[ 4079.904541]    : ASC=0x0 ASCQ=0x0

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 12:57

Also calling usb_modeswitch directly like this:

Code: Select all

 usb_modeswitch -W -I -c /usr/share/usb_modeswitch/19d2\:2000 -v 19d2 -p 2000
gives me this:

Code: Select all

Read config file: /usr/share/usb_modeswitch/19d2:2000

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.2.0 (C) Josua Dietze 2014
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x19d2
DefaultProduct= 0x2000
TargetVendor=   0x19d2
TargetProductList="0001,0002,0015,0016,0017,0019,0031,0033,0037,0042,0052,0055,0061,0063,0064,0066,0091,0108,0117,0128,0151,0157,0177,1402,2002,2003"

StandardEject=1
MessageContent="55534243123456702000000080000c85010101180101010101000000000000"
NeedResponse=0

InquireDevice=1

Look for target devices ...
  found USB ID 0424:9514
  found USB ID 1d6b:0002
  found USB ID 0424:ec00
  found USB ID 7392:7711
  found USB ID 1a40:0101
  found USB ID 19d2:2000
   vendor ID matched
 No devices in target mode or class found
Look for default devices ...
  found USB ID 0424:9514
  found USB ID 1d6b:0002
  found USB ID 0424:ec00
  found USB ID 7392:7711
  found USB ID 1a40:0101
  found USB ID 19d2:2000
   vendor ID matched
   product ID matched
 Found devices in default mode (1)
Access device 023 on bus 001
Current configuration number is 1
Use interface number 3
Use endpoints 0x04 (out) and 0x85 (in)
Inquire device details; driver will be detached ...
Looking for active driver ...
 No active driver found. Detached before or never attached
 Could not claim interface (error -6). Skip device inquiry

USB description data (for identification)
-------------------------
Manufacturer: ZTE,Incorporated
     Product: ZTE WCDMA Technologies MSM
  Serial No.: MF60__ZTED010000
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
 No active driver found. Detached before or never attached
Set up interface 3
 Could not claim interface (error -6). Skip message sending
-> Run lsusb to note any changes. Bye!

and the device dos not switch modes

Regards
Aydan

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by LOM » 01 Feb 2015, 16:18

I am not surprised, this forum has many threads about Raspberry Pi problems and the culprit is always the dwc_otg hub driver which among other bugs doesn't properly detect a device change on the usb bus, some old information is hanging on.

19d2:2000 has only one interface and it is therefore number 0, the interface has 2 endpoints and they are 0x01 and 0x81 for communication to and from the virtual cd-rom that resides under interface #0.

Look at your usb_modeswitch log, usb_modeswitch queries the usb subsystem and is being told that 19d2:2000 is present and that the interface number for the storage interface is #3 with endpoints 0x04 and 0x85.

Interface #3 with those endpoints matches exactly the interface layout of 19d2:1402, dwc_otg did only update the usb id to 19d2:2000 when it detected that you replugged the dongle but dwc_otg kept the interface layout from the previous device ie 19d2:1402.

This is a problem that has lasted for years with dwc_otg and it shows up immediately when a composite device is connected, devices with a single interface and with few endpoints are not affected.

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 16:24

OK, so it should work at first plug?
I'll see what interface is reported on first plug and what happens when I run modeswitch then.

Regards
Aydan

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 16:31

First plug shows the same as before:

Code: Select all

T:  Bus=01 Lev=03 Prnt=05 Port=03 Cnt=01 Dev#=  6 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=2000 Rev=00.00
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE WCDMA Technologies MSM
S:  SerialNumber=MF60__ZTED010000
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=500mA
I:  If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=vend., Driver=rt2800usb, 480M
        |__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 6, If 3, Class=stor., Driver=usb-storage, 480M
and I can mount/access the cd image so for me it looks like the endpoint used is correct.

Regards
Aydan

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by LOM » 01 Feb 2015, 17:06

Does it make any difference if you add Interface=3 to the 19d2:2000 config file?

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 17:12

I added Inteface=3 to the file
it now looks like this:

Code: Select all

# ZTE devices
TargetVendor= 0x19d2
TargetProductList="0001,0002,0015,0016,0017,0019,0031,0033,0037,0042,0052,0055,0061,0063,0064,0066,0091,0108,0117,0128,0151,0157,0177,1402,2002,2003"
Interface=3
StandardEject=1
MessageContent="55534243123456702000000080000c85010101180101010101000000000000"
and

Code: Select all

usb_modeswitch -W -I -c /usr/share/usb_modeswitch/19d2\:2000 -v 19d2 -p 2000
results in this:

Code: Select all

Read config file: /usr/share/usb_modeswitch/19d2:2000

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.2.0 (C) Josua Dietze 2014
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x19d2
DefaultProduct= 0x2000
TargetVendor=   0x19d2
TargetProductList="0001,0002,0015,0016,0017,0019,0031,0033,0037,0042,0052,0055,0061,0063,0064,0066,0091,0108,0117,0128,0151,0157,0177,1402,2002,2003"

StandardEject=1
MessageContent="55534243123456702000000080000c85010101180101010101000000000000"
NeedResponse=0
Interface=0x03

InquireDevice=1

Look for target devices ...
  found USB ID 0424:9514
  found USB ID 1d6b:0002
  found USB ID 0424:ec00
  found USB ID 7392:7711
  found USB ID 1a40:0101
  found USB ID 19d2:2000
   vendor ID matched
 No devices in target mode or class found
Look for default devices ...
  found USB ID 0424:9514
  found USB ID 1d6b:0002
  found USB ID 0424:ec00
  found USB ID 7392:7711
  found USB ID 1a40:0101
  found USB ID 19d2:2000
   vendor ID matched
   product ID matched
 Found devices in default mode (1)
Access device 006 on bus 001
Current configuration number is 1
Use interface number 3
Use endpoints 0x04 (out) and 0x85 (in)
Inquire device details; driver will be detached ...
Looking for active driver ...
 No active driver found. Detached before or never attached
 Could not claim interface (error -6). Skip device inquiry

USB description data (for identification)
-------------------------
Manufacturer: ZTE,Incorporated
     Product: ZTE WCDMA Technologies MSM
  Serial No.: MF60__ZTED010000
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
 No active driver found. Detached before or never attached
Set up interface 3
 Could not claim interface (error -6). Skip message sending
-> Run lsusb to note any changes. Bye!
So it's using Interface 3 but nothing happens.
It is still attached with PID 2000.

Regards
Aydan

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by LOM » 01 Feb 2015, 17:46

Remove the -I switch from the cmd line and try again

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 17:51

Still no change:

Code: Select all

Read config file: /usr/share/usb_modeswitch/19d2:2000

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.2.0 (C) Josua Dietze 2014
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x19d2
DefaultProduct= 0x2000
TargetVendor=   0x19d2
TargetProductList="0001,0002,0015,0016,0017,0019,0031,0033,0037,0042,0052,0055,0061,0063,0064,0066,0091,0108,0117,0128,0151,0157,0177,1402,2002,2003"

StandardEject=1
MessageContent="55534243123456702000000080000c85010101180101010101000000000000"
NeedResponse=0
Interface=0x03

Look for target devices ...
  found USB ID 0424:9514
  found USB ID 1d6b:0002
  found USB ID 0424:ec00
  found USB ID 7392:7711
  found USB ID 1a40:0101
  found USB ID 19d2:2000
   vendor ID matched
 No devices in target mode or class found
Look for default devices ...
  found USB ID 0424:9514
  found USB ID 1d6b:0002
  found USB ID 0424:ec00
  found USB ID 7392:7711
  found USB ID 1a40:0101
  found USB ID 19d2:2000
   vendor ID matched
   product ID matched
 Found devices in default mode (1)
Access device 008 on bus 001
Current configuration number is 1
Use interface number 3
Use endpoints 0x04 (out) and 0x85 (in)

USB description data (for identification)
-------------------------
Manufacturer: ZTE,Incorporated
     Product: ZTE WCDMA Technologies MSM
  Serial No.: MF60__ZTED010000
-------------------------
Sending standard EJECT sequence
Looking for active driver ...
 No active driver found. Detached before or never attached
Set up interface 3
 Could not claim interface (error -6). Skip message sending
-> Run lsusb to note any changes. Bye!

Code: Select all

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=vend., Driver=rt2800usb, 480M
        |__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 8, If 3, Class=stor., Driver=usb-storage, 480M
Regards
Aydan

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 01 Feb 2015, 21:13

If you're interested I can provide a USB Logger Trace from my windows machine.

Regards
Aydan

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by LOM » 02 Feb 2015, 10:05

Aydan wrote:If you're interested I can provide a USB Logger Trace from my windows machine.

Regards
Aydan
Thanks but the switch message is not the problem, all other 19d2:2000 devices do switch with the msg usb_modeswitch is using and your MF60 would likely do that as well if we could send the msgs to it.

A previous post about the device:
http://www.draisberghof.de/usb_modeswit ... .php?t=945

disregard the request for udev change, it will not solve your problem about libusb not being able to claim the interface instead throwing error -6 which is "Resource busy".

Use manual eject for now and refer to the previous post for your qmi problem.

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

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Josh » 02 Feb 2015, 20:44

Aydan wrote:Still no change:

Code: Select all

...
Looking for active driver ...
 No active driver found. Detached before or never attached
When trying various configurations via commandline, I strongly recommend to re-plug the USB device before each new attempt.
It may be in an undefined state from previous experiments.

You should always see that the driver was detached by usb_modeswitch.

Aydan
Posts: 8
Joined: 01 Feb 2015, 12:26

Re: Setup problems with ZTE MF60 on Raspberry pi

Post by Aydan » 02 Feb 2015, 20:53

Thankyou verymuch for the support,
I got it to work with those udev rules:

Code: Select all

ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", SUBSYSTEM=="block", ACTION=="add", NAME="ZTE_MF60_VCD", RUN+="/etc/udev/ZTE-MF60.sh"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1402", SUBSYSTEM=="net", ACTION=="add", NAME="wwan_ztemf60"
ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1402", ENV{ID_VENDOR_ID}="$attr{idVendor}", ENV{ID_MODEL_ID}="$attr{idProduct}", SUBSYSTEM=="usbmisc", ACTION=="add", RUN+="/etc/udev/ZTE-MF60.sh"
and this script:

Code: Select all

#!/bin/bash
#set PATH=/bin:/usr/bin
exec > /var/log/ZTE-MF60.log 2>&1
echo "============================"
date
if [ "$ID_VENDOR_ID" != "19d2" ] ; then
        env
        echo "wrong VID $ID_VENDOR_ID, exiting"
        exit 0
fi
case $ID_MODEL_ID in
    "2000")
        echo "CDROM mode detected"
        COUNT=0
        while [ -x $DEVNAME ] ; do
          sleep 1
          ((COUNT++))
          echo waiting...
          if [ $COUNT -ge 10 ]; then
            echo "timeout"
            exit 0
          fi
        done
        echo "ejecting $DEVNAME"
        eject $DEVNAME
        ;;
    "1402")
        if [ "$SUBSYSTEM" == "usbmisc" ]; then
          echo "hotspotmode detected, enabling QMI/WWAN interface"
          perl -e 'print pack("C*", map {hex} @ARGV)' 01 0f 00 00 00 00 00 00  20 00 04 00 01 01 00 00 > $DEVNAME
        fi
        ;;
    *)
        echo "unknown PID $ID_MODEL_ID"
        exit 0
        ;;
Regards
Aydan

Post Reply