IoT HAT - PPP keeps disconnecting

I’ve deployed my Pi Zero W with the IoT HAT out in the field and it just barely works. It has excellent LTE signal. When it’s connected, AT commands show that it has -61 dBm RSSI and 4.19 dB SINR on LTE BAND 12, CAT-M1. However, I can’t maintain a PPP connection. Once it connects, it only lasts for a few minutes before getting kicked off and having to start over again. I have a PPP connection for about 2 minutes out of every 10.

This what my ppp peer file looks like:

# /etc/ppp/peers/provider
/dev/ttyUSB3 460800
# The chat script, customize your APN in this file
connect 'chat -s -v -f /etc/chatscripts/chat-connect -T h2g2'
# The close script
disconnect 'chat -s -v -f /etc/chatscripts/chat-disconnect'
# Hide password in debug messages
hide-password
# The phone is not required to authenticate
noauth
persist
# Debug info from pppd
debug
# If you want to use the HSDPA link as your gateway
defaultroute
# pppd must not propose any IP address to the peer
noipdefault
# No ppp compression
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
# For sanity, keep a lock on the serial line
lock
modem
dump
updetach
# Hardware flow control
nocrtscts
remotename 3gppp
ipparam 3gppp
ipcp-max-failure 30

Sometimes this is what the ppp log shows when it loses its connection:

pppd[1131]: rcvd [LCP TermReq id=0x2c]
pppd[1131]: LCP terminated by peer
pppd[1131]: Connect time 2.8 minutes.
pppd[1131]: Sent 1425461 bytes, received 1031159 bytes.
pppd[1131]: Script /etc/ppp/ip-down started (pid 1272)
pppd[1131]: sent [LCP TermAck id=0x2c]
pppd[1131]: Modem hangup
pppd[1131]: Connection terminated.
pppd[1131]: Script /etc/ppp/ip-down finished (pid 1272), status = 0x0

Other times, the ping test in the script that runs ppp fails, so it runs poff and pon. I even changed the ping command to -c 10 instead of -c 1 to make sure it’s REALLY disconnected instead of just 1 failed ping, and that didn’t seem to help.

I’d be happy to provide more context if you have any questions. Any help is greatly appreciated.

I changed the ping command in the script to echo out some information, and this is what I see around the disconnections. I’ve got it pinging every 10 seconds for 10 total pings and if the packet loss is 100%, reconnect.

Feb 10 09:59:27 sh[423]: 10 packets transmitted, 2 received, 80% packet loss, time 856ms
Feb 10 10:00:29 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:01:19 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:01:19 sh[423]: 10 packets transmitted, 2 received, 80% packet loss, time 1011ms
Feb 10 10:02:41 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:03:11 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:03:11 sh[423]: 10 packets transmitted, 3 received, 70% packet loss, time 575ms
Feb 10 10:05:03 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:05:03 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:05:03 sh[423]: 10 packets transmitted, 0 received, 100% packet loss, time 496ms
Feb 10 10:05:03 sh[423]: Connection down, reconnecting...
Feb 10 10:05:03 sudo[19767]:       pi : TTY=unknown ; PWD=/usr/src ; USER=root ; COMMAND=/usr/bin/poff
Feb 10 10:05:03 sudo[19767]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 10 10:05:03 pppd[19334]: Terminating on signal 15
Feb 10 10:05:03 pppd[19334]: Connect time 18.5 minutes.
Feb 10 10:05:03 pppd[19334]: Sent 15495 bytes, received 3092 bytes.
--
Feb 10 10:11:13 sh[423]: 10 packets transmitted, 4 received, 60% packet loss, time 576ms
Feb 10 10:11:23 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:12:53 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:12:53 sh[423]: 10 packets transmitted, 10 received, 0% packet loss, time 159ms
Feb 10 10:13:03 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:14:44 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:14:44 sh[423]: 10 packets transmitted, 8 received, 20% packet loss, time 672ms
Feb 10 10:16:36 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:16:36 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:16:36 sh[423]: 10 packets transmitted, 0 received, 100% packet loss, time 1035ms
Feb 10 10:16:36 sh[423]: Connection down, reconnecting...
Feb 10 10:16:36 sudo[20056]:       pi : TTY=unknown ; PWD=/usr/src ; USER=root ; COMMAND=/usr/bin/poff
Feb 10 10:16:36 sudo[20056]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 10 10:16:36 pppd[19800]: Terminating on signal 15
Feb 10 10:16:36 pppd[19800]: Connect time 11.0 minutes.
Feb 10 10:16:36 pppd[19800]: Sent 7997 bytes, received 1840 bytes.
--
Feb 10 10:22:43 sh[423]: 10 packets transmitted, 2 received, 80% packet loss, time 208ms
Feb 10 10:22:53 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:24:33 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:24:33 sh[423]: 10 packets transmitted, 8 received, 20% packet loss, time 344ms
Feb 10 10:25:34 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:26:24 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:26:24 sh[423]: 10 packets transmitted, 4 received, 60% packet loss, time 109ms
Feb 10 10:28:16 sh[423]: PING 8.8.8.8 (8.8.8.8) from 100.198.168.50 ppp0: 0(28) bytes of data.
Feb 10 10:28:16 sh[423]: --- 8.8.8.8 ping statistics ---
Feb 10 10:28:16 sh[423]: 10 packets transmitted, 0 received, 100% packet loss, time 316ms
Feb 10 10:28:16 sh[423]: Connection down, reconnecting...
Feb 10 10:28:17 sudo[20360]:       pi : TTY=unknown ; PWD=/usr/src ; USER=root ; COMMAND=/usr/bin/poff
Feb 10 10:28:17 sudo[20360]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 10 10:28:17 pppd[20107]: Terminating on signal 15
Feb 10 10:28:17 pppd[20107]: Connect time 11.2 minutes.
Feb 10 10:28:17 pppd[20107]: Sent 9225 bytes, received 2000 bytes.