Thursday, February 26, 2009

FEDORA + ZTE MF626 Modem + SmartBro

Here's my collected solution to the installation of ZTE MF626 Modem to Fedora 10.

First, download the usb_modeswitch from this site:
http://www.draisberghof.de/usb_modeswitch/#download
(What is this?)

You need this switcher because of the added function of the modem. It can also serve as a card reader. Unfortunately in F10, it does not automatically switches to modem operation unlike in Win platform.

The file downloaded will be in .tar.bz2 format. Place it in your favorite location (i.e. /usr/local/src).
Extract the file

----
#tar xfj usb_modeswitch.xxx.xx.tar.bz2
----

After extraction, a directory will be created and extracted files is inside that directory. Go to that directory.
Copy "usb_modeswitch" file to /usr/sbin
Copy "usb_modeshift.conf" file to /etc

----
#cp usb_modeswitch /usr/sbin
#cp usb_modeswitch.conf /etc
----

Edit the file /etc/usb_modeswitch.conf and locate the configuration which matches the MF626 modem and uncomment it.
---
#vi /etc/usb_modeswitch.conf
---

usb_modeswitch.conf
# ZTE MF628+ or MF 626
DefaultVendor= 0x19d2
DefaultProduct= 0x2000

TargetVendor= 0x19d2
TargetProduct= 0x0031

MessageEndpoint=0x04
MessageContent="xxxxxxxxxxxxxxxxxxxxxxx" (Do not edit the number)
#


Try and test the usb_modeswitch if results/reply will be successfull.

----
#usb_modeswitch
----


Next, add a new connection type in /etc/wvdial.conf . This will be invoked when you run the dialer. I gathered this from some other forum and tried to manipulate its content for proper operation of MF626 modem.

----
#vi /etc/wvdial.conf


wvdial.conf
#
Init1 = ATZ
Init2 = ATE1
Init3 = AT+CGDCONT=1,”IP”,”smartbro”
Modem Type = USB Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB2
New PPPD = yes
Baud = 912600
Idle Seconds = 3000
Auto DNS = 1
Stupid Mode = 1
Compuserve = 0
Dial Command = ATD
Ask Password = 0
FlowControl = NOFLOW
Username = user
Password = password
#

----


Next create a file in /usr/sbin which will initialize and create a usb serial device in /dev (In my case it created three, but only one is working: /dev/ttyUSB2).

----
#vi /usr/sbin/initmodem

insert the following lines

#!/bin/sh
modprobe usbserial vendor=0×19d2 product=0×0031 && usb_modeswitch
sleep 10


----

Now change the permissions for the created file and make it executable.

----
#chown nobody.nobody /usr/sbin/initmodem
#chmod 777 /usr/sbin/initmodem
----

Plug in your usb modem provided by smart and run the initmodem. This will initialize the serial port and the modeswitch for the dongle.
----
#initmodem
----

To connect to internet, just run the following line
----
#wvdial smartbro
----

After you run wvdial, you will see that the modem is trying to connect. Do not close the terminal for this will also disconnect your connection. Try to look for DNS1 and DNS2 and manually add it to you networks DNS list. Fedora does not capture the auto DNS of your current connection.

If initmodem does not create the said serial port, try to restart your pc but plug the dongle first.
Try to contact me if all else failed.

Cheers

2 comments:

ahmed sobhy said...

Dear sir,
i tried all the steps you mentioned
with the difference that my device is MF626
i uncommented the correct section
when i reached the initmodem step it gave me the following response
Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found default devices (1)
Prepare switching, accessing device 004 on bus 001 ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
Sending the message returned error -110. Trying to continue
-> Run lsusb to note any changes. Bye

the error at the last line
Sending the message returned error -110. Trying to continue

i tried to restart with the dongle pluged but it gave me the same error
can you help me please
and many thanks for your efforts

t-rex said...

Hey,
Sorry for the long reply. Have you got your dongle working?