Skip to content

cellular -> NetLoss loop fix#1189

Merged
dexterbg merged 1 commit into
openvehicles:masterfrom
zorgms:master
Sep 2, 2025
Merged

cellular -> NetLoss loop fix#1189
dexterbg merged 1 commit into
openvehicles:masterfrom
zorgms:master

Conversation

@zorgms

@zorgms zorgms commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

When the modem detects a NetLoss, it usually enters a continuous loop of NetLoss, NetWait and NetStart when a Wi-Fi connection is used. The problem can be simulated with ‘cellular setstate NetLoss’. The fix provides that when a NetLoss loop is detected, the modem then performs a PowerOffON, which reliably solves the problem.

When the modem detects a NetLoss, it usually enters a continuous loop of NetLoss, NetWait and NetStart when a Wi-Fi connection is used. The problem can be simulated with ‘cellular setstate NetLoss’. The fix provides that when a NetLoss loop is detected, the modem then performs a PowerOffON, which reliably solves the problem.
@dexterbg

dexterbg commented Sep 1, 2025

Copy link
Copy Markdown
Member

ZorG, I'd be very surprised if that was generally the case, as the cellular state machine has been very stable for me.

A quick test run with my desk module:

I (52269) cellular: PPP Connection is ready to start
D (53219) cellular: State transition NetStart => NetMode
I (53219) cellular: State: Enter NetMode state
V (53219) cellular: Launching PPP
V (53219) cellular: Starting PPP
I (53219) gsm-ppp: Initialising...
D (53229) events: Signal(system.modem.netmode)
I (53869) gsm-ppp: StatusCallBack: None
I (53869) gsm-ppp: status_cb: Connected
I (53869) gsm-ppp:    our_ipaddr  = 10.170.195.13
I (53869) gsm-ppp:    his_ipaddr  = 10.64.64.64
I (53869) gsm-ppp:    netmask     = 255.255.255.255
I (53869) gsm-ppp:    DNS#0       = 8.8.8.8
I (53869) gsm-ppp:    DNS#1       = 8.8.4.4
I (53869) gsm-ppp:    our6_ipaddr = ::
D (53869) events: Signal(network.interface.up)
D (53879) events: Signal(system.modem.gotip)
D (53879) netmanager: Saved DNS#0 8.8.8.8
D (53879) netmanager: Saved DNS#1 8.8.4.4
D (53879) netmanager: Saved DNS#2 0.0.0.0
I (53879) netmanager: Set DNS#1 0.0.0.0
I (53879) netmanager: Set DNS#2 0.0.0.0
I (53879) netmanager: MODEM up (with WIFI client up): staying with WIFI client priority
D (53879) events: Signal(network.modem.up)
D (53889) events: Signal(network.interface.change)
D (54699) cellular: mux-rx-line #3 (10/0): +CSQ: 19,0
D (57699) cellular: mux-rx-line #3 (10/0): +CSQ: 19,4
D (59679) cellular: mux-rx-line #3 (11/0): +CSQ: 20,99
D (59679) cellular: Signal Quality is: 20 (-73 dBm)
D (63709) cellular: mux-rx-line #3 (10/0): +CSQ: 20,0

OVMS# cellular setstate NetLoss 
Set modem to state: NetLoss

I (76499) cellular: State: Enter NetLoss state
D (76499) cellular: mux-tx #3: AT+CGATT=0
D (76499) events: Signal(system.modem.netloss)
V (76499) cellular: Stopping PPP
I (76499) gsm-ppp: Shutting down (hard)...
I (76499) gsm-ppp: StatusCallBack: User Interrupt
I (76499) gsm-ppp: PPP is shutdown
D (76509) events: Signal(system.modem.down)
I (76509) netmanager: Set DNS#1 0.0.0.0
I (76509) netmanager: Set DNS#2 0.0.0.0
I (76509) netmanager: MODEM down (with WIFI client up): staying with WIFI client priority
D (76509) netmanager: send cmd 3 from 0x0
D (76509) netmanager: done cmd 3 from 0x0
D (76509) events: Signal(network.modem.down)
D (76519) events: Signal(network.interface.change)
D (76559) netmanager: MongooseTask: got cmd 3 from 0x0
D (76569) netmanager: CleanupConnections: conn 3f864a38 -> iface st1
D (76569) netmanager: MongooseTask: done cmd 3 from 0x0
D (86219) cellular: State timeout NetLoss => NetWait
I (86219) cellular: State: Enter NetWait state
D (86219) events: Signal(system.modem.netwait)
D (89309) cellular: mux-rx-line #3 (2/0): OK
D (90219) cellular: State transition NetWait => NetStart
I (90219) cellular: State: Enter NetStart state
D (90219) events: Signal(system.modem.netstart)
D (91219) cellular: Netstart AT+CGDCONT=1,"IP","hologram";+CGDATA="PPP",1
D (91279) cellular: mux-rx-line #2 (14/0): CONNECT 115200
I (91279) cellular: PPP Connection is ready to start
D (92219) cellular: State transition NetStart => NetMode
I (92219) cellular: State: Enter NetMode state
V (92219) cellular: Starting PPP
I (92219) gsm-ppp: Initialising...
D (92229) events: Signal(system.modem.netmode)
D (93729) cellular: mux-rx-line #3 (10/0): +CSQ: 20,7
D (95729) cellular: mux-rx-line #3 (10/0): +CSQ: 20,2
D (96269) cellular: mux-rx-line #3 (9/0): +CGREG: 2
D (99509) cellular: mux-rx-line #3 (10/0): +CSQ: 20,0
D (99509) cellular: mux-rx-line #3 (9/0): +CGREG: 5
I (99979) gsm-ppp: StatusCallBack: None
I (99979) gsm-ppp: status_cb: Connected
I (99979) gsm-ppp:    our_ipaddr  = 10.170.195.13
I (99979) gsm-ppp:    his_ipaddr  = 10.64.64.64
I (99979) gsm-ppp:    netmask     = 255.255.255.255
I (99979) gsm-ppp:    DNS#0       = 8.8.8.8
I (99979) gsm-ppp:    DNS#1       = 8.8.4.4
I (99979) gsm-ppp:    our6_ipaddr = ::
D (99979) events: Signal(network.interface.up)
D (99979) events: Signal(system.modem.gotip)
D (99979) netmanager: Saved DNS#0 8.8.8.8
D (99979) netmanager: Saved DNS#1 8.8.4.4
D (99979) netmanager: Saved DNS#2 0.0.0.0
I (99989) netmanager: Set DNS#1 0.0.0.0
I (99989) netmanager: Set DNS#2 0.0.0.0
I (99989) netmanager: MODEM up (with WIFI client up): staying with WIFI client priority
D (99989) events: Signal(network.modem.up)
D (99989) events: Signal(network.interface.change)
OVMS# me li mdm
m.net.mdm.iccid                          8944…………
m.net.mdm.mode                           GSM,Online
m.net.mdm.model                          LE20B03SIM7600M21-A
m.net.mdm.netreg                         RegisteredRoaming
m.net.mdm.network                        vodafone.de Hologram
m.net.mdm.sq                             -73dBm

