LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-10-2012, 05:01 PM   #46
san
Member
 
Registered: Jan 2006
Location: vienna, .at
Distribution: Slackware64 13.37
Posts: 50

Rep: Reputation: 12

simple workaround: put the sim card into a mobile phone, disable the pin.

more complicated workaround: use minicom or 'screen /dev/ttyUSB0' to talk to your modem, after initalizing and sending the pin you can issue a command like 'at+clck="sc",0,"XXXX", see here, pp. 20sq.
 
1 members found this post helpful.
Old 08-10-2012, 05:07 PM   #47
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Original Poster
Rep: Reputation: Disabled
Hi san,

thanks for the link, I was searching for such a documentation, I'll try that tomorrow.
But I don't want to disable the PIN. I want to use the stick also outside my home and don't want anyone to use my data-flatrate for free

Has anyone used comgt in order to configure GSM-connections? I found it on slackbuilds.org

Markus

Last edited by markush; 08-10-2012 at 05:09 PM.
 
Old 08-10-2012, 05:42 PM   #48
san
Member
 
Registered: Jan 2006
Location: vienna, .at
Distribution: Slackware64 13.37
Posts: 50

Rep: Reputation: 12
i'm not sure whether chat actually does anything more than 'send and wait for reply', so don't think you can really include if-else statements. man 8 chat claims that
Quote:
The expect sequence should contain only what is needed to identify the
string. Since it is normally stored on a disk file, it should not con‐
tain variable information. It is generally not acceptable to look for
time strings, network identification strings, or other variable pieces
of data as an expect string.
i believe that comgt only works on devices produced by option.

you could try playing around with udev. add a rule run after /dev/ttyUSB0 has been created that executes a shellscript. a very ugly script would include something like
Code:
echo -e "ATZ\n" > /dev/ttyUSB0; sleep 1
... possible other init strings ... 
echo -e "at+cpin=xxxx\n" > /dev/ttyUSB0
maybe you will need "\r\n" instead. if you are interested in this kind of stuff, i recommend the pyserial package (the version on slackbuilds is outdated)
 
1 members found this post helpful.
Old 08-11-2012, 02:19 AM   #49
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Original Poster
Rep: Reputation: Disabled
Hello,

comgt works for my stick. At least it can list the specifications and check and set the pin, for example
Code:
samsung:~# comgt -d /dev/ttyUSB0 info
##### Wireless WAN Modem Configuration #####
Product text:
====

Manufacturer: huawei
Model: E173
Revision: 11.126.85.02.52
IMEI: 861961010540897
+GCAP: +CGSM,+DS,+ES
OK
====
Manufacturer:           huawei
IMEI and Serial Number: 861961010540897
Manufacturer's Revision: 
11.126.85.02.
Hardware Revision:      NOT
Network Locked:         ERROR:
Customisation:          NOT SUPPORT
Band settings:          (NOT)
APN:                    ERROR:
##### END #####
Code:
#!/bin/bash
export COMGTPIN=XXXX
comgt -d /dev/ttyUSB0 PIN
executing the script:
Code:
samsung:~# ./pin.sh 
SIM ready
it works, afterwards I can connect to the internet with the above scripts.

Note that the only valuable documentation I could find for comgt is it's manpage. It is more or less a scripting-language (they say "like Basic") which is far more flexible than chat which comes with the ppp-package.

Markus
 
Old 08-11-2012, 02:46 AM   #50
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Rep: Reputation: 98
There's also umtsmon that provides a nice gui to play with that deals with pin codes etc. Available as source code from sourceforge
 
Old 08-11-2012, 02:50 AM   #51
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by vdemuth View Post
There's also umtsmon that provides a nice gui to play with that deals with pin codes etc. Available as source code from sourceforge
Does it compile on current? I tried umtsmon, but it did not compile, it's a relatively old release from 2009. I would be very interested in using this packages, as far as I understood, it can also check the datavolume.

Markus
 
Old 08-11-2012, 03:21 AM   #52
san
Member
 
Registered: Jan 2006
Location: vienna, .at
Distribution: Slackware64 13.37
Posts: 50

Rep: Reputation: 12
umtsmon needs qt3, it expects you to use a non-stock version of pppd.
with comgt working i would recommend the udev way.
Code:
find /sys -name ttyUSB0
 /sbin/udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB0
this udev rule should work (i've tried it using '/usr/bin/logger modem added' instead of running a script, feel free to add some ATTR strings.
Code:
SUBSYSTEM=="usb-serial", KERNEL=="ttyUSB0", ACTION=="add", RUN+="/my/comgt/script.sh"
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
usbmod: what is it for? (net access via USB-modem / UMTS) JZL240I-U Linux - Networking 8 09-07-2010 05:42 AM
Cannot connect usb cellphone modem to internet Rodemire Linux - Networking 4 02-15-2009 04:59 PM
ADSL USB Modem / Router connecting ( through USB ) but cannot connect to internet DJ Shaji Linux - Networking 1 03-28-2008 03:24 AM
Connect to internet with USB external modem rssguy Linux - Newbie 5 04-28-2005 07:58 PM
can't connect internet with adsl usb modem arthur_mueller Slackware 1 12-23-2003 01:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration