Christian Faulhammer

und seine kleine Welt

  • Schrift vergrößern
  • Standard-Schriftgröße
  • Schriftgröße verkleinern
Home Archiv Gentoo Not cut-off anymore

Not cut-off anymore

E-Mail PDF

At least not too much. Some might know that I live in a rural area in Germany, where fast internet acces is a bit hard to find. In our home we neither have a telephone line nor internet access, so for my Gentoo related work I have to cross the street to use the (really slow) DSL line over at the company. That's why my desktop computer gets hardly used and my laptop does most of the work.

Anyway, being rural also means that no fast wireless connection is available, but now a new antenna near us at least provides EDGE access for several internet-challenged villages around the area...if they had installed UMTS I am sure that some dozens new customers would have appeared. Indoor signal strength is excellent, so I bought a small surf stick (Huawei E161) from my favourite provider with a prepaid on-demand contract. It is used for quick look-ups and email checks, where we always were too lazy to step outside.

Getting this to work was a bit tricky, as usb_modeswitch refused to work and so only the mass storage part is recognized. As most tutorials were for older kernels or »stale« distributions like Debian or Ubuntu, I could not figure out the correct way. Essential is of course the integration of the correct device drivers in the kernel, which are found in »Device Drivers/USB support/USB Serial Converter support«: CONFIG_USB_SERIAL_GENERIC (USB Generic Serial Driver) and CONFIG_USB_SERIAL_OPTION (USB driver for GSM and CDMA modems). To enable the modem along-side the mass storage you need to emerge sys-fs/udev with USE=extras, which installs the modem-modeswitch utility, which will automagically activate the modem on plug-in.

Connection happens with ppp, that needs enabled support in the kernel in »Device Drivers/Network device support/«: CONFIG_PPP (PPP (point-to-point protocol support) and CONFIG_PPP_ASYNC (PPP support for async serial ports). Install the following script as /etc/ppp/chat.provider (or choose another name, you have to adjust the other script then). It assumes disabled PIN and you have to fill in your APN.

ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT DELAYED
# modeminit
'' 'ATZ'
TIMEOUT 5
OK AT+CPIN?
'READY-AT+CPIN=-' ''
TIMEOUT 20
'OK' 'AT+cgdcont=1,"ip",""'
'OK' 'ATDT*99***1#'
CONNECT \d\c
# end of pppconfig stuff

The next one is placed as /etc/ppp/peers/provider assuming that no authentication is needed (true for my provider).

hide-password
noauth
connect "/usr/sbin/chat -f /etc/ppp/chat.provider"
debug
/dev/ttyUSB0
460800
defaultroute
noipdefault
noccp
nobsdcomp
novj
user ""
password ""
usepeerdns
connect-delay 10000

Now you can connect with /usr/sbin/pon provider and disconnect with /usr/sbin/poff. All output is logged via syslog (virtual console 12) or you use a dial tool of your choice.

Kommentare

avatar Anton
0
 
 
I remember it was a fix for storage mode, it should be build in to the kernel now.
It least I don't need modeswitch with Huawai e220/e270 anymore. See more details in the wiki:
http://en.gentoo-wiki.com/wiki/Huawei_E220
http://wiki.archlinux.org/index.php/Huawei_E220
"Linux kernel versions prior to 2.6.20 have some problems with it, as the SCSI CDROM fakevolume with drivers for Microsoft systems gets automounted by usbstorage.ko module, preventing serial device /dev/ttyUSB0 from working properly."

not sure about e161 though ;-)
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar Christian Faulhammer
0
 
 
Mode switching with udev is needed, but both entities coexist then.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar James Le Cuirot
0
 
 
It is possible, and in my option, nicer, to make this stuff work through Gentoo's net scripts. My example here is for Bluetooth so you probably won't need the pre/post functions but the rest is similar.

http://bugs.gentoo.org/show_bug.cgi?id=218786#c44
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar Christian Faulhammer
0
 
 
Thank you for the pointer, but I want the connection on special and scarce occasions and I can run pon and poff even as normal user.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar Anton
0
 
 
btw, there is one more thing you might need in /etc/ppp/peers/provider if having a problem with DNS:
usepeerwins
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar dreeh
0
 
 
thank you for this tutorial.

what about the PIN for the sim card? is it not needed to build up a connection?
christian, whats your "favourite provider"? can you give me one or more chars?

thank you, denny reeh
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar Christian Faulhammer
0
 
 
It comes directly after the CGPIN=-. My provider is O2.
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar dreeh
0
 
 
thank you again.

my provider is fonic. the connection will not establish with ppp.
so i found another tutorial (for wvdial), this settings are working:
http://www.kde4.de/?p=635

denny reeh
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
avatar Christian Faulhammer
0
 
 
May have to do with a different UMTS stick
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken
Abbrechen
B
i
u
Quote
Code
List
List item
URL
Name *
URL
Code   
ChronoComments by Joomla Professional Solutions
Kommentar abschicken