IOW, the module recovers from a NetLoss within 23 seconds just as it should.

Please show the log of a misbehaviour in the way you intend to solve with this PR.

Please also show your modem model/firmware version -- there has been a report indicating issues with some firmware versions: #1151 (comment)

Regards,
Michael

@zorgms

zorgms commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author
I (22931) cellular: State: Enter Identify state
I (23221) cellular: Identified cellular modem: SIM7600/Experimental support for SIMCOM SIM7600
I (23221) cellular: Set modem driver to 'SIM7600'
I (23221) cellular: State: Enter PoweredOn state
I (28111) webserver: HTTP GET /xsq/climate
I (37031) webserver: HTTP GET /status
I (43221) cellular: State: Enter MuxStart state
I (43221) gsm-mux: Start MUX
I (43241) gsm-mux: Channel #0 is open
I (43251) gsm-mux: Channel #1 is open
I (43261) gsm-mux: Channel #2 is open
I (43271) gsm-mux: Channel #3 is open
I (43281) gsm-mux: Channel #4 is open
I (43361) webserver: HTTP POST /api/execute
I (43371) webcommand: HttpCommandStream[0x3f8db39c]: 3322288 bytes free, executing: cellular status
I (44211) cellular: State: Enter NetWait state
I (44211) gsm-nmea: Startup
I (44451) webserver: HTTP POST /api/execute
I (44461) webcommand: HttpCommandStream[0x3f8dae20]: 3324044 bytes free, executing: cellular status
I (44511) webserver: HTTP GET /shell
I (54231) cellular: Network Registration status: RegisteredHome
I (55211) cellular: State: Enter NetStart state
I (55231) cellular: Network Mode: LTE,Online
I (56271) cellular: PPP Connection is ready to start
I (57211) cellular: State: Enter NetMode state
I (57211) gsm-ppp: Initialising...
I (57351) gsm-ppp: StatusCallBack: None
I (57351) gsm-ppp: status_cb: Connected
I (57351) gsm-ppp:    our_ipaddr  = 10.115.15.248
I (57351) gsm-ppp:    his_ipaddr  = 10.64.64.64
I (57351) gsm-ppp:    netmask     = 255.255.255.255
I (57351) gsm-ppp:    DNS#0       = 62.109.121.17
I (57351) gsm-ppp:    DNS#1       = 62.109.121.18
I (57351) gsm-ppp:    our6_ipaddr = ::
I (57361) netmanager: Set DNS#1 0.0.0.0
I (57361) netmanager: Set DNS#2 0.0.0.0
I (57361) netmanager: MODEM up (with WIFI client up): staying with WIFI client priority
I (89231) cellular: Network Provider is: FONIC
I (108701) webserver: HTTP POST /api/execute
I (108711) webcommand: HttpCommandStream[0x3f8df160]: 3319312 bytes free, executing: cellular setstate NetLoss

OVMS# cellular setstate NetLoss
Set modem to state: NetLoss

