linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Reset modem while using pppd
@ 2017-11-07 15:11 Léo Serre
  2017-11-07 15:25 ` walter harms
  2017-11-07 15:25 ` Marco d'Itri
  0 siblings, 2 replies; 3+ messages in thread
From: Léo Serre @ 2017-11-07 15:11 UTC (permalink / raw)
  To: linux-ppp

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 2273 bytes --]

Hello world,

I'm using pppd with a SARA-U201 3G+ modem (from u-blox).
It works fine normally, except in that case:

  1. pppd is connected to the modem correctly
  2. pppd is stopped using poff
  3. The chat script is changed by the user
  4. pppd is started using pon

That introduces an error, since the modem won't accept a new PIN code as 
it is already connected correctly.

The way to fix that is to send a SW reset AT command 'AT+CFUN=1,1' 
between steps 2 and 4.
That's why I introduced a new disconnect chat script which consists of:

     ABORT 'BUSY'
     ABORT 'NO CARRIER'
     ABORT 'VOICE'
     ABORT 'NO DIALTONE'
     ABORT 'NO DIAL TONE'
     ABORT 'NO ANSWER'
     ABORT 'DELAYED'
     TIMEOUT 180
     'OK' 'AT+CFUN=1,1'

I have the following output:

Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (BUSY)
Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO CARRIER)
Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (VOICE)
Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO DIALTONE)
Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO DIAL TONE)
Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO ANSWER)
Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (DELAYED)
Jan  1 02:24:47 domeradio local2.info chat[568]: timeout set to 180 seconds
Jan  1 02:24:47 domeradio local2.info chat[568]: expect (OK)
Jan  1 02:24:49 domeradio local2.err chat[568]: SIGTERM
Jan  1 02:24:49 domeradio daemon.warn pppd[534]: Child process 
/usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem-off.chat 
(pid 567) terminated with signal 15
Jan  1 02:24:49 domeradio daemon.warn pppd[534]: disconnect script failed
Jan  1 02:24:50 domeradio daemon.info pppd[534]: Exit.

It seems that the command is never sent.

My two questions are:

  1. Do you have an idea about the command that is never sent?
  2. Is there an other way to send an AT command while pppd is running 
(or none)?

Thank you,

Léo SERRE
🌍  leo@lstronic.com <mailto:leo@lstronic.com>
📧  lstronic.com <http://lstronic.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reset modem while using pppd
  2017-11-07 15:11 Reset modem while using pppd Léo Serre
@ 2017-11-07 15:25 ` walter harms
  2017-11-07 15:25 ` Marco d'Itri
  1 sibling, 0 replies; 3+ messages in thread
From: walter harms @ 2017-11-07 15:25 UTC (permalink / raw)
  To: linux-ppp

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 2772 bytes --]



Am 07.11.2017 16:11, schrieb Léo Serre:
> Hello world,
> 
> I'm using pppd with a SARA-U201 3G+ modem (from u-blox).
> It works fine normally, except in that case:
> 
>  1. pppd is connected to the modem correctly
>  2. pppd is stopped using poff
>  3. The chat script is changed by the user
>  4. pppd is started using pon
> 
> That introduces an error, since the modem won't accept a new PIN code as
> it is already connected correctly.
> 
> The way to fix that is to send a SW reset AT command 'AT+CFUN=1,1'
> between steps 2 and 4.
> That's why I introduced a new disconnect chat script which consists of:
> 
>     ABORT 'BUSY'
>     ABORT 'NO CARRIER'
>     ABORT 'VOICE'
>     ABORT 'NO DIALTONE'
>     ABORT 'NO DIAL TONE'
>     ABORT 'NO ANSWER'
>     ABORT 'DELAYED'
>     TIMEOUT 180
>     'OK' 'AT+CFUN=1,1'
> 
> I have the following output:
> 
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (BUSY)
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO CARRIER)
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (VOICE)
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO DIALTONE)
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO DIAL TONE)
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (NO ANSWER)
> Jan  1 02:24:47 domeradio local2.info chat[568]: abort on (DELAYED)
> Jan  1 02:24:47 domeradio local2.info chat[568]: timeout set to 180 seconds
> Jan  1 02:24:47 domeradio local2.info chat[568]: expect (OK)
> Jan  1 02:24:49 domeradio local2.err chat[568]: SIGTERM
                                                  ^^^^^^

You are expecting a 'ok' from the modem that never appears -> timeout
did you try '' 'AT+CFUN=1,1' ?

> Jan  1 02:24:49 domeradio daemon.warn pppd[534]: Child process
> /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem-off.chat
> (pid 567) terminated with signal 15
> Jan  1 02:24:49 domeradio daemon.warn pppd[534]: disconnect script failed
> Jan  1 02:24:50 domeradio daemon.info pppd[534]: Exit.
> 
> It seems that the command is never sent.
> 
> My two questions are:
> 
>  1. Do you have an idea about the command that is never sent?
>  2. Is there an other way to send an AT command while pppd is running
> (or none)?
> 
> Thank you,
> 
> Léo SERRE
> 🌍  leo@lstronic.com <mailto:leo@lstronic.com>
> 📧  lstronic.com <http://lstronic.com>
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reset modem while using pppd
  2017-11-07 15:11 Reset modem while using pppd Léo Serre
  2017-11-07 15:25 ` walter harms
@ 2017-11-07 15:25 ` Marco d'Itri
  1 sibling, 0 replies; 3+ messages in thread
From: Marco d'Itri @ 2017-11-07 15:25 UTC (permalink / raw)
  To: linux-ppp

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

On Nov 07, Léo Serre <leo@lstronic.com> wrote:

>     'OK' 'AT+CFUN=1,1'
This means "sending +CFUN after the OK prompt", but there is nothing 
before that which tells the modem to output the OK prompt.

I think that you can just use +CFUN in the normal connect script, like 
this one that I wrote for Debian ages ago:
https://anonscm.debian.org/git/collab-maint/pkg-ppp.git/tree/debian/extra/chatscripts/gprs

>  2. Is there an other way to send an AT command while pppd is running (or
> none)?
No.

-- 
ciao,
Marco

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-07 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 15:11 Reset modem while using pppd Léo Serre
2017-11-07 15:25 ` walter harms
2017-11-07 15:25 ` Marco d'Itri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).