openSUSE Forums > Hardware » I need help to automate my internet connection.

Go Back   openSUSE Forums > Hardware
Forums FAQ Members List Search Today's Posts Mark Forums Read


Hardware Questions about drivers, peripheral cabling, configuration

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 17-Apr-2009, 20:39
Puzzled Penguin
 
Join Date: Feb 2009
Posts: 17
vrrivaro hasn't been rated much yet
Question 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?
Reply With Quote
  #2 (permalink)  
Old 18-Apr-2009, 00:55
Wise Penguin
 
Join Date: Jun 2008
Location: NZ
Posts: 1,848
deano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura about
Default Re: I need help to automate my internet connection.

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...
Reply With Quote
  #3 (permalink)  
Old 18-Apr-2009, 14:13
Puzzled Penguin
 
Join Date: Feb 2009
Posts: 17
vrrivaro hasn't been rated much yet
Default Re: I need help to automate my internet connection.

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.
Reply With Quote
  #4 (permalink)  
Old 18-Apr-2009, 14:38
Explorer Penguin
 
Join Date: Jun 2008
Location: Europe
Posts: 106
Christophe_deR hasn't been rated much yet
Default Re: I need help to automate my internet connection.

Naive question : why not use ttyUSB1 instead of ttyUSB0 in your udev rule ???
Reply With Quote
  #5 (permalink)  
Old 18-Apr-2009, 15:12
Wise Penguin
 
Join Date: Jun 2008
Location: NZ
Posts: 1,848
deano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura about
Default Re: I need help to automate my internet connection.

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.
Reply With Quote
  #6 (permalink)  
Old 18-Apr-2009, 16:13
Parent Penguin
 
Join Date: Jun 2008
Posts: 700
pdc_2 hasn't been rated much yet
Default Re: I need help to automate my internet connection.

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

Quote:
umtsmon
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

https://forge.betavine.net/frs/?group_id=12

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

http://www.greenhughes.com/content/h...e169g-easy-way

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
Reply With Quote
  #7 (permalink)  
Old 18-Apr-2009, 18:55
Wise Penguin
 
Join Date: Jun 2008
Location: NZ
Posts: 1,848
deano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura aboutdeano_ferrari has a spectacular reputation aura about
Default Re: I need help to automate my internet connection.

@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.
Reply With Quote
  #8 (permalink)  
Old 19-Apr-2009, 12:22
Puzzled Penguin
 
Join Date: Feb 2009
Posts: 17
vrrivaro hasn't been rated much yet
Default Re: I need help to automate my internet connection.

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.
Reply With Quote
Reply

Bookmarks

Tags
internet connection, udev


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2