# Pppd always fails after modem reset

**URL:** <https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961>\
**Category:** HL78\
**Created:** [September 25, 2022, 12:47pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961 "2022-09-25T12:47:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![olle.sandberg](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@olle.sandberg](https://forum.sierrawireless.com/u/olle.sandberg)\
**Post date:** [September 25, 2022, 12:47pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/1 "2022-09-25T12:47:28Z")

</div>

Hi,

We’re running a Linux based system connected by USB to a HL7800. On `/dev/ttyACM0` we normally monitor and configure the modem. And on `/dev/ttyACM1` we run pppd initialized with a chat script. Basically using the setup from AN `AirPrime_HL78xx_Establishing_a_PPP_Session_with_a_Linux_Host_Rev1_0`.

We have however noticed that after every modem reset (both hard and soft, and cold boot) pppd fails to connect with “_Connect script failed_”. But the second time pppd is started it will always connect as expected, assuming network registration is ok etc.  
Even if we wait for a couple of minutes after resetting the modem before starting pppd it will still fail on the first run. And the second run it will connect almost instantly.

Looking at the chat log of a failed attempt we can see that the modem is spamming a lot of `ERROR` and spaces. Same thing if we read directly from the `/dev/ttyACM1` device after reset.

This is not a huge problem since it can be worked around by restarting the pppd process. Still annoying since it increases the time before we can connect.

So we’re wondering if this is normal behavior or is there anything we can do to avoid it?

Btw, we see the same behavior on both FW `4.6.9` and `4.4.14`.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [September 25, 2022, 1:06pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/2 "2022-09-25T13:06:22Z")

</div>

do you have the chat log?

There should be no problem for dial up:

> [@HL78xx ttyACM1 PPP port doesn't respond (LCP: timeout sending Config-Requests)](https://forum.sierrawireless.com/t/hl78xx-ttyacm1-ppp-port-doesnt-respond-lcp-timeout-sending-config-requests/24745/12):
>
> no problem is found for dial up in ubuntu 12 using usb /dev/ttyACM1 port with FW 4.6.8.0: Cowner@ubuntu:~$ sudo wvdial → WvDial: Internet dialer version 1.61 → Initializing modem. → Sending: AT AT OK → Modem initialized. → Sending: ATDT991# → Waiting for carrier. A CONNECT TDT99\*\*1# → Carrier detected. Waiting for prompt. ~[7f]}#@!}!}!} }8}!}$}%[14]}"}&} } } } }%}&)Inb}’}"}(}"[q~ → PPP negotiation detected. → Starting pppd at Wed Sep 1 16:28:58 2021 → Pid of pppd: 35…

> [@HL7800 as a network interface in Linux](https://forum.sierrawireless.com/t/hl7800-as-a-network-interface-in-linux/20224/14):
>
> Hi, I tried with all three devices and also with “ATD\*99\*\*\*3#” but still not seeing any ppp0 interface. We are using CAT-M1 if that makes any difference. Best Regards Jesper

---

<div class="post-metadata">

**Author:** ![olle.sandberg](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@olle.sandberg](https://forum.sierrawireless.com/u/olle.sandberg)\
**Post date:** [September 25, 2022, 1:57pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/3 "2022-09-25T13:57:11Z")

</div>

> do you have the chat log?

Sure, I have attached it and chatscript+ppp options.  
This is when running pppd directly (no wvdial), like:

```shell
root@dev:~# pppd /dev/ttyACM1 921600 nodetach                                                                                                                                                                                                                                                                    
Connect script failed

```

Edit: Now attached them.

[ppp-options.txt](https://forum.sierrawireless.com/uploads/short-url/wZ6fIKQ0HwsMQTFou6KHYXyeb56.txt) (122 Bytes)  
[hl78xx-chat.txt](https://forum.sierrawireless.com/uploads/short-url/8TKetQZ34Txu9nE8yozGoxwKGUe.txt) (146 Bytes)  
[chat.txt](https://forum.sierrawireless.com/uploads/short-url/nXQZjWpRuyEQbGVvap6PhMyE7Uv.txt) (915 Bytes)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [September 25, 2022, 2:25pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/4 "2022-09-25T14:25:06Z")

</div>

I don’t see you are sending atd\*99 like this

> [@HL7800 as a network interface in Linux](https://forum.sierrawireless.com/t/hl7800-as-a-network-interface-in-linux/20224/15):
>
> Hi, I tried upgrading the firmware to the latest version. Now I am getting this error instead: pppd[5676]: pppd 2.4.8 started by root, uid 0 chat[5677]: abort on (BUSY) chat[5677]: abort on (NO CARRIER) chat[5677]: abort on (VOICE) chat[5677]: abort on (NO DIALTONE) chat[5677]: abort on (NO ANSWER) chat[5677]: abort on (DELAYED) chat[5677]: timeout set to 10 seconds chat[5677]: send (AT^M) chat[5677]: expect (OK) chat[5677]: AT^M^M chat[5677]: OK chat[5677]: -- got it chat[5677]: send (AT^M) …

---

<div class="post-metadata">

**Author:** ![olle.sandberg](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@olle.sandberg](https://forum.sierrawireless.com/u/olle.sandberg)\
**Post date:** [September 25, 2022, 3:00pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/5 "2022-09-25T15:00:00Z")

</div>

> I don’t see you are sending atd\*99 like this

No but it’s in the chat script:

```plaintext
ABORT BUSY
ABORT "NO CARRIER"
ABORT VOICE
ABORT "NO DIALTONE"
ABORT "NO ANSWER"
ABORT DELAYED
ABORT ERROR
TIMEOUT 10
"" AT
OK "ATD*99***1#"
CONNECT

```

So I would guess it’s not sent because chat never receives an `OK` for the initial `AT`. But instead it receives some `+CEREG ...` and finally aborts on `ERROR`. If I remove the `ABORT ERROR` from the script then the chat log is filled of `ERRORS` and whitespaces.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [September 25, 2022, 3:02pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/6 "2022-09-25T15:02:49Z")

</div>

Probably you need to wait for the registration complete to start the ppp dial up in order not to receive the cereg notification

---

<div class="post-metadata">

**Author:** ![olle.sandberg](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@olle.sandberg](https://forum.sierrawireless.com/u/olle.sandberg)\
**Post date:** [September 26, 2022, 1:06pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/7 "2022-09-26T13:06:45Z")

</div>

Yes, seems like when CEREG URC is enabled these messages appear on both ttyACM0 and ttyACM1. Which conflicts with what the chat script expects first run, while second run these messages has already been read. Still not clear to me what these errors popping up are but think we understand the main problem now anyway.

Thanks for your help @jyijyi !

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [September 26, 2022, 2:24pm UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/8 "2022-09-26T14:24:07Z")

</div>

Not sure if at+cereg=0 (which is to disable the notification) can solve your problem  
You can give a try.

---

<div class="post-metadata">

**Author:** ![olle.sandberg](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@olle.sandberg](https://forum.sierrawireless.com/u/olle.sandberg)\
**Post date:** [September 27, 2022, 6:36am UTC](https://forum.sierrawireless.com/t/pppd-always-fails-after-modem-reset/27961/9 "2022-09-27T06:36:23Z")

</div>

If it could be set for one of the tty’s it would be a potential fix, but seems to be same for all. Hence losing the notifications we want on ttyACM0.