I (108711) cellular: State: Enter NetLoss state
I (108711) gsm-ppp: Shutting down (hard)...
I (108711) gsm-ppp: StatusCallBack: User Interrupt
I (108721) gsm-ppp: PPP is shutdown
I (108721) netmanager: Set DNS#1 0.0.0.0
I (108721) netmanager: Set DNS#2 0.0.0.0
I (108721) netmanager: MODEM down (with WIFI client up): staying with WIFI client priority
I (118211) cellular: State: Enter NetWait state
I (122211) cellular: State: Enter NetStart state
I (122211) housekeeping: System considered stable (RAM: 8b=76016-76360 32b=12292 SPI=3243408-3254968)
I (123271) cellular: PPP Connection is ready to start
I (124211) cellular: State: Enter NetMode state
I (124211) gsm-ppp: Initialising...
I (124321) cellular: PPP Connection disconnected
W (125211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (125211) cellular: State: Enter NetLoss state
I (125211) gsm-ppp: Shutting down (hard)...
I (125211) gsm-ppp: PPP is shutdown
I (125211) netmanager: Set DNS#1 0.0.0.0
I (125221) netmanager: Set DNS#2 0.0.0.0
I (135211) cellular: State: Enter NetWait state
I (137211) gsm-ppp: StatusCallBack: User Interrupt
I (139211) cellular: State: Enter NetStart state
I (140271) cellular: PPP Connection is ready to start
I (141211) cellular: State: Enter NetMode state
I (141211) gsm-ppp: Initialising...
I (141321) cellular: PPP Connection disconnected
W (142211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (142211) cellular: State: Enter NetLoss state
I (142211) gsm-ppp: Shutting down (hard)...
I (142211) gsm-ppp: PPP is shutdown
I (142221) netmanager: Set DNS#1 0.0.0.0
I (142221) netmanager: Set DNS#2 0.0.0.0
I (152211) cellular: State: Enter NetWait state
I (154211) gsm-ppp: StatusCallBack: User Interrupt
I (156211) cellular: State: Enter NetStart state
I (157271) cellular: PPP Connection is ready to start
I (158211) cellular: State: Enter NetMode state
I (158211) gsm-ppp: Initialising...
I (158321) cellular: PPP Connection disconnected
W (159211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (159211) cellular: State: Enter NetLoss state
I (159211) gsm-ppp: Shutting down (hard)...
I (159211) gsm-ppp: PPP is shutdown
I (159221) netmanager: Set DNS#1 0.0.0.0
I (159221) netmanager: Set DNS#2 0.0.0.0
I (169211) cellular: State: Enter NetWait state
I (171211) gsm-ppp: StatusCallBack: User Interrupt
I (173211) cellular: State: Enter NetStart state
I (174271) cellular: PPP Connection is ready to start
I (175211) cellular: State: Enter NetMode state
I (175211) gsm-ppp: Initialising...
I (175321) cellular: PPP Connection disconnected
W (176211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (176211) cellular: State: Enter NetLoss state
I (176211) gsm-ppp: Shutting down (hard)...
I (176211) gsm-ppp: PPP is shutdown
I (176211) netmanager: Set DNS#1 0.0.0.0
I (176221) netmanager: Set DNS#2 0.0.0.0
I (186211) cellular: State: Enter NetWait state
I (188211) gsm-ppp: StatusCallBack: User Interrupt
I (190211) cellular: State: Enter NetStart state
I (191281) cellular: PPP Connection is ready to start
I (192211) cellular: State: Enter NetMode state
I (192211) gsm-ppp: Initialising...
I (192321) cellular: PPP Connection disconnected
W (193211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (193211) cellular: State: Enter NetLoss state
I (193211) gsm-ppp: Shutting down (hard)...
I (193211) gsm-ppp: PPP is shutdown
I (193221) netmanager: Set DNS#1 0.0.0.0
I (193221) netmanager: Set DNS#2 0.0.0.0
I (203211) cellular: State: Enter NetWait state
I (205211) gsm-ppp: StatusCallBack: User Interrupt
I (207211) cellular: State: Enter NetStart state
I (208271) cellular: PPP Connection is ready to start
I (209211) cellular: State: Enter NetMode state
I (209211) gsm-ppp: Initialising...
I (209321) cellular: PPP Connection disconnected
W (210211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (210211) cellular: State: Enter NetLoss state
I (210211) gsm-ppp: Shutting down (hard)...
I (210211) gsm-ppp: PPP is shutdown
I (210221) netmanager: Set DNS#1 0.0.0.0
I (210221) netmanager: Set DNS#2 0.0.0.0
I (220211) cellular: State: Enter NetWait state
I (222211) gsm-ppp: StatusCallBack: User Interrupt
I (224211) cellular: State: Enter NetStart state
I (225261) cellular: PPP Connection is ready to start
I (226211) cellular: State: Enter NetMode state
I (226211) gsm-ppp: Initialising...
I (226321) cellular: PPP Connection disconnected
W (227211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (227211) cellular: State: Enter NetLoss state
I (227211) gsm-ppp: Shutting down (hard)...
I (227211) gsm-ppp: PPP is shutdown
I (227221) netmanager: Set DNS#1 0.0.0.0
I (227221) netmanager: Set DNS#2 0.0.0.0
I (237211) cellular: State: Enter NetWait state
I (239211) gsm-ppp: StatusCallBack: User Interrupt
I (241211) cellular: State: Enter NetStart state
I (242261) cellular: PPP Connection is ready to start
I (243211) cellular: State: Enter NetMode state
I (243211) gsm-ppp: Initialising...
I (243331) cellular: PPP Connection disconnected
W (244211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (244211) cellular: State: Enter NetLoss state
I (244211) gsm-ppp: Shutting down (hard)...
I (244211) gsm-ppp: PPP is shutdown
I (244221) netmanager: Set DNS#1 0.0.0.0
I (244221) netmanager: Set DNS#2 0.0.0.0
I (254211) cellular: State: Enter NetWait state
I (256211) gsm-ppp: StatusCallBack: User Interrupt
I (258211) cellular: State: Enter NetStart state
I (259261) cellular: PPP Connection is ready to start
I (260211) cellular: State: Enter NetMode state
I (260211) gsm-ppp: Initialising...
I (260321) cellular: PPP Connection disconnected
W (261211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (261211) cellular: State: Enter NetLoss state
I (261211) gsm-ppp: Shutting down (hard)...
I (261211) gsm-ppp: PPP is shutdown
I (261221) netmanager: Set DNS#1 0.0.0.0
I (261221) netmanager: Set DNS#2 0.0.0.0
I (271211) cellular: State: Enter NetWait state
I (273211) gsm-ppp: StatusCallBack: User Interrupt
I (275211) cellular: State: Enter NetStart state
I (276281) cellular: PPP Connection is ready to start
I (277211) cellular: State: Enter NetMode state
I (277211) gsm-ppp: Initialising...
I (277321) cellular: PPP Connection disconnected
W (278211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (278211) cellular: State: Enter NetLoss state
I (278211) gsm-ppp: Shutting down (hard)...
I (278211) gsm-ppp: PPP is shutdown
I (278221) netmanager: Set DNS#1 0.0.0.0
I (278221) netmanager: Set DNS#2 0.0.0.0
I (288211) cellular: State: Enter NetWait state
I (290211) gsm-ppp: StatusCallBack: User Interrupt
I (292211) cellular: State: Enter NetStart state
I (293261) cellular: PPP Connection is ready to start
I (294211) cellular: State: Enter NetMode state
I (294211) gsm-ppp: Initialising...
I (294321) cellular: PPP Connection disconnected
W (295211) cellular: Lost network connection (+PPP disconnect in NetMode)
I (295211) cellular: State: Enter NetLoss state
I (295211) gsm-ppp: Shutting down (hard)...
OVMS# me li mdm
m.net.mdm.iccid                          894922
m.net.mdm.mode                           LTE,Online
m.net.mdm.model                          LE20B02SIM7600M11_OTA_210723
m.net.mdm.netreg                         RegisteredHome
m.net.mdm.network                        FONIC
m.net.mdm.sq                             -67dBm

@KommyKT

KommyKT commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

I have a same problem with another model

OVMS# me li mdm
m.net.mdm.iccid 8944502311176262645
m.net.mdm.mode LTE,Online
m.net.mdm.model LE20B03SIM7600M21-A_CUS_JT
m.net.mdm.netreg RegisteredRoaming
m.net.mdm.network
m.net.mdm.sq -67dBm

OVMS# cellular setstate NetLoss
Set modem to state: NetLoss
I (90771022) cellular: State: Enter NetLoss state
D (90771022) cellular: mux-tx #3: AT+CGATT=0
D (90771022) events: Signal(system.modem.netloss)
I (90771022) gsm-ppp: Shutting down (hard)...
I (90771032) gsm-ppp: StatusCallBack: User Interrupt
I (90771032) gsm-ppp: PPP is shutdown
D (90771782) events: Signal(system.modem.down)
I (90771782) netmanager: MODEM down (with WIFI client up): staying with WIFI client priority
D (90771782) netmanager: send cmd 3 from 0x0
D (90771782) netmanager: done cmd 3 from 0x0
D (90771822) events: Signal(network.modem.down)
D (90771822) events: Signal(network.interface.change)
D (90772082) netmanager: MongooseTask: got cmd 3 from 0x0
D (90772082) netmanager: CleanupConnections: conn 3f85463c -> iface st1
D (90772082) netmanager: CleanupConnections: conn 3f8e3b04 -> iface st1
D (90772092) netmanager: MongooseTask: done cmd 3 from 0x0
D (90780542) cellular: State timeout NetLoss => NetWait
I (90780542) cellular: State: Enter NetWait state
D (90780542) events: Signal(system.modem.netwait)
D (90782572) time: gsm-nmea (stratum 2 trusted 1) provides time Tue Sep 2 03:18:21 2025 (000000us) UTC
D (90784542) cellular: State transition NetWait => NetStart
I (90784542) cellular: State: Enter NetStart state
D (90784542) events: Signal(system.modem.netstart)
D (90785542) cellular: Netstart AT+CGDCONT=1,"IP","hologram";+CGDATA="PPP",1
D (90785582) cellular: mux-rx-line #2 (14/0): CONNECT 115200
I (90785582) cellular: PPP Connection is ready to start
D (90786542) cellular: State transition NetStart => NetMode
I (90786542) cellular: State: Enter NetMode state
I (90786542) gsm-ppp: Initialising...
D (90786542) events: Signal(system.modem.netmode)
D (90786622) cellular: mux-rx-line #3 (10/0): NO CARRIER
D (90786622) cellular: mux-rx-line #3 (19/0): +PPPD: DISCONNECTED
I (90786622) cellular: PPP Connection disconnected
D (90787192) cellular: mux-rx-line #3 (11/0): +CSQ: 99,99
D (90787192) cellular: Signal Quality is: 99 (0 dBm)
D (90787192) cellular: mux-rx-line #3 (8/13): +CREG: 0
D (90787192) cellular: mux-rx-line #3 (9/0): +CGREG: 0
W (90787542) cellular: Lost network connection (+PPP disconnect in NetMode)
D (90787542) cellular: State transition NetMode => NetLoss
I (90787542) cellular: State: Enter NetLoss state
D (90787542) cellular: mux-tx #3: AT+CGATT=0
D (90787542) events: Signal(system.modem.netloss)
I (90787542) gsm-ppp: Shutting down (hard)...
I (90787542) gsm-ppp: PPP is shutdown
D (90787542) events: Signal(system.modem.down)
D (90787542) netmanager: send cmd 3 from 0x0
D (90787542) netmanager: done cmd 3 from 0x0
D (90787862) netmanager: MongooseTask: got cmd 3 from 0x0
D (90787862) netmanager: CleanupConnections: conn 3f85463c -> iface st1
D (90787862) netmanager: CleanupConnections: conn 3f8e3b04 -> iface st1
D (90787862) netmanager: MongooseTask: done cmd 3 from 0x0
D (90797542) cellular: State timeout NetLoss => NetWait
I (90797542) cellular: State: Enter NetWait state
D (90797542) events: Signal(system.modem.netwait)
D (90797572) time: gsm-nmea (stratum 2 trusted 1) provides time Tue Sep 2 03:18:36 2025 (000000us) UTC
I (90799542) gsm-ppp: StatusCallBack: User Interrupt
D (90801542) cellular: State transition NetWait => NetStart
I (90801542) cellular: State: Enter NetStart state
D (90801542) events: Signal(system.modem.netstart)
D (90802542) cellular: Netstart AT+CGDCONT=1,"IP","hologram";+CGDATA="PPP",1
D (90802582) time: gsm-nmea (stratum 2 trusted 1) provides time Tue Sep 2 03:18:41 2025 (000000us) UTC
D (90802592) cellular: mux-rx-line #2 (14/0): CONNECT 115200
I (90802592) cellular: PPP Connection is ready to start
D (90803542) cellular: State transition NetStart => NetMode
I (90803542) cellular: State: Enter NetMode state
I (90803542) gsm-ppp: Initialising...
D (90803542) events: Signal(system.modem.netmode)
D (90803622) cellular: mux-rx-line #3 (10/0): NO CARRIER
D (90803622) cellular: mux-rx-line #3 (19/0): +PPPD: DISCONNECTED
I (90803622) cellular: PPP Connection disconnected
W (90804542) cellular: Lost network connection (+PPP disconnect in NetMode)
D (90804542) cellular: State transition NetMode => NetLoss
I (90804542) cellular: State: Enter NetLoss state
D (90804542) cellular: mux-tx #3: AT+CGATT=0
D (90804542) events: Signal(system.modem.netloss)
I (90804542) gsm-ppp: Shutting down (hard)...
I (90804542) gsm-ppp: PPP is shutdown
D (90804542) events: Signal(system.modem.down)
D (90804542) netmanager: send cmd 3 from 0x0
D (90804542) netmanager: done cmd 3 from 0x0
D (90804982) netmanager: MongooseTask: got cmd 3 from 0x0
D (90804982) netmanager: CleanupConnections: conn 3f85463c -> iface st1
D (90804982) netmanager: CleanupConnections: conn 3f8e3b04 -> iface st1
D (90804982) netmanager: MongooseTask: done cmd 3 from 0x0
D (90814542) cellular: State timeout NetLoss => NetWait
I (90814542) cellular: State: Enter NetWait state
D (90814542) events: Signal(system.modem.netwait)
I (90816542) gsm-ppp: StatusCallBack: User Interrupt
D (90817572) time: gsm-nmea (stratum 2 trusted 1) provides time Tue Sep 2 03:18:56 2025 (000000us) UTC

OVMS# cellular setstate PowerOffOn
Set modem to state: PowerOffOn
I (91134762) cellular: State: Enter PowerOffOn state
I (91134772) gsm-ppp: Shutting down (hard)...
I (91134772) gsm-ppp: PPP is shutdown
D (91134772) cellular: mux-tx #1: AT+CGPSNMEA=0
D (91134772) events: Signal(system.modem.down)
D (91134772) netmanager: send cmd 3 from 0x0
D (91134772) netmanager: done cmd 3 from 0x0
D (91134792) cellular: mux-tx #1: AT+CGPSINFOCFG=0
D (91134892) cellular: mux-tx #1: AT+CGPS=0
I (91134892) gsm-nmea: Shutdown (direct)
I (91134892) gsm-mux: Stop MUX
D (91134892) events: Signal(system.modem.gpsstop)
I (91134892) cellular: GPS stopped by GPS pause system, restarting in 0 minutes
I (91134892) Simcom: Power Cycle - T_off 3000 ms - T_on 500 ms
D (91134892) max7317: egpio.output.0.high
D (91134892) events: Signal(system.modem.stop)
D (91134892) netmanager: send cmd 3 from 0x0
D (91134892) netmanager: done cmd 3 from 0x0
D (91134892) events: Signal(egpio.output.0.high)
D (91135202) netmanager: MongooseTask: got cmd 3 from 0x0
D (91135202) netmanager: CleanupConnections: conn 3f85463c -> iface st1
D (91135202) netmanager: CleanupConnections: conn 3f8e3b04 -> iface st1
D (91135212) netmanager: MongooseTask: done cmd 3 from 0x0
D (91135212) netmanager: MongooseTask: got cmd 3 from 0x0
D (91135222) netmanager: CleanupConnections: conn 3f85463c -> iface st1
D (91135232) netmanager: CleanupConnections: conn 3f8e3b04 -> iface st1
D (91135232) netmanager: MongooseTask: done cmd 3 from 0x0
D (91137892) max7317: egpio.output.0.low
D (91137892) events: Signal(egpio.output.0.low)
I (91139592) gsm-ppp: StatusCallBack: User Interrupt
D (91142892) max7317: egpio.output.0.high
D (91142892) events: Signal(egpio.output.0.high)
D (91143392) max7317: egpio.output.0.low
D (91143392) events: Signal(egpio.output.0.low)
D (91143692) cellular: State timeout PowerOffOn => PoweringOn
I (91143692) cellular: State: Enter PoweringOn state
D (91143692) cellular: Remove old 'SIM7600' modem driver
I (91143692) cellular: Set modem driver to 'auto'
I (91143692) cellular-modem-auto: Power Cycle
D (91143692) events: Signal(system.modem.poweringon)
I (91143692) Simcom: Power Cycle - T_off 2500 ms - T_on 200 ms
D (91143692) max7317: egpio.output.0.high
D (91143692) events: Signal(egpio.output.0.high)
D (91146192) max7317: egpio.output.0.low
D (91146192) events: Signal(egpio.output.0.low)
D (91151192) max7317: egpio.output.0.high
D (91151192) events: Signal(egpio.output.0.high)
D (91151392) max7317: egpio.output.0.low
D (91151392) cellular: tx-cmd: AT
D (91151392) events: Signal(egpio.output.0.low)
D (91151392) cellular: tx-cmd: AT
D (91151392) cellular: tx-cmd: AT
D (91151392) cellular: tx-cmd: AT
D (91152542) cellular: tx-cmd: AT
D (91155542) cellular: tx-cmd: AT
D (91158542) cellular: tx-cmd: AT
D (91161542) cellular: tx-cmd: AT
D (91164542) cellular: tx-cmd: AT
D (91167542) cellular: tx-cmd: AT
D (91167542) cellular: State timeout PoweringOn => PoweringOn
I (91167542) cellular: State: Enter PoweringOn state
I (91167542) cellular-modem-auto: Power Cycle
D (91167542) events: Signal(system.modem.poweringon)
I (91167542) Simcom: Power Cycle - T_off 2500 ms - T_on 200 ms
D (91167542) max7317: egpio.output.0.high
D (91167542) events: Signal(egpio.output.0.high)
D (91170042) max7317: egpio.output.0.low
D (91170042) events: Signal(egpio.output.0.low)
D (91175042) max7317: egpio.output.0.high
D (91175042) events: Signal(egpio.output.0.high)
D (91175242) max7317: egpio.output.0.low
D (91175242) cellular: tx-cmd: AT
D (91175242) events: Signal(egpio.output.0.low)
D (91175242) cellular: tx-cmd: AT
D (91176542) cellular: tx-cmd: AT
D (91179542) cellular: tx-cmd: AT
I (91181412) cellular: State: Enter Identify state
D (91181542) cellular: tx-cmd: AT+CGMM
I (91181552) cellular: Identified cellular modem: SIM7600/Experimental support for SIMCOM SIM7600
D (91181552) cellular: Remove old 'auto' modem driver
I (91181552) cellular: Set modem driver to 'SIM7600'
I (91181552) cellular: State: Enter PoweredOn state
D (91181552) events: Signal(system.modem.installed)
D (91181552) events: Signal(system.modem.poweredon)
D (91181842) cellular: mux-rx-line #0 (2/16): OK
D (91181842) cellular: mux-rx-line #0 (12/0): +CPIN: READY
D (91182022) cellular: mux-rx-line #0 (8/0): SMS DONE
D (91182262) cellular: mux-rx-line #0 (7/0): PB DONE
D (91190752) ovms-duktape: Duktape: Compacting DukTape memory done in 60 ms
D (91191542) cellular: tx-cmd: AT+CPIN?;+CREG=1;+CGREG=1;+CEREG=1;+CTZU=1;+CTZR=1;+CLIP=1;+CMGF=1;+CNMI=1,2,0,0,0;+CSDH=1;+CMEE=2;+CSQ;+AUTOCSQ=1,1;E0;S0=0
D (91191602) cellular: mux-rx-line #0 (11/21): CPIN: READY
D (91191602) cellular: mux-rx-line #0 (11/6): +CSQ: 24,99
D (91191612) cellular: Signal Quality is: 24 (-65 dBm)
D (91191612) cellular: mux-rx-line #0 (2/0): OK
D (91191612) cellular: mux-rx-line #0 (90/37): ;+CTZU=1;+CTZR=1;+CLIP=1;+CMGF=1;+CNMI=1,2,0,0,0;+CSDH=1;+CMEE=2;+CSQ;+AUTOCSQ=1,1;E0;S0=0
D (91191612) cellular: mux-rx-line #0 (12/21): +CPIN: READY
D (91191612) cellular: mux-rx-line #0 (11/6): +CSQ: 24,99
D (91191612) cellular: mux-rx-line #0 (2/0): OK
W (91191732) cellular: UART hw fifo overflow
D (91193542) cellular: tx-cmd: AT+CGMR;+ICCID
D (91193552) cellular: mux-rx-line #0 (33/37): +CGMR: LE20B03SIM7600M21-A_CUS_JT
D (91193552) cellular: mux-rx-line #0 (27/6): +ICCID: 8944502311176262645
D (91193552) cellular: mux-rx-line #0 (2/0): OK
D (91201542) cellular: tx-cmd: AT+CMUX=0;+CATR=6
D (91201542) cellular: mux-rx-line #0 (2/0): OK
I (91201542) cellular: State: Enter MuxStart state
I (91201542) gsm-mux: Start MUX
D (91201542) events: Signal(system.modem.muxstart)
I (91201552) gsm-mux: Channel #0 is open
I (91201552) gsm-mux: Channel #1 is open
I (91201562) gsm-mux: Channel #2 is open
I (91201562) gsm-mux: Channel #3 is open
I (91201562) gsm-mux: Channel #4 is open
D (91202542) cellular: State transition MuxStart => NetWait
I (91202542) cellular: State: Enter NetWait state
I (91202542) gsm-nmea: Startup
D (91202542) events: Signal(system.modem.netwait)
D (91202542) cellular: mux-tx #1: AT+CGPS=0
D (91204542) cellular: mux-tx #1: AT+CGPSNMEA=258
D (91204562) cellular: mux-tx #1: AT+CGPSINFOCFG=5,258
D (91204582) cellular: mux-tx #1: AT+CGPS=1,1
D (91204582) cellular: mux-rx-line #1 (2/0): OK
D (91204582) events: Signal(system.modem.gpsstart)
D (91204582) cellular: mux-rx-line #1 (2/0): OK
D (91204582) cellular: mux-rx-line #1 (2/0): OK
D (91204582) cellular: mux-rx-line #1 (2/0): OK
D (91209572) time: gsm-nmea (stratum 2 trusted 1) provides time Tue Sep 2 03:25:28 2025 (000000us) UTC
D (91212542) cellular: mux-tx #3: AT+CREG?;+CGREG?;+CEREG?;+CCLK?;+CSQ
D (91212562) cellular: mux-rx-line #3 (10/84): +CREG: 1,5
I (91212562) cellular: Network Registration status: RegisteredRoaming
D (91212562) cellular: mux-rx-line #3 (11/69): +CGREG: 1,5
D (91212562) cellular: mux-rx-line #3 (11/54): +CEREG: 1,5
D (91212562) cellular: mux-rx-line #3 (29/21): +CCLK: "25/09/02,05:25:32+08"
D (91212562) cellular: mux-rx-line #3 (11/6): +CSQ: 24,99
D (91212562) cellular: mux-rx-line #3 (2/0): OK
D (91213542) cellular: mux-tx #3: AT+CPSI?
D (91213542) cellular: State transition NetWait => NetStart
I (91213542) cellular: State: Enter NetStart state
D (91213542) events: Signal(system.modem.netstart)
D (91213552) cellular: mux-rx-line #3 (82/0): +CPSI: LTE,Online,216-70,0x0C8F,820994,299,EUTRAN-BAND20,6200,3,3,-129,-945,-645,9
D (91213552) cellular: mux-rx-line #3 (2/0): OK
D (91214542) cellular: Netstart AT+CGDCONT=1,"IP","hologram";+CGDATA="PPP",1
D (91214582) time: gsm-nmea (stratum 2 trusted 1) provides time Tue Sep 2 03:25:33 2025 (000000us) UTC
D (91214592) cellular: mux-rx-line #2 (14/0): CONNECT 115200
I (91214592) cellular: PPP Connection is ready to start
D (91215542) cellular: State transition NetStart => NetMode
I (91215542) cellular: State: Enter NetMode state
I (91215542) gsm-ppp: Initialising...
D (91215542) events: Signal(system.modem.netmode)
I (91215632) gsm-ppp: StatusCallBack: None
I (91215632) gsm-ppp: status_cb: Connected
I (91215632) gsm-ppp: our_ipaddr = 10.52.104.249
I (91215632) gsm-ppp: his_ipaddr = 10.64.64.64
I (91215632) gsm-ppp: netmask = 255.255.255.255
I (91215632) gsm-ppp: DNS#0 = 8.8.8.8
I (91215632) gsm-ppp: DNS#1 = 8.8.4.4
I (91215642) gsm-ppp: our6_ipaddr = ::
D (91215642) events: Signal(network.interface.up)
D (91215642) events: Signal(system.modem.gotip)
D (91215642) netmanager: Saved DNS#0 8.8.8.8
D (91215642) netmanager: Saved DNS#1 8.8.4.4
D (91215642) netmanager: Saved DNS#2 0.0.0.0
I (91215642) netmanager: MODEM up (with WIFI client up): staying with WIFI client priority
D (91215642) events: Signal(network.modem.up)
D (91215642) events: Signal(network.interface.change)
D (91219572) time: gsm-nmea (stratum 2 trusted 1) provides time Tu

@dexterbg

dexterbg commented Sep 2, 2025

Copy link
Copy Markdown
Member

Thanks for the cellular rx info, Tamas. This looks like your modems completely shut down their mobile network in that case, and fail to restart it. That really looks like a modem firmware bug.

@dexterbg dexterbg merged commit ffe6ae5 into openvehicles:master Sep 2, 2025
@zorgms

zorgms commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

In some tests and feedback from the community, this fix leads sometime to a crash. However, if the modem is restarted directly without first terminating the data stream, it doesn't crash. I would currently prefer this solution. I wanted to limit the direct restart to my modem type, but apparently all SIM7600 in the model name are called SIM7600M. I don't know.

edit: idea rejected

There is no better solution here.

@zorgms

zorgms commented Sep 4, 2025

Copy link
Copy Markdown
Contributor Author

New idea:

I activated the data connection in Netwait, which allows the modem to reconnect very quickly.

    case NetWait:
      MyEvents.SignalEvent("system.modem.netwait", NULL);
      muxtx(m_mux_channel_POLL, "AT+CGATT=1\r\n");
      if (GPS_SHALL_START())
        StartNMEA();
      break;

I (705866) cellular: State: Enter NetLoss state
I (705866) cellular: NetLoss: PPP connected - detaching PDP and stopping PPP
OVMS# cellular setstate NetLoss
Set modem to state: NetLoss

D (705866) events: Signal(system.modem.netloss)
D (705866) cellular: mux-tx #3: AT+CGATT=0
I (705866) gsm-ppp: Shutting down (hard)...
I (705876) gsm-ppp: StatusCallBack: User Interrupt
I (705876) gsm-ppp: PPP is shutdown
D (705876) events: Signal(system.modem.down)
I (705876) netmanager: Set DNS#1 0.0.0.0
I (705876) netmanager: Set DNS#2 0.0.0.0
I (705876) netmanager: MODEM down (with WIFI client up): staying with WIFI client priority
D (705876) netmanager: send cmd 3 from 0x0
D (705876) netmanager: done cmd 3 from 0x0
D (705876) events: Signal(network.modem.down)
D (705876) events: Signal(network.interface.change)
D (705886) netmanager: MongooseTask: got cmd 3 from 0x0
D (705906) netmanager: CleanupConnections: conn 3f8e89a8 -> iface st1
D (705916) netmanager: CleanupConnections: conn 3f8e9e9c -> iface st1
D (705916) netmanager: CleanupConnections: conn 3f8dd494 -> iface st1
D (705916) netmanager: MongooseTask: done cmd 3 from 0x0
D (715256) cellular: State timeout NetLoss => NetWait
I (715256) cellular: State: Enter NetWait state
D (715256) cellular: mux-tx #3: AT+CGATT=1
I (715256) gsm-nmea: Startup
D (715256) cellular: mux-tx #1: AT+CGPS=0
D (715256) events: Signal(system.modem.netwait)
D (717256) cellular: mux-tx #1: AT+CGPSNMEA=258
D (717276) cellular: mux-tx #1: AT+CGPSINFOCFG=5,258
D (717296) cellular: mux-tx #1: AT+CGPS=1,1
D (717296) events: Signal(system.modem.gpsstart)
D (717296) cellular: mux-rx-line #1 (2/0): OK
D (717296) cellular: mux-rx-line #3 (2/0): OK
D (717296) cellular: mux-rx-line #3 (9/13): +CGREG: 1
D (717296) cellular: mux-rx-line #3 (9/0): +CEREG: 1
D (717296) cellular: mux-rx-line #1 (2/0): OK
D (717296) cellular: mux-rx-line #1 (2/0): OK
D (717296) time: gsm-nmea (stratum 2 trusted 1) provides time Thu Sep  4 17:19:10 2025 (000000us) UTC
D (717306) events: Signal(gps.sq.good)
D (717306) events: Signal(gps.lock.acquired)
D (717306) cellular: mux-rx-line #1 (2/0): OK
D (717316) events: Signal(system.modem.gotgps)
D (719256) cellular: State transition NetWait => NetStart
I (719256) cellular: State: Enter NetStart state
D (719256) events: Signal(system.modem.netstart)
D (720256) cellular: Netstart AT+CGDCONT=1,"IP","pinternet.interkom.de";+CGDATA="PPP",1
D (720326) cellular: mux-rx-line #2 (14/0): CONNECT 115200
I (720326) cellular: PPP Connection is ready to start
D (721256) cellular: State transition NetStart => NetMode
I (721256) cellular: State: Enter NetMode state
I (721256) gsm-ppp: Initialising...
D (721256) events: Signal(system.modem.netmode)
I (721396) gsm-ppp: StatusCallBack: None
I (721396) gsm-ppp: status_cb: Connected
I (721396) gsm-ppp:    our_ipaddr  = 10.170.35.101
I (721396) gsm-ppp:    his_ipaddr  = 10.64.64.64
I (721396) gsm-ppp:    netmask     = 255.255.255.255
I (721396) gsm-ppp:    DNS#0       = 62.109.121.17
I (721396) gsm-ppp:    DNS#1       = 62.109.121.18
I (721396) gsm-ppp:    our6_ipaddr = ::
D (721396) events: Signal(network.interface.up)
D (721396) events: Signal(system.modem.gotip)
D (721396) netmanager: Saved DNS#0 62.109.121.17
D (721396) netmanager: Saved DNS#1 62.109.121.18
D (721396) netmanager: Saved DNS#2 0.0.0.0
I (721406) netmanager: Set DNS#1 0.0.0.0
I (721406) netmanager: Set DNS#2 0.0.0.0
I (721406) netmanager: MODEM up (with WIFI client up): staying with WIFI client priority
D (721406) events: Signal(network.modem.up)
D (721406) events: Signal(network.interface.change)
D (722296) time: gsm-nmea (stratum 2 trusted 1) provides time Thu Sep  4 17:20:08 2025 (000000us) UTC
D (723316) ovms-duktape: Duktape: Compacting DukTape memory done in 50 ms
D (727296) time: gsm-nmea (stratum 2 trusted 1) provides time Thu Sep  4 17:20:13 2025 (000000us) UTC

zorgms added a commit to zorgms/OVMS-Firmware-EDGE that referenced this pull request Sep 4, 2025
The fix in openvehicles#1189 sometimes causes the module to crash. This extended fix works perfectly on my modem.

openvehicles#1191
@zorgms zorgms mentioned this pull request Sep 4, 2025
ramack pushed a commit to ramack/Open-Vehicle-Monitoring-System-3 that referenced this pull request Nov 29, 2025
The fix in openvehicles#1189 sometimes causes the module to crash. This extended fix works perfectly on my modem.

openvehicles#1191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants