Weak signal confuses my state machine python code

I am using the EM7455 but I sometimes have a weak signal. I am using Debian Linux and my code depends on reading the output of ‘ifconfig’ to make sure the EM7455 has an established connection. Many times throughout the day the virtual eth1 loses the virtual IP address established from the EM7455. I also monitor the connection using the SCACT=? AT command and it will return SCACT=1,0 which means I lost connection. What should my code do if I see SCACT=1,0. Do I reset the EM7455 and perform SCACT=1,1 or do I set a timeout period and hope it returns soon?

my ifconfig output when it works:
eth1: flags=4227<UP,BROADCAST,NOARP,MULTICAST> mtu 1460
inet 10.108.1.4 netmask 255.255.255.248 broadcast 10.108.1.7
inet6 fe80::480d:8072:565e:686c prefixlen 64 scopeid 0x20
ether a6:05:e1:3f:34:08 txqueuelen 1000 (Ethernet)
RX packets 12 bytes 2601 (2.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30 bytes 4528 (4.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

output from the AT command LTEINFO
!LTEINFO: ^M
Serving: EARFCN MCC MNC TAC CID Bd D U SNR PCI RSRQ RSRP RSSI RXLV^M
8115 310 120 31344 0340460B 25 2 2 -1 385 -14.9 -118.0 -89.1 6^M
^M
IntraFreq: PCI RSRQ RSRP RSSI RXLV^M
385 -14.9 -118.0 -89.1 6^M
386 -14.8 -120.4 -96.7 6^M
409 -14.8 -120.4 -96.7 6^M
411 -17.4 -125.5 -96.6 6^M
^M
InterFreq: EARFCN ThresholdLow ThresholdHi Priority PCI RSRQ RSRP RSSI RXLV^M
8763 0 4 1 385 -12.1 -107.2 -86.2 14^M
8763 0 4 1 386 -19.5 -114.7 -86.2 7^M
^M
WCDMA: UARFCN ThreshL ThreshH Prio PSC RSCP ECN0 RXLV^M

You can do the at!scact again when lose network

It is my understanding that I should retain my IP address for 24 hours. I am running the AT commands by hand using minicom and my connection is only lasting for 20 seconds. I think I should call sprint to see if there is a connection timeout established on their end.

I run AT!SCACT=1,1
and I get an IP address.
I continually run AT!SCACT?
and it returns
!SCACT: 1,1
!SCACT: 2,0

OK

for 20 seconds then I loose my IP address and AT!SCACT? returns
!SCACT: 1,0
!SCACT: 2,0

OK

Did you try the connection manager application? Is it having same behavior?

Are you talking about MBPL? I am two years behind on this technology.

I have been reading on the "qmicli or MBPL lite-qmi-connection-manager [Mobile Broadband Package for Linux] document and it appears these libraries are only for C code. Are there python packages for Debian? I am currently using the Gobi drivers and I think these drivers are outdated. Although they work, I am looking for some libraries that do more of the work so don’t have to manage so much code.

Which carrier are you using? How often does your scact disconnect?

I originally thought my issue was a week signal but I looked at my logs from a few of our 200 units a they are all disconnecting even with -86 dB signal. I have a support ticket opened with Sprint.

I am using CSL in hong kong