<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I've begun working on the webserver and noticed something that may
be correlated to this: sockets don't get closed when losing the
connection. The effect is visible on both web and telnet server (ssh
not tested). To reproduce, switch the Wifi network with an open
connection, the port will not be available until timeout.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<div class="moz-cite-prefix">Am 28.01.2018 um 03:32 schrieb Tom
Parker:<br>
</div>
<blockquote type="cite"
cite="mid:d897f2c0-25f1-e085-9ff3-0a72d5374501@carrott.org">Hi,
<br>
<br>
I've been struggling for some time with intermittent
disconnections from the v2 server. I've switched from hologram to
a local cellular provider's sim card, to match my v2 hardware
which is very stable and the problem persists. With the car
stationary, the connection seems very solid, but on the move, it
usually disconnects within half an hour.
<br>
<br>
I'm running 98169d8862db2bbc4bea14d013883f26ee6afb4e (from
2018-01-19) with idf 5bf85d06d8c402fe30ecb1bf9c09d5e69b923b2f and
xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz.
<br>
<br>
I tried logging to the sdcard and on my desk powered by USB that
seemed to work well, but it didn't work very well (only a few
lines logged to the sdcard and then the whole system seemed to
crash) when powered from the OBD2 port. I haven't tried to debug
that.
<br>
<br>
With the sdcard logging turned off, and logging with minicom I can
get good diagnostics. It would appear that the v3 hardware thinks
it is still connected and continues to send data, but the v2
server thinks the client has disconnected.
<br>
<br>
I've got ovms logs which have regular lines quoting the local time
from the modem, and server logs from the dexters-web server which
I think are not UTC. Anyway, 05:47 in the server log corresponds
to 17:47 in the ovms v3 log.
<br>
<br>
The relevant lines of the logs are below. On the server log the
ovms v3 hardware client is #72 and then #94. We can see the client
sent and the server received S messages at :47:15 and :47:32. The
client sent more messages that were not received by the server,
more than I've transcribed here (full log attached). The server
recorded a disconnect at :48:29, but the client recorded the
transmission of messages in it's log for minutes after that. I did
a simcom status command which reports that everything is
connected, and then I pressed the button to reboot the module. The
server records a new connection at :54:07 and the messages logged
as transmitted on the client start to correspond with the messages
logged as received on the server start again.
<br>
<br>
Thoughts on how to proceed?
<br>
<br>
Another oddity not shown here but included in the full logs is
that the client sent a lot of D messages shortly after
reconnecting.
<br>
<br>
Server Log:
<br>
<br>
2018-01-26 05:47:15,36664,'#72 C rx msg S
90,K,0,0,stopped,standard,76,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,392.00,96'<br>
2018-01-26 05:47:15,36665,'#72 C rx msg D
128,0,5,0,0,33,0,0,0,79663,32,1,1,1,12.9231,0,0,128,0,0'
<br>
2018-01-26 05:47:15,36666,'#72 C rx msg L 0,0,0,0,0,0,0,0,0,0,0'
<br>
2018-01-26 05:47:15,36667,'#72 C rx msg F 3.0.0/factory/main build
(idf v3.1-dev-217-g5bf85d0) Jan 20 2018 00:49:15,,6,1,NL,2degrees'
<br>
2018-01-26 05:47:32,36717,'#72 C rx msg S
90,K,0,0,stopped,standard,76,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,387.00,96'<br>
2018-01-26 05:48:29,36926,'#72 C got error: Connection reset by
peer'
<br>
2018-01-26 05:50:08,37206,'#93 A got login'
<br>
2018-01-26 05:51:24,37485,'#36 A rx msg A '
<br>
2018-01-26 05:52:53,37742,'#93 A got error: Broken pipe'
<br>
2018-01-26 05:52:54,37745,'#72 A got login'
<br>
2018-01-26 05:54:07,37937,'#94 C got login'
<br>
2018-01-26 05:54:13,37957,'#94 C rx msg S
87,K,0,0,stopped,standard,73,0,0,0,0,0,13,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,385.50,0'<br>
2018-01-26 05:54:13,37958,'#94 C rx msg D
128,0,5,0,0,33,0,0,104,59,28,1,0,0,13.011,0,0,128,0,0'
<br>
2018-01-26 05:54:13,37959,'#94 C rx msg L 0,0,0,0,0,0,104,0,0,0,0'
<br>
2018-01-26 05:54:13,37960,'#94 C rx msg W 0,0,0,0,0,0,0,0,0'
<br>
2018-01-26 05:54:13,37961,'#94 C rx msg F 3.0.0/factory/main build
(idf v3.1-dev-217-g5bf85d0) Jan 20 2018 00:49:15,,1,1,NL,2degrees'
<br>
2018-01-26 05:54:15,37964,'#94 C rx msg D
128,0,5,0,0,33,0,0,104,60,28,1,0,0,13.011,0,0,128,0,0'
<br>
2018-01-26 05:54:15,37965,'#94 C rx msg D
128,0,5,0,0,33,0,0,104,61,28,1,0,0,13.011,0,0,128,0,0'
<br>
<br>
Serial Console Log:
<br>
<br>
OVMS > I (79663340) ovms-server-v2: Send MP-0
S90,K,0,0,stopped,standard,76,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,392.00,96<br>
I (79663340) ovms-server-v2: Send MP-0
D128,0,5,0,0,33,0,0,0,79663,32,1,1,1,12.9231,0,0,128,0,0
<br>
I (79663340) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,0,0,0,0,0
<br>
I (79663350) ovms-server-v2: Send MP-0 F3.0.0/factory/main build
(idf v3.1-dev-217-g5bf85d0) Jan 20 2018 00:49:15,,6,1,NL,2degrees
<br>
OVMS > D (79665360) simcom: rx line ch=3 len=11 : +CSQ: 10,99
<br>
D (79665360) simcom: rx line ch=4 len=11 : +CSQ: 10,99
<br>
OVMS > D (79674380) simcom: rx line ch=3 len=11 : +CSQ: 13,99
<br>
D (79674390) simcom: rx line ch=4 len=11 : +CSQ: 13,99
<br>
OVMS > D (79678420) simcom: rx line ch=3 len=10 : +CREG: 1,1
<br>
D (79678420) simcom: rx line ch=3 len=29 : +CCLK:
"18/01/26,17:47:26+52"
<br>
D (79678420) simcom: rx line ch=3 len=11 : +CSQ: 13,99
<br>
D (79678420) simcom: rx line ch=3 len=23 : +COPS:
0,0,"2degrees",2
<br>
D (79678420) simcom: rx line ch=3 len=2 : OK
<br>
OVMS > I (79681340) ovms-server-v2: Send MP-0
S90,K,0,0,stopped,standard,76,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,387.00,96<br>
OVMS > D (79683370) simcom: rx line ch=3 len=10 : +CSQ: 9,99
<br>
D (79683370) simcom: rx line ch=4 len=10 : +CSQ: 9,99
<br>
OVMS > D (79692410) simcom: rx line ch=3 len=10 : +CSQ: 3,99
<br>
D (79692420) simcom: rx line ch=4 len=10 : +CSQ: 3,99
<br>
OVMS > D (79708420) simcom: rx line ch=3 len=10 : +CREG: 1,1
<br>
D (79708420) simcom: rx line ch=3 len=29 : +CCLK:
"18/01/26,17:47:56+52"
<br>
D (79708420) simcom: rx line ch=3 len=10 : +CSQ: 3,99
<br>
D (79708420) simcom: rx line ch=3 len=23 : +COPS:
0,0,"2degrees",2
<br>
D (79708420) simcom: rx line ch=3 len=2 : OK
<br>
OVMS > D (79713470) simcom: rx line ch=3 len=10 : +CSQ: 7,99
<br>
D (79713470) simcom: rx line ch=4 len=10 : +CSQ: 7,99
<br>
OVMS > D (79716420) simcom: rx line ch=3 len=10 : +CSQ: 0,99
<br>
D (79716420) simcom: rx line ch=4 len=10 : +CSQ: 0,99
<br>
OVMS > I (79724340) ovms-server-v2: Send MP-0
S90,K,0,0,stopped,standard,76,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,392.00,96<br>
I (79724340) ovms-server-v2: Send MP-0
D128,0,5,0,0,33,0,0,55,79724,30,1,1,1,13.022,0,0,128,0,0
<br>
I (79724350) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,55,0,0,0,0
<br>
I (79724350) ovms-server-v2: Send MP-0 F3.0.0/factory/main build
(idf v3.1-dev-217-g5bf85d0) Jan 20 2018 00:49:15,,0,1,NL,2degrees
<br>
OVMS > D (79738360) simcom: rx line ch=3 len=10 : +CREG: 1,1
<br>
D (79738360) simcom: rx line ch=3 len=29 : +CCLK:
"18/01/26,17:48:26+52"
<br>
D (79738360) simcom: rx line ch=3 len=10 : +CSQ: 0,99
<br>
D (79738360) simcom: rx line ch=3 len=23 : +COPS:
0,0,"2degrees",2
<br>
D (79738360) simcom: rx line ch=3 len=2 : OK
<br>
OVMS > D (79740490) simcom: rx line ch=3 len=10 : +CSQ: 4,99
<br>
D (79740500) simcom: rx line ch=4 len=10 : +CSQ: 4,99
<br>
OVMS > I (79741340) ovms-server-v2: Send MP-0
S90,K,0,0,stopped,standard,76,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,388.50,96<br>
OVMS > D (79764490) simcom: rx line ch=3 len=10 : +CSQ: 7,99
<br>
D (79764490) simcom: rx line ch=4 len=10 : +CSQ: 7,99
<br>
OVMS > D (79768360) simcom: rx line ch=3 len=10 : +CREG: 1,1
<br>
D (79768360) simcom: rx line ch=3 len=29 : +CCLK:
"18/01/26,17:48:56+52"
<br>
D (79768360) simcom: rx line ch=3 len=10 : +CSQ: 7,99
<br>
D (79768360) simcom: rx line ch=3 len=23 : +COPS:
0,0,"2degrees",2
<br>
D (79768360) simcom: rx line ch=3 len=2 : OK
<br>
OVMS > D (79773490) simcom: rx line ch=3 len=10 : +CSQ: 3,99
<br>
D (79773500) simcom: rx line ch=4 len=10 : +CSQ: 3,99
<br>
OVMS > D (79779500) simcom: rx line ch=3 len=10 : +CSQ: 7,99
<br>
D (79779500) simcom: rx line ch=4 len=10 : +CSQ: 7,99
<br>
OVMS > I (79785340) ovms-server-v2: Send MP-0
S89,K,0,0,stopped,standard,75,0,0,0,0,0,13,21,0,0,0,0,63.36,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,378.00,96<br>
...
<br>
OVMS > simcom status
<br>
SIMCOM
<br>
Network Registration: RegisteredHome
<br>
State: NetMode
<br>
Ticker: 25111
<br>
User Data: 0
<br>
Mux Open Channels: 4
<br>
PPP Connected on channel: #2
<br>
PPP Last Error: None
<br>
GPS: disabled
<br>
GPS time: disabled
<br>
NMEA (GPS/GLONASS) Not Connected
<br>
...
<br>
I rebooted the module and it did the normal connection dance
<br>
...
<br>
D (48359) simcom: rx line ch=3 len=29 : +CCLK:
"18/01/26,17:53:57+52"
<br>
...
<br>
I (57609) ovms-server-v2: Status: Connecting...
<br>
OVMS > I (58219) ovms-server-v2: Connection successful
<br>
I (58219) ovms-server-v2: Status: Logging in...
<br>
I (58219) ovms-server-v2: Sending server login: MP-C 0
pwLSijW/3qAZ6z0LOBHbGS rnkkhqHUA6zeZqLx1q1Tow== NZLV3
<br>
OVMS > I (58889) ovms-server-v2: Got server response: MP-S 0
QTjRAp8ZQPJQV1UXnepldQ w1vWpIrRR9+eot9z3uslgw==
<br>
I (58889) ovms-server-v2: Server token is QTjRAp8ZQPJQV1UXnepldQ
and digest is w1vWpIrRR9+eot9z3uslgw==
<br>
I (58899) ovms-server-v2: Status: Server auth ok. Now priming
crypto.
<br>
I (58899) ovms-server-v2: Shared secret key is
QTjRAp8ZQPJQV1UXnepldQpwLSijW/3qAZ6z0LOBHbGS (44 bytes)
<br>
I (58899) ovms-server-v2: Status: OVMS V2 login successful, and
crypto channel established
<br>
OVMS > I (59189) ovms-server-v2: Incoming Msg: MP-0 Z4
<br>
I (59189) ovms-server-v2: One or more peers have connected
<br>
I (59339) ovms-server-v2: Send MP-0
S87,K,0,0,stopped,standard,73,0,0,0,0,0,13,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,385.50,0<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="160">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>