I recently bought a 3G wireless card to use with my laptop, a ZTE, model MF622.
Since the first time I tried linux, also the first time I encountered this kind of problems with my usb ADSL modem, and this being an usb modem also, I knew I was going to have troubles.
At first I tried USB ModeSwitch which has experimental support for ZTE's MF620 model with no luck. I then followed the instructions on the site to snoop the usb comunication under M$ Win to get the messages being sent to the device so I could mimic that under linux. Still, no luck.
I then tried to code a python script which used the libusb so that I could make the device switch to the modem configuration. Still, no luck.
I spent a lot of time on this subject and then one time I removed the usb_storage module while hal was waiting for the device to settle down and guess what!? After a few seconds, the device changed itself to the modem configuration. All I needed now was to automate this procedure.
Here's the udev script that does the job:
ACTION!="add", GOTO="ZTE_End" # Is this the ZeroCD device? SUBSYSTEM=="usb", SYSFS{idProduct}=="2000", SYSFS{idVendor}=="19d2", GOTO="ZTE_ZeroCD" # Is this the actual modem? SUBSYSTEM=="usb", SYSFS{idProduct}=="0001", SYSFS{idVendor}=="19d2", GOTO="ZTE_Modem" LABEL="ZTE_ZeroCD" # This is the ZeroCD part of the card, remove # the usb_storage kernel module so # it does not get treated like a storage device RUN+="/sbin/rmmod usb_storage" LABEL="ZTE_Modem" # This is the Modem part of the card, let's # load usbserial with the correct vendor # and product ID's so we get our usb serial devices RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0001", # Make users belonging to the dialout group # able to use the usb serial devices. MODE="660", GROUP="dialout" LABEL="ZTE_End"
Save this file as /etc/udev.d/15-zte-mf622.rules for example(this path is a good one under (K)Ubuntu).
The next time you plug-in the modem, at first, the usb_storage module get's removed. After a few seconds, since the modem is not being handled like a storage device, it'll switch to the modem configuration. At this stage we tell udev to load the usbserial kernel module with the vendor and product id's and you'll get 3 ttyUSB devices. The /dev/ttyUSB0 will be the one you should use to make a connection.
You can now point ppp or wvdial to that device a start the connection, or, you might also want to check UMTSmon, this is an application suited for these kind of modems.
Comments
Comment by Jim — 2008-01-15 22:44 | # - re
Comment by Patrik Olterman — 2008-01-25 22:17 | # - re
Comment by s0undt3ch — 2008-01-26 00:11 | # - re
Comment by James Hill — 2008-01-31 16:46 | # - re
Hi James & UfSoft Fantastic article on your link, had the modem up & running in about ten minutes. wish all linux config dramas were so easy to solve.
Comment by Mark — 2008-04-13 14:08 | # - re
Comment by Johnbywr — 2008-02-04 15:57 | # - re
could you please guide me how to install 3 modem in my 2 GB linux Eee PC?
Comment by tamjid — 2008-03-12 10:55 | # - re
could you please guide me how to install 3 modem in my 2 GB linux Eee PC? e-mail : opu_ul@yahoo.com
Comment by tamjid — 2008-03-12 10:56 | # - re
Hi!
I am having some problems because the daemon is freezing while sending the config requests. Has anyone got this problem?
Best regards, Marco
Comment by Marco — 2008-03-04 15:32 | # - re
Hi! I have big problem with mounting external usb storage devices like HDD or my PSP. It loads without your script but when i copy it to /etc/udev/rules.d/ it's stopping them from mounting. Do you have any solution?
Comment by Maciej Szpakowski — 2008-03-10 15:55 | # - re
I'm trying to find a solution for this myself. For now I've been connecting the modem and then hashing out the line in the script: RUN+="/sbin/rmmod usb_storage" Then running: # udevcontrol reload_rules This stops it killing usb_storage after the modem's already connected.
Hope that helps, and hopefully I can find some time for something neater.
Dave
Comment by Dave — 2008-04-08 13:16 | # - re
The problem with removing "usb_storage" is that it affects all devices.
If you use USB_ModeSwitch with the flag "DetachStorageOnly" the mode switching works too, but all other USB storage devices (disks, sticks etc.) continue to work. There is an entry for the ZTE MF622 in the config file now.
Comment by josh — 2008-04-25 07:48 | # - re
[…] Riferimenti: usb_modeswitch Unfinished Sofware’s Blog OpenLinux […]
Pingback by Andrea Boscolo » Onda MT512HS Tim — 2008-03-13 08:02 | # - re
This script looks promising, but I get an error "Error inserting usbserial (...): Unknown symbol in module, or unknown parameter". dmesg says "usbserial: Unknown parameter 'vendor'". Anyone else come across this?
Comment by Paddy — 2008-03-28 11:56 | # - re
My little HOWTO on ZTE MF620 and Fedora 8
http://www.dit.upm.es/~jantonio/personal/mf620
(In Spanish, sorry, but should not difficult to read :)
Comment by jonsy — 2008-04-01 17:45 | # - re
Just wondering if anyone's had success with this on an Asus eee PC - I'm looking at buying one but won't until I know I can use my ZTE622 with it!
Comment by Jef Woodhouse — 2008-04-01 22:16 | # - re
hi there. Sorry for the really stupid question...
When I attempt to save the script to the given location, I get the message that I do not have permissions. When I try to modify the permissions, I am told that I cannot modify permissions as I do not own the folder.
Help!!!
Comment by rax — 2008-04-03 23:19 | # - re
[…] file ini berasal dari sini. Intinya rules tersebut menghilangkan fitur usb storage yg dimilik modem ini. di linux, belum adanya fitur usb mode […]
Pingback by Menginstall ZTE MF622 USB Modem di Linux Ubuntu at Adi Setiawan weblog — 2008-04-20 10:23 | # - re
Oi! I'm noob in linux and I don't understand anything. Maybe someone could took pictures how to? And write how to ? :D please, people help, I want to learn something...
Comment by Hematogenas — 2008-04-26 16:47 | # - re
[…] file ini berasal dari sini. Intinya rules tersebut menghilangkan fitur usb storage yg dimilik modem ini. di linux, belum adanya fitur usb mode […]
Pingback by Instalasi ZTE MF622 USB Modem di Linux Ubuntu 7.10 « NGOprek OnLine — 2008-04-28 17:02 | # - re
Just a simple answer to the usb-storage not working problem.I set up a directory in the root tree called udv-rls and copied the mf622 ruleinto there. I also put a sub-directory called bckup and copied all the rules from udev into that for security. I then wrote a small shell script: : #!/bin/bash cp -v /udv-rls/15-zte-mf622.rules /etc/udev/rules.d/ udevcontrol reload_rules # end of script. I saved it in /bin as "3up" That then loaded the rule. I made sure that there were no usb_storage devices in the usb ports, and then plugged in the mf622 dongle and waited for it sort itself out.
After it had produced the /dev/ttyusb0 I then ran another script I called /bin/usf
#!/bin/bash rm -v -f /etc/udev/rules.d/15-zte-mf622.rules udevcontrol reload_rules #end of script
(I found the "force" switch necessary) I could then plug in the usb-storages device(s) at will. The shell scripts have to be run as root from a shell terminal. I use opensuse10.3 I also expect it to work on mandriva 2007.
Comment by Dorothy Hyde — 2008-05-08 16:18 | # - re
Tengo un modem usb zte que quiero instalar en linux open suse 10.0 pero no he podido. sera que me pueden expliar los pasos logicos de instalacion que debo dar. por favor.
Marino ovidio
Comment by Marino Ovidio — 2008-09-14 21:47 | # - re