I need help to automate my internet connection.

I have a HUAWEI E220 modem which is correctly configured. Indeed, I am using it as I write this.

So, wvdial works.

I have also written an init.d script. So, this works too:

/etc/init.d/internet start
/etc/init.d/internet stop

Now, I need help setting udev up so that those commands get called whenever the modem gets plugged in or plugged out.

I made a /etc/udev/rules.d/10-local.rules file that contains:

KERNELS==“ttyUSB0”, ATTRS{port_number}==“0”, ACTION==“add”, RUN+="/etc/init.d/internet start"
KERNELS==“ttyUSB0”, ATTRS{port_number}==“0”, ACTION==“remove”, RUN+="/etc/init.d/internet stop"

(By the way, if it gets wrapped around, I only have it in two lines like I should)

The wvdial command is started by the pluggin the modem, but nothing visible happens.

Actually, something does happen–the modem is disabled and I cannot connect until I disable those rules and reload udev.

Also, wvdial is started and running among the process list.

Can you help me please?

The only thing I can see that might be the cause of your problem is that the script called by udev would get executed before your modem has finished starting up. I use one of these devices, and they need a few seconds to discover the service, before they are ready to connect. So you could add a ‘sleep 10’ to your start script to allow for this. Just a quick first guess…

Thanks Deano.

I tried exactly what you sujested, it didn’t work.

Now, since it could just be a timing issue, I modified the init script to enter a loop checking for the existence of the /etc/ttyUSB0 device before proceeding,and the sleeping some in the loop’s body.

That didn’t work either.

In both cases, the device /dev/ttyUSB0 file would never appear. The file /dev/ttyUSB1 would appear, though.

The script gets started, according to the process list.

That lead me to the conclusion that it is a deadlock I am dealing with. udev waits for the script to finish before creating the device, and the script waits for the device to appear before dialing in and finishing.

Is my perception correct? If so, how can I convince udev to actually create the device before running the script?

I tried adding a NAME assignment frase before RUNning the script, but that did not work either.

Naive question : why not use ttyUSB1 instead of ttyUSB0 in your udev rule ???

Similar idea and approach here. Have a look at the authors udev rule (and script). There maybe some default usb rules needed to be applied prior to any custom ones added, so probably a good idea to give it a name with higher number I think. Hope this helps.

I was trying to research how to configure a Huawei 160; for our daughter who had travelled to Australia; and wanted to connect to their 3 network; using Xandros on an ASUS Eee;

this was an area I was blessedly ignorant about; and I think I still am;

however one programme that emerged from a list of contenders to ease connections; was


and it even has an rpm version for Suse

Umtsmon - openSUSE

I wondered if you felt it might be of value; those using it, seemed to speak highly of its usefulness with the Huawei devices

the .deb version of umtsmon is maintained by the sidux distro, as the .deb packages are not all gathered together; thus one needs to pull gcc and various other packages into a Eee;

the other package that seems to come highly recommended is the vodafone package;

Betavine - repository setup

this is the ASUS page, and I installed it on my own Eee; the first time I have tinkered with the Eee’s installed software;

I see there is a SUSE page

Betavine - How To Suse Guide for VMC

and curiously, the package is slightly more involved to install than the Eee version, but this guide gives much help;

I mention the Vodafone package, as Vodafone use the E220 Huawei and so this package is set up to run the E220

the webpage below lists the various rpm packages of the vodafone-mobile-connect package


and also mentioned on this page are the usb-modeswitch variants; they seem to be important in such things as the Huawei 169 and for .deb packages, automated packages have been built


I apologise if this seems way off beam to you, but having started to try to learn about the Huawei devices, I am now keen to try to continue learning and being guided by others

@pdc_2: The OP has no problem manually connecting AFAIU, he would just like to automate the connection process from plug in. I prefer just to connect manually via knetworkmanager.

Hi Deano Ferrari, Pdc_2, and Christophe_deR.

Christophe_deR, the reason I do not use the USB1 device is because if I did, the USB1 will disappear and USB0 will magically appear.

I know this because the USB0 device appears whenever I disable the rule to manually connect. That modem is the only Internet connection I have available, and I would be in a catch-22 problem if I couldn’t disable the rule and have it dial up.

Pdc_2, I got the modem working at full speed very quickly. It was just a matter of setting up the right wvdial.conf file, which I did as instructed in Spanish in Taringa! - Modem Huawei en linux funcionando y probado, claro .py y .ar.

For those of you who can’t speak Spanish, here is the working wvdial.conf I use now (mainly, I just translated the comments before positing):

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,“IP”,“gprs.claro.com.py” // FIXME: country
Modem Type = USB Modem // It could be “Analog Modem” too
Area Code =
Phone = 99#
ISDN = 0
Password = ctigprs // your provider’s user
Username = ctigprs // your provider’s password
Modem = /dev/ttyUSB0 // Plug in the result of wvdialconf ttyUSB

Baud = 460800
Ask Password = 0
Dial Command = ATD
Stupid Mode = 1
Compuserve = 0
Force Address =
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1

Note that this will only work for those of you who connect via Claro, whether in Paraguay (like me), Argentina, or any other country where Claro is located.

If you don’t use Claro, modify the script accordingly.

As for the link that you gave me, Deano, I thank you for it. I am trying it right now. I will post back the results.