How to get the usb modem K3772-Z working with Network Manager Applet & Wvdial

10 Sep

The K3772-Z usb modem

The good news is that with ubuntu 12.04 the K3772-Z modem is detected straight after a new install and can be used brilliantly with network manager applet.

I have been working with openSUSE 12.01 which uses an older version of usb-modeswitch which doesn’t switch this modem automatically.

If your K3772-Z is not detected as a modem by the Linux operating System you first need to compile and install the latest usb-modeswitch.

STEP 1: Compiling USB-MODESWITCH

Install the packages necessary on your Linux system to enable you to compile from source code.

In openSUSE 12.01

I opened YaST

I clicked on Software Management Icon

I installed the following packages:

binutils, gcc, gcc46, make

This should be fine, if you find that you cannot compile try installing kernel-devel

Then obtain the latest source code for USB modeswitch at the following location:

http://www.draisberghof.de/usb_modeswitch/#download

At the time of writing you can download : 1. usb-modeswitch-1.2.4.tar.bz2 – extract this to a sub-directory in your “home” directory (I created a /home/simon/src/ directory – “simon” being my personal username)

2. Download usb-modeswitch-data package – extract this to the same directory.

Then this is what i did in a teminal:

cd /home/simon/src/usb-modeswitch-1.2.4 (or “cd” to the directory you extracted the first package) then:

sudo make install

If you have no compiling errors move on

cd /home/simon/src/usb-modeswitch-data-20120815 (or “cd” to the directory that you extracted the 2nd package) then:

sudo make install

Other compiling instructions and specific help is available on the  http://www.draisberghof.de/usb_modeswitch website.

If you have had no compiling errors, plug in your K3772-Z modem and wait . . . It should at first be mounted as a cd drive and flash red. The usb-modeswitch program will switch it to being a modem and the system should detect it automatically. Network manager applet will ask you for a sim pin. Enter this and create a new mobile connection via the network manager applet. (ie Enable Mobile Broadband should be ticked click on New Mobile Broadband connection – follow instructions)

You should now be able to connect to the internet with your K3772-Z usb modem.

Note: Once your modem is detected by the system you can also get your modem to work with Wvdial.

Why bother you may say???

In openSUSE when you configure your Network with YaST you seem to have to disable network manager applet. You therefore need an alternative way to use control your usb modem.

STEP2 : Configuring WVdial.

Plug in your modem and let it be switched – type in the sim pin. (via nm-applet)

In the terminal enter the following command:

sudo wvdialconf /etc/wvdial.conf

This will go through a process of detecting your modem and creating a simple config file at /etc/wvdial.conf

then you need to edit this config file with your specific provider and modem details. Enter at the terminal command line:

sudo nano /etc/wvdial.conf

This is a copy of mine –  Add the relevant lines:

_________________________________________________

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”internet”
Modem = /dev/ttyACM0
Modem Type = USB Modem
Stupid Mode = yes
Baud = 460800
Auto DNS = 1
ISDN = 0
Password = ”
Username = ”
Phone = *99#

[Dialer 1gig]
Init4 = AT+CPIN=”1234″

[Dialer 2gig]
Init4 = AT+CPIN=”5678″

_________________________________________________

A bit of explanation may be needed:

The line Init3 = AT+CGDCONT=1,”IP”,”internet” shows my service provider to have an APN of “internet” this may be different from service provider to service provider. 2. My service provider requires no username or password so I need to use 2 single quotation marks ” as the username & password. You may have a specific password and username to insert in these quotation marks to get connected depending on your service provider. 3. The config file is split into 3 sections. a)”[Dailer defaults]” b) “[Dialer 1gig]” c) “[Dialer 2gig]” This is because I have 2 modems which I call “1gig” and “2gig” each with different sim pins. If you have only one usb modem you need just one entry with your sim pin number.

CTRL x exits the nano program – make sure you save the config file.

Then to use wvdial on my system I have the options of entering the following commands at the terminal:

option 1: “sudo wvdial 1gig” – when I have plugged in the 1gig modem and I haven’t yet entered in the sim pin through Network Manager applet.

option 2:”sudo wvdial 2gig” – when I have plugged in the 2gig modem and I haven’t yet entered in the sim pin through Network Manager applet.

option 3: “sudo wvdial” – when I have plugged in either modems. And have already entered in the sim pin via the Network Manager applet. Only the Dialer default settings will be used by the Dailer.

You should get the following feedback if all is successful – but you might not be finished yet – Read Troubleshooting below to view the /etc/resolv.conf

_____________________________________________

simon@netbook:~$ sudo wvdial 1gig
root’s password:
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Sending: AT+CGDCONT=1,”IP”,”internet”
AT+CGDCONT=1,”IP”,”internet”
OK
–> Sending: AT+CPIN=”1234″
AT+CPIN=”1234″
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
ATDT*99#
CONNECT 7200000
~~
–> Carrier detected.  Starting PPP immediately.
–> Starting pppd at Mon Sep 10 10:23:47 2012
–> Pid of pppd: 2683
–> Using interface ppp0
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> local  IP address 41.6.202.41
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> remote IP address 10.0.0.1
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> primary   DNS address 196.207.40.167
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> secondary DNS address 196.207.40.165
–> pppd: ��[06][08]��[06][08]H�[06][08]
–> Script /etc/ppp/ip-up run successful
–> Default route Ok.
–> Nameserver (DNS) Ok.
–> Connected… Press Ctrl-C to disconnect
–> pppd: ��[06][08]��[06][08]H�[06][08]

___________________________________________________________

TROUBLESHOOTING.

Notice the above snippet shows that my Vodacom SA service provider has the following DNS server addresses. Yours may be different.

primary   DNS address 196.207.40.167

secondary DNS address 196.207.40.165

And the following replies were given:

-> Default route Ok.
–> Nameserver (DNS) Ok

For this to happen these addresses need to be in your /etc/resolv.conf file. The entries need to be made as follows:

nameserver 196.207.40.167

nameserver 196.207.40.165

In Ubuntu I could just insert the following entries manually

In openSUSE I used Yast sysconfig editor and edited the following entry:

Network/General/NETCONFIG_DNS_STATIC_SERVERS

and in the empty box I put the following entries with a space in between

196.207.40.167 196.207.40.165

and pressed the finished button.

Once the nameservers are in the resolv.conf then connect with wvdial. You are no longer dependent on network manager applet.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: