usb-switchmode seems not to work out-of-the-box. I need to remove the supplied /etc/udev/rules.d/usb_modeswitch.rules,
otherwise it seems not to want to switch.
I have captured what happens:
:~# #insert zte mf636 modem
:~# lsusb
Bus 004 Device 014: ID 19d2:2000 ONDA Communication S.p.A.
:~# usb_modeswitch -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0031 -m 0x01 -M 55534243123456782000000080000c85010101180101010101000000000000
* usb_modeswitch: tool for controlling "flip flop" mode USB devices
* Version 0.9.6 (C) Josua Dietze 2009
* Works with libusb 0.1.12 and probably other versions
Looking for target devices
No target device found
Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
Looking for active default driver to detach it
No driver found. Device probably not initialized. Trying to continue ...
Setting up communication with device
Trying to send the message
Sending the message returned error -110, trying to continue ...
-> See /proc/bus/usb/devices (or call lsusb) for changes. Bye
:~# mv /etc/udev/rules.d/usb_modeswitch.rules /etc/udev/rules.d/usb_modeswitch.rules.old
:~# #remove zte mf636 modem
:~# #reinsert zte mf636 modem
:~# lsusb
Bus 004 Device 015: ID 19d2:2000 ONDA Communication S.p.A.
:~# usb_modeswitch -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0031 -m 0x01 -M 55534243123456782000000080000c85010101180101010101000000000000
* usb_modeswitch: tool for controlling "flip flop" mode USB devices
* Version 0.9.6 (C) Josua Dietze 2009
* Works with libusb 0.1.12 and probably other versions
Looking for target devices
No target device found
Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
Looking for active default driver to detach it
No driver found. Device probably not initialized. Trying to continue ...
Setting up communication with device
Trying to send the message
OK, message successfully sent.
-> See /proc/bus/usb/devices (or call lsusb) for changes. Bye
:~# lsusb
Bus 004 Device 016: ID 19d2:0031 ONDA Communication S.p.A.
After I put the -v,-p,-V,-P options into /etc/usb_modeswitch.conf, it's ready to work with umtsmon, together with this file:
cat /etc/udev/rules.d/90-zte.rules
ACTION!="add", GOTO="ZTE_End"
#
SUBSYSTEM=="usb", SYSFS{idProduct}=="0031",
SYSFS{idVendor}=="19d2", GOTO="ZTE_Modem"
#
LABEL="ZTE_Modem"
RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0031",
MODE="660", GROUP="dialout"
#
LABEL="ZTE_End"
-- System Information:
Debian Release: 5.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=nb_NO.UTF-8, LC_CTYPE=nb_NO.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages usb-modeswitch depends on:
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libusb-0.1-4 2:0.1.12-13 userspace USB programming library
usb-modeswitch recommends no packages.
Versions of packages usb-modeswitch suggests:
pn gcom <none> (no description available)
pn wvdial <none> (no description available)
-- no debconf information
--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Le mardi 14 avril 2009 09:34:05 Klaus Ade Johnstad, vous avez écrit :
> Package: usb-modeswitch
> Version: 0.9.6-2
> Severity: normal
>
> usb-switchmode seems not to work out-of-the-box. I need to remove the
> supplied /etc/udev/rules.d/usb_modeswitch.rules, otherwise it seems not to
> want to switch.
>
> I have captured what happens:
> :~# #insert zte mf636 modem
> :~# lsusb
>
> Bus 004 Device 014: ID 19d2:2000 ONDA Communication S.p.A.
>
> :~# usb_modeswitch -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0031 -m 0x01 -M
> : 55534243123456782000000080000c85010101180101010101000000000000
(…)> … Errors due to the fact that a udev rule with different parameters was run
first.
The idea of the udev rules is that you _do_not_ need to run usb_modeswitch after
plugging your device in.
The usb_modeswitch.rules file is generated from the .conf file at build time. It
contains generated "usb_modeswitch" commandlines which are supposed to be
triggered when you plug your device in.
But there is a BIG problem with those 3G keys in general, which is not solvable
with udev rules or anything else AFAICS: several devices with same
idVendor:idProduct identifiers need different commands on the usb port.
That's why the generated usb_modeswitch.rules file contains all the possible
devices/commands combinations but with several ones commented. See for example
the 0x19d2:0x2000 series (which is your the identifier of your key by the way):
ZTE MF620 (aka "Onda MH600HS")
# ZTE MF622 (aka "Onda MDC502HS")
# ZTE MF622 (probably different version)
# ZTE MF628
# ZTE MF628+ (tested version from Telia / Sweden) - ZTE MF626
# ZTE MF638 (aka "Onda MDC525UP")
# ONDA MT503HS (most likely a ZTE model)
# ONDA MT505UP (most likely a ZTE model)
There are 8 devices with the _same_ idVendor:idProduct string and no way to see
a difference between them. That's why the first one is uncommented and all the
following ones are commented. That's the best I can do: it will work for some
people that have the first device listed and won't work for the others.
To make your device work "out-of-the-box", you just need to edit the rules file
(/etc/udev/rules.d/usb_modeswitch.rules) so that the line corresponding to your
device is the only one commented out for its idVendor:idProduct string.
> :~# mv /etc/udev/rules.d/usb_modeswitch.rules
> : /etc/udev/rules.d/usb_modeswitch.rules.old ~# #remove zte mf636 modem
> :~# #reinsert zte mf636 modem
> :~# lsusb
>
> Bus 004 Device 015: ID 19d2:2000 ONDA Communication S.p.A.
>
> :~# usb_modeswitch -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0031 -m 0x01 -M
> : 55534243123456782000000080000c85010101180101010101000000000000
(…)> … Message telling that it worked correctly.
> :~# lsusb
>
> Bus 004 Device 016: ID 19d2:0031 ONDA Communication S.p.A.
The commandline that you are using is in the rules file at line 156:
#SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="2000",
RUN+="/usr/sbin/usb_modeswitch --DefaultVendor 0x19d2 --DefaultProduct
0x2000 --MessageEndpoint 0x01 --MessageContent
55534243123456782000000080000c85010101180101010101000000000000"
But it is commented. Just comment it out in the rules files (and comment line
122, where a line for a same idVendor:idProduct exists) and it should "just
work". (aka "when you plug your device in, usb_modeswitch will be run with the
correct parameters and your device will disappear as zeroconf device and appear
as modem - it just takes a few seconds).
> After I put the -v,-p,-V,-P options into /etc/usb_modeswitch.conf, it's
> ready to work with umtsmon, together with this file:
>
> cat /etc/udev/rules.d/90-zte.rules
> ACTION!="add", GOTO="ZTE_End"
> #
> SUBSYSTEM=="usb", SYSFS{idProduct}=="0031",
> SYSFS{idVendor}=="19d2", GOTO="ZTE_Modem"
> #
> LABEL="ZTE_Modem"
> RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0031",
> MODE="660", GROUP="dialout"
> #
> LABEL="ZTE_End"
I guess that your file will work correctly and modprobe will be run after
modeswitch, when the device appear.
By the way, you should be able to see what happens (i.e. debugging) by following
syslog: you will see the first zeroconf device appear and then disappear and
the modem appear (after usb_modeswitch has run in the background).
I hope that these explanations made the whole a little clearer !
Best regards,
OdyX
--
Didier Raboud, proud Debian user and usb_modeswitch maintainer.
CH-1802 Corseaux
did...@raboud.com
I have some follow up questions:
So, I commented line 122, and removed the comment on line 156
in /etc/udev/rules.d/usb_modeswitch.rules .
I also removed the comments on the lines 392-405
in /etc/usb_modeswitch.conf that corresponded to the device on line 156
in /etc/udev/rules.d/usb_modeswitch.rules
This is my syslog when I attach the modem:
81.514349] usb 4-3: new high speed USB device using ehci_hcd and address
3
81.656837] usb 4-3: configuration #1 chosen from 1 choice
81.662363] usb 4-3: New USB device found, idVendor=19d2, idProduct=2000
81.662381] usb 4-3: New USB device strings: Mfr=2, Product=1,
SerialNumber=0
81.662389] usb 4-3: Product: ZTE CDMA Technologies MSM
81.662396] usb 4-3: Manufacturer: ZTE, Incorporated
83.307794] Initializing USB Mass Storage driver...
83.310044] usb-storage: device ignored
83.310330] usbcore: registered new interface driver usb-storage
83.310342] USB Mass Storage support registered.
85.141941] usb 4-3: USB disconnect, address 3
90.590162] usb 4-3: new high speed USB device using ehci_hcd and address
4
90.724330] usb 4-3: configuration #1 chosen from 1 choice
95.352199] scsi1 : SCSI emulation for USB Mass Storage devices
95.360750] usb 4-3: New USB device found, idVendor=19d2, idProduct=0031
95.360767] usb 4-3: New USB device strings: Mfr=2, Product=1,
SerialNumber=3
95.360776] usb 4-3: Product: ZTE CDMA Technologies MSM
95.360783] usb 4-3: Manufacturer: ZTE, Incorporated
95.360790] usb 4-3: SerialNumber: 1234567890ABCDEF
95.361495] usb-storage: device found at 4
95.361506] usb-storage: waiting for device to settle before scanning
100.360673] usb-storage: device scan complete
100.361646] scsi 1:0:0:0: Direct-Access ZTE MMC Storage
322 PQ: 0 ANSI: 2
100.362263] scsi 1:0:0:1: Direct-Access ZTE MMC Storage
322 PQ: 0 ANSI: 2
101.068311] Driver 'sd' needs updating - please use bus_type methods
101.073776] sd 1:0:0:0: [sda] 20480 512-byte hardware sectors (10 MB)
101.074513] sd 1:0:0:0: [sda] Write Protect is on
101.074527] sd 1:0:0:0: [sda] Mode Sense: 0f 0e 80 00
101.074534] sd 1:0:0:0: [sda] Assuming drive cache: write through
101.076913] sd 1:0:0:0: [sda] 20480 512-byte hardware sectors (10 MB)
101.077657] sd 1:0:0:0: [sda] Write Protect is on
101.077671] sd 1:0:0:0: [sda] Mode Sense: 0f 0e 80 00
101.077679] sd 1:0:0:0: [sda] Assuming drive cache: write through
101.077688] sda:
101.082679] sd 1:0:0:0: [sda] Attached SCSI removable disk
101.084109] sd 1:0:0:1: [sdb] Attached SCSI removable disk
But, umtsmon does not find any modem until I add
my /etc/udev/rules.d/90-zte.rules , is that how it should be?
This is my syslog after I have added 90-zte.rules :
858.404414] usb 4-3: new high speed USB device using ehci_hcd and
address 5
858.547280] usb 4-3: configuration #1 chosen from 1 choice
858.552860] usb-storage: device ignored
858.557855] usb 4-3: New USB device found, idVendor=19d2, idProduct=2000
858.557870] usb 4-3: New USB device strings: Mfr=2, Product=1,
SerialNumber=0
858.557879] usb 4-3: Product: ZTE CDMA Technologies MSM
858.557885] usb 4-3: Manufacturer: ZTE, Incorporated
859.125173] usbcore: registered new interface driver usbserial
859.125216] usbserial: USB Serial support registered for generic
859.125277] usbcore: registered new interface driver usbserial_generic
859.125284] usbserial: USB Serial Driver core
861.230191] usb 4-3: USB disconnect, address 5
866.384053] usb 4-3: new high speed USB device using ehci_hcd and
address 6
866.518849] usb 4-3: configuration #1 chosen from 1 choice
871.132438] usbserial_generic 4-3:1.0: Generic device with no bulk out,
not allowed.
871.132438] usbserial_generic: probe of 4-3:1.0 failed with error -5
871.132438] usbserial_generic 4-3:1.1: Generic device with no bulk out,
not allowed.
871.132438] usbserial_generic: probe of 4-3:1.1 failed with error -5
871.132438] scsi3 : SCSI emulation for USB Mass Storage devices
871.132438] usbserial_generic 4-3:1.3: generic converter detected
871.132438] usb 4-3: generic converter now attached to ttyUSB0
871.132438] usb 4-3: New USB device found, idVendor=19d2, idProduct=0031
871.132438] usb 4-3: New USB device strings: Mfr=2, Product=1,
SerialNumber=3
871.132438] usb 4-3: Product: ZTE CDMA Technologies MSM
871.132438] usb 4-3: Manufacturer: ZTE, Incorporated
871.132438] usb 4-3: SerialNumber: 1234567890ABCDEF
871.132438] usb-storage: device found at 6
871.132438] usb-storage: waiting for device to settle before scanning
876.132601] usb-storage: device scan complete
876.133448] scsi 3:0:0:0: Direct-Access ZTE MMC Storage
322 PQ: 0 ANSI: 2
876.134189] scsi 3:0:0:1: Direct-Access ZTE MMC Storage
322 PQ: 0 ANSI: 2
876.167671] sd 3:0:0:0: [sda] 20480 512-byte hardware sectors (10 MB)
876.168288] sd 3:0:0:0: [sda] Write Protect is on
876.168301] sd 3:0:0:0: [sda] Mode Sense: 0f 0e 80 00
876.168309] sd 3:0:0:0: [sda] Assuming drive cache: write through
876.171037] sd 3:0:0:0: [sda] 20480 512-byte hardware sectors (10 MB)
876.171785] sd 3:0:0:0: [sda] Write Protect is on
876.171797] sd 3:0:0:0: [sda] Mode Sense: 0f 0e 80 00
876.171804] sd 3:0:0:0: [sda] Assuming drive cache: write through
876.171813] sda:
876.174956] sd 3:0:0:0: [sda] Attached SCSI removable disk
876.192329] sd 3:0:0:1: [sdb] Attached SCSI removable disk
So, to summarise:
By using line 156 instead of 122
in /etc/udev/rules.d/usb_modeswitch.rules and by making the
corresponding changes to lines 392-405 in /etc/usb_modeswitch.conf ,
and then adding the file /etc/udev/rules.d/90-zte.rules, then umtsmon
works, and I can connect.
I'm working on a howto for teachers to be able to connect themselves.
--
Klaus Ade
67E61D18B2C44F8A3DA35C6D849F9F5F 26FA477D