Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   2 identical GSM-modem discern. (http://www.linux-archive.org/debian-user/435970-2-identical-gsm-modem-discern.html)

Sthu Deus 10-05-2010 04:33 PM

2 identical GSM-modem discern.
 
Thank You for Your time and answer, Michelle:

> In your connection script, you can check, on which USB-Port it
> is connected, then get the /dev/ttyUSBn or /dev/ttyACMn and youare
> done.

But how I can identify which one of the modems is connected on which
port?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4cab5377.9135df0a.3f53.5747@mx.google.com">http://lists.debian.org/4cab5377.9135df0a.3f53.5747@mx.google.com

Ron Johnson 10-05-2010 04:49 PM

2 identical GSM-modem discern.
 
On 10/05/2010 11:33 AM, Sthu Deus wrote:

Thank You for Your time and answer, Michelle:


In your connection script, you can check, on which USB-Port it
is connected, then get the /dev/ttyUSBn or /dev/ttyACMn and youare
done.


But how I can identify which one of the modems is connected on which
port?


Have you tried lsusb?

--
Seek truth from facts.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4CAB571F.40001@cox.net">http://lists.debian.org/4CAB571F.40001@cox.net

Jasper NoŽ 10-06-2010 04:59 PM

2 identical GSM-modem discern.
 
But AFAIK I can retrieve it
only inside of minicom - that makes impossible to use in a connection
script.


You can script communication with a modem using 'chat', that is a tool
that is part of the ppp - package.


HTH, --Jasper.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4CACAAD9.6060904@xs4all.nl">http://lists.debian.org/4CACAAD9.6060904@xs4all.nl

Sthu Deus 10-07-2010 12:38 PM

2 identical GSM-modem discern.
 
Thank You for Your time and answer, Jasper:

> You can script communication with a modem using 'chat', that is a
> tool that is part of the ppp - package.

Do You suggest to look for error w/ chat script in case of wrong
device-ISP pair, or it is possible w/ chat to find out device IMEI?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4cadbf6a.950fdf0a.2129.3413@mx.google.com">http://lists.debian.org/4cadbf6a.950fdf0a.2129.3413@mx.google.com

Jasper NoŽ 10-07-2010 05:19 PM

2 identical GSM-modem discern.
 
or it is possible w/ chat to find out device IMEI?


Yes.

I could send atd*#06# and got a long number as answer.

I wrote a script to give single commands, using chat in it.
I will try to rewrite it later today, so that it is more generally useful.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4CAE013B.2050908@xs4all.nl">http://lists.debian.org/4CAE013B.2050908@xs4all.nl

Jasper NoŽ 10-07-2010 10:57 PM

2 identical GSM-modem discern.
 
or it is possible w/ chat to find out device IMEI?


Yes.

I could send atd*#06# and got a long number as answer.

I wrote a script to give single commands, using chat in it.
I will try to rewrite it later today, so that it is more generally useful.




Attempt to talk to modem using the chat command.
( could not test it, no modem here now )


#!/bin/bash

# 2010-1007 Jasper / talk to a USB-modem

exit_msg () { echo -e $1; exit; }

modem_device=/dev/ttyUSB0

[ -e $modem_device ] || exit_msg "no modem at $modem_device ?"

modem_chat_script=/tmp/modem_chat_script

[ -n "$1" ] || exit_msg "use: modem_cmd -command- "

echo "ABORT ERROR" > $modem_chat_script
echo """ $1" >> $modem_chat_script
echo "OK """ >> $modem_chat_script

echo

chat -E -s -V -f $modem_chat_script <$modem_device >$modem_device

# ( or: /usr/sbin/chat .... )

echo


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4CAE504D.7080302@xs4all.nl">http://lists.debian.org/4CAE504D.7080302@xs4all.nl

Sthu Deus 10-08-2010 09:57 AM

2 identical GSM-modem discern.
 
Thank You for Your time and answer, Jasper:

> Yes.
>
> I could send atd*#06# and got a long number as answer.

That;s just great! Would show a command on command line or whatever how
it can be used all? Say, I have a device called /dev/ttyUSB0 and the
chat cammand, what is the command line then?

> I wrote a script to give single commands, using chat in it.
> I will try to rewrite it later today, so that it is more generally
> useful.

Wow! May, You know how to get balance info - that is how much money
remains on a ISP account?

Thanks for Your great answers, Jasper!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4caeeaf9.d37b0e0a.64e2.ffffd08a@mx.google.com">htt p://lists.debian.org/4caeeaf9.d37b0e0a.64e2.ffffd08a@mx.google.com

Sthu Deus 10-08-2010 10:14 AM

2 identical GSM-modem discern.
 
Thank You for Your time and answer, Jasper:

> chat -E -s -V -f $modem_chat_script <$modem_device >$modem_device

Excuse me for my previous messages - I did not see this Your message.

So, that's what I did:

$ /usr/sbin/chat -E -s -V -f /tmp/qq </dev/ttyUSB0>/dev/ttyUSB0
Failed

in /tmp/qq I have:
atd*#06#

Do You know what can be the reason?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4caeef0c.037b0e0a.2f22.2a77@mx.google.com">http://lists.debian.org/4caeef0c.037b0e0a.2f22.2a77@mx.google.com

Jasper NoŽ 10-08-2010 03:36 PM

2 identical GSM-modem discern.
 
chat -E -s -V -f $modem_chat_script <$modem_device >$modem_device



So, that's what I did:

$ /usr/sbin/chat -E -s -V -f /tmp/qq </dev/ttyUSB0>/dev/ttyUSB0
Failed

in /tmp/qq I have:
atd*#06#


Using the script in my previous mail you should be able to do

modem_cmd atd*#06#

In your example you miss a space before the ">",
and your /tmp/qq should look like

"" atd*#06#
OK ""

From man chat: A script consists of one or more "expect-send" pairs
of strings, separated by spaces


So it reads as "expect nothing, send string, expect OK, send nothing"

The idea of the script is to be able to send -any- command.

--Jasper.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4CAF3A86.8080103@xs4all.nl">http://lists.debian.org/4CAF3A86.8080103@xs4all.nl

Sthu Deus 10-09-2010 04:36 PM

2 identical GSM-modem discern.
 
Thank You for Your time and answer, Jasper:

> In your example you miss a space before the ">",
> and your /tmp/qq should look like
>
> "" atd*#06#
> OK ""

That's what I have now:

/usr/sbin/chat -E -s -V -f /tmp/q </dev/ttyUSB0 >/dev/ttyUSB0
atd*#06#


NO CARRIER

Failed

In /tmp/q I have:
"" atd*#06#
OK ""

Seems that my modem wants a carrier for something - that gives me a
pint that the command may be wrong for mine. So, I have to look to find
mine. But thank You for the point of using chat. I did read that
briefly and got a little from it. So, thank You for extended
explanation, Jasper!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4cb09a2d.cf7d0e0a.11a7.25a7@mx.google.com">http://lists.debian.org/4cb09a2d.cf7d0e0a.11a7.25a7@mx.google.com


All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.