[Ovmsdev] Poor wifi performance

Stephen Casner casner at acm.org
Sun Jul 29 04:03:57 HKT 2018


Back to the original topic...

I have not driven my car for several days, so I have not been paying
attention to OVMS.  As I was about to connect the charge cable last
evening to charge for driving today I found that OVMS had not made
contact with the v2 server for four days.  This morning I connected
the USB cable to find again that server v2 connection attempts were
again in a failure loop with the message:

mg_connect(api.openvehicles.com:6867) failed: cannot parse address

That may not be a bug in Mongoose itself, rather a problem induced by
running out of some resource.  The think that resource loss occurs
when there are repeated connection attempts that fail.  So, the first
stage of this loss of server v2 connectivity is expressed as repeated
connection attempts that fail, consuming the resource, then the second
phase is expressed with this mg_connect failure so that the connection
is not even attempted.

As before, I found that since the client wifi was associated with the
home AP and had an address (and was pingable!), the OVMS network
routing preferred the wifi and did not try to use the modem.  I still
think it would be a good idea for the network routing algorithm to be
enhanced to back off to use the modem if some number of attempts to
connect to the server over wifi have failed.

Again I was able to restore operation of both server v2 and http by
"wifi mode off" then "wifi mode client".  This is shown in the log
below including "module memory" and "module tasks".  The module status
is:

Last boot was 883596 second(s) ago
Time at boot: 2018-07-18 11:26:55 GMT
This is reset #6 since last power cycle
Detected boot reason: Crash (12/12)
Crash counters: 1 total, 0 early

Last crash: Alloca exception on core 0
Registers:
PC : 0x40081b9c PS : 0x00060434 A0 : 0x80081d61 A1 : 0x3ffafa60 A2 :
0x00000000 A3 : 0x00000001 A4 : 0x00000050 A5 : 0x00000001 A6 :
0x000000fe A7 : 0x000000a0 A8 : 0x00000081 A9 : 0x00000001 A10 :
0x0000cdcd A11 : 0x00000000 A12 : 0x3f40819c A13 : 0x3f407ebe A14 :
0x000000c8 A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000 LBEG : 0x40097664 LEND : 0x40097692 LCOUNT :
0xffffffff
Backtrace:
0x40081b9c 0x40081d5e 0x400db815 0x401e59a9 0x401e9fcb 0x401e5f31
0x40207f01 0x40208d00 0x40208d1f 0x4020906c 0x4020938f 0x4020998a
0x4020de03 0x4020dfd9 0x40205343
Version: 3.1.008/ota_0/main (build idf v3.1-dev-986-g1a1a544a Jun 26 2018 09:30:21)

Running partition: ota_0
Boot partition: ota_0
Firmware: 3.1.008/ota_0/main (build idf v3.1-dev-986-g1a1a544a Jun 26 2018 09:30:21)

                                                        -- Steve

OVMS> ena
Password:
E (883184595) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883184595) ovms-server-v2: Status: Error: Connection failed
I (883191605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883191605) ovms-server-v2: Status: Connecting...
OVMS#
E (883205565) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883205565) ovms-server-v2: Status: Error: Connection failed
I (883205565) housekeeping: 2018-07-28 16:46:59 GMT (RAM: 8b=113788-152720 32b=28252)
I (883211605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883211605) ovms-server-v2: Status: Connecting...
E (883225515) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883225515) ovms-server-v2: Status: Error: Connection failed
I (883231605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883231605) ovms-server-v2: Status: Connecting...
OVMS# mo m
Free 8-bit 152728/281376, 32-bit 644/28920, SPIRAM 4073124/4194252
--Task--     Total DRAM D/IRAM   IRAM SPIRAM   +/- DRAM D/IRAM   IRAM SPIRAM
main*              8412      0      0   7636      +8412     +0     +0  +7636
no task*           5348      0      0      0      +5348     +0     +0     +0
3FFDBC58*           176      0      0      0       +176     +0     +0     +0
3FFD9F20*           352      0      0      0       +352     +0     +0     +0
esp_timer         23856      0    644  44448     +23856     +0   +644 +44448
OVMS Events       73408      0      0  21488     +73408     +0     +0 +21488
ipc0               7776      0      0      0      +7776     +0     +0     +0
ipc1                 12      0      0      0        +12     +0     +0     +0
Tmr Svc              88      0      0    132        +88     +0     +0   +132
tiT                 928      0      0   6164       +928     +0     +0  +6164
OVMS SIMCOM           0      0      0   3896         +0     +0     +0  +3896
wifi               1636      0      0   3764      +1636     +0     +0  +3764
OVMS Vehicle        200      0      0    688       +200     +0     +0   +688
OVMS Console          0      0  27488     20         +0     +0 +27488    +20
OVMS NetMan         308      0      0    148       +308     +0     +0   +148
mdns                104      0      0      4       +104     +0     +0     +4
E (883245475) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883245475) ovms-server-v2: Status: Error: Connection failed
I (883251605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883251605) ovms-server-v2: Status: Connecting...
OVMS# mo t
Number of Tasks = 16      Stack:  Now   Max Total    Heap 32-bit SPIRAM C# PRI
3FFAFB48  1 Blk esp_timer         388   676  4096   23856    644  44448  0  22
3FFBDE68  2 Blk eventTask         436  1876  4608       0      0      0  0  20
3FFC0388  3 Blk OVMS Events      1476  3316  8192   73408      0  21488  1  23
3FFC1850  4 Blk OVMS CanRx        428   588  1024       0      0      0  0  10
3FFC2234  5 Blk ipc0              400   560  1024    7776      0      0  0  24
3FFC2834  6 Blk ipc1              400   496  1024      12      0      0  1  24
3FFC465C  9 Rdy IDLE              376   552  1024       0      0      0  0   0
3FFC4BF0 10 Rdy IDLE              380   556  1024       0      0      0  1   0
3FFC5984 11 Blk Tmr Svc           352  2032  3072      88      0     12  0   1
3FFC2C24 16 Blk tiT               484  2452  3072     928      0   6164  *  18
3FFCAC78 17 Blk OVMS SIMCOM       452  2324  4096       0      0   3896  1   5
3FFCC664 18 Blk wifi              432  2432  4096    1636      0   3764  0  23
3FFD06D8 19 Blk OVMS Vehicle      452  3284  6144     200      0    688  1  10
3FFD37A0 20 Rdy OVMS Console      748  2444  6144       0  27488     20  1   5
3FFD5934 21 Blk OVMS NetMan       736  3424  8192     308      0    148  1  23
3FFD6EE4 22 Blk mdns              464  1632  4096     104      0      4  0   1
E (883265415) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883265415) ovms-server-v2: Status: Error: Connection failed
I (883271605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883271605) ovms-server-v2: Status: Connecting...
OVMS# simcom status
Network Registration: RegisteredRoaming
Provider: AT&T Hologram
Signal: -99 dBm

State: NetMode

PPP: Connected on channel: #2

GPS: Not connected
E (883285325) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883285325) ovms-server-v2: Status: Error: Connection failed
OVMS# network
Interface#3: pp3 (ifup=1 linkup=1)
  IPv4: 10.170.41.247/255.255.255.255 gateway 10.64.64.64

Interface#2: ap2 (ifup=1 linkup=1)
  IPv4: 192.168.4.1/255.255.255.0 gateway 192.168.4.1

Interface#1: st1 (ifup=1 linkup=1)
  IPv4: 192.168.1.82/255.255.255.0 gateway 192.168.1.254

DNS: 8.8.8.8 8.8.4.4

Default Interface: st1 (192.168.1.82/255.255.255.0 gateway 192.168.1.254)
I (883291605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883291605) ovms-server-v2: Status: Connecting...
E (883305265) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883305265) ovms-server-v2: Status: Error: Connection failed
I (883311605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883311605) ovms-server-v2: Status: Connecting...
E (883325225) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883325225) ovms-server-v2: Status: Error: Connection failed
I (883331605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883331605) ovms-server-v2: Status: Connecting...
E (883345185) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883345185) ovms-server-v2: Status: Error: Connection failed
I (883351605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883351605) ovms-server-v2: Status: Connecting...
E (883365155) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883365155) ovms-server-v2: Status: Error: Connection failed
I (883371605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883371605) ovms-server-v2: Status: Connecting...
E (883385115) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883385115) ovms-server-v2: Status: Error: Connection failed
I (883391605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883391605) ovms-server-v2: Status: Connecting...
E (883405005) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883405005) ovms-server-v2: Status: Error: Connection failed
I (883411605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883411605) ovms-server-v2: Status: Connecting...
E (883424925) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883424925) ovms-server-v2: Status: Error: Connection failed
I (883431605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883431605) ovms-server-v2: Status: Connecting...
E (883444885) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883444885) ovms-server-v2: Status: Error: Connection failed
I (883451605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883451605) ovms-server-v2: Status: Connecting...
OVMS# wifi mode off
Stopping wifi station...
I (883453745) esp32wifi: Stopping WIFI station
I (883453745) wifi: state: run -> init (0)
I (883453745) wifi: pm stop, total sleep time: 430473605972 us / 521077537519 us
I (883453745) wifi: n:1 0, o:1 1, ap:1 1, sta:1 0, prof:1
I (883453755) wifi: flush txq
I (883453755) wifi: stop sw txq
I (883453755) wifi: lmac stop hw txq
E (883464855) ovms-server-v2: mg_connect(api.openvehicles.com:6867) failed: cannot parse address|
E (883464855) ovms-server-v2: Status: Error: Connection failed
I (883464855) netmanager: Interface priority is pp3 (10.170.41.247/255.255.255.255 gateway 10.64.64.64)
I (883464855) netmanager: Set DNS#0 8.8.8.8
I (883464855) netmanager: Set DNS#1 8.8.4.4
I (883464855) netmanager: WIFI client down (with MODEM up): reconfigured for MODEM priority
I (883464855) netmanager: Interface priority is pp3 (10.170.41.247/255.255.255.255 gateway 10.64.64.64)
I (883464855) netmanager: Set DNS#0 8.8.8.8
I (883464855) netmanager: Set DNS#1 8.8.4.4
I (883464855) esp32wifi: STA disconnected with reason 8
I (883464855) netmanager: Interface priority is pp3 (10.170.41.247/255.255.255.255 gateway 10.64.64.64)
I (883464855) netmanager: Set DNS#0 8.8.8.8
I (883464855) netmanager: Set DNS#1 8.8.4.4
I (883464855) netmanager: Interface priority is pp3 (10.170.41.247/255.255.255.255 gateway 10.64.64.64)
I (883464855) netmanager: Set DNS#0 8.8.8.8
I (883464865) netmanager: Set DNS#1 8.8.4.4
I (883464865) netmanager: WIFI access point is down
I (883464865) esp32wifi: AP stopped
I (883464865) time: Network was reconfigured: restarting SNTP client
I (883464865) ovms-server-v2: Network was reconfigured: disconnect, and reconnect in 10 seconds
I (883464865) ovms-server-v2: Status: Network was reconfigured: disconnect, and reconnect in 10 seconds
I (883474605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883474605) ovms-server-v2: Status: Connecting...
I (883475575) ovms-server-v2: Connection successful
I (883475575) ovms-server-v2: Status: Logging in...
I (883475585) ovms-server-v2: Sending server login: MP-C 0 ze4eZZFUPu2d3Lo+H4lvag eqhEPTdnHHCmf7oKGLmJgw== US33
I (883476175) ovms-server-v2: Got server response: MP-S 0 qTQRfCoaBEV4v3jOSboT5W +AwXY+/c0F1Fv3VQsf8c0g==
I (883476175) ovms-server-v2: Server token is qTQRfCoaBEV4v3jOSboT5W and digest is +AwXY+/c0F1Fv3VQsf8c0g==
I (883476175) ovms-server-v2: Status: Server authentication ok. Now priming crypto.
I (883476175) ovms-server-v2: Shared secret key is qTQRfCoaBEV4v3jOSboT5Wze4eZZFUPu2d3Lo+H4lvag (44 bytes)
I (883476175) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (883476195) ovms-server-v2: Incoming Msg: MP-0 Z0
I (883476605) ovms-server-v2: Send MP-0 S86.0,M,65535,127,stopped,standard,205,198,32,0,0,2100,2,21,0,0,0,0,184.04,32,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,82
I (883476605) ovms-server-v2: Send MP-0 D69,0,5,29,35,28,300,515969,0,643274,22,0,1,1,11.37,0,12.6,0,29,0
I (883476605) ovms-server-v2: Send MP-0 L37.346310,-122.037224,15,48,1,1,0,0,0.0,0,0
I (883476615) ovms-server-v2: Send MP-0 F3.1.008/ota_0/main (build idf v3.1-dev-986-g1a1a544a Jun 26 2018 09:30:21),5YJRE11B181000033,7,1,TR1N,AT&T Hologram
I (883476615) ovms-server-v2: Send MP-0 PAStandard - Charge Stopped|SOC: 86.0%|Ideal range: 207Km|Est. range: 199Km|ODO: 51596.9Km|CAC: 184.0Ah|SOH: 82%|
I (883476615) ovms-server-v2: Send MP-0 PIStandard - Charging|245.0V/3.0A|Full: 247 mins|SOC: 53.0%|Ideal range: 125Km|Est. range: 121Km|ODO: 51596.9Km|CAC: 184.0Ah|SOH: 82%|
I (883476615) ovms-server-v2: Send MP-0 PIStandard - Charge Done|SOC: 86.0%|Ideal range: 209Km|Est. range: 201Km|ODO: 51596.9Km|CAC: 184.0Ah|SOH: 82%|
I (883500605) housekeeping: 2018-07-28 16:51:55 GMT (RAM: 8b=113788-152748 32b=644)
I (883512195) event: station ip lost
OVMS# wifi mode client Revelstoke
Starting WIFI as a client to Revelstoke...
I (883524865) wifi: mode : sta (30:ae:a4:43:9c:28)
I (883527275) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (883527965) wifi: state: init -> auth (b0)
I (883527975) wifi: state: auth -> assoc (0)
I (883527975) wifi: state: assoc -> run (10)
I (883528015) wifi: connected with Revelstoke, channel 1
I (883528015) wifi: pm start, type: 1
I (883529095) event: sta ip: 192.168.1.82, mask: 255.255.255.0, gw: 192.168.1.254
I (883529095) netmanager: Interface priority is st4 (192.168.1.82/255.255.255.0 gateway 192.168.1.254)
I (883529095) netmanager: Set DNS#0 8.8.8.8
I (883529095) netmanager: Set DNS#1 8.8.4.4
I (883529095) netmanager: WIFI client up (with MODEM up): reconfigured for WIFI client priority
I (883529095) esp32wifi: STA got IP with SSID: Revelstoke, MAC: 30:ae:a4:43:9c:28, IP: 192.168.1.82, mask: 255.255.255.0, gw: 192.168.1.254
I (883529095) time: Network was reconfigured: restarting SNTP client
I (883529095) ovms-server-v2: Network was reconfigured: disconnect, and reconnect in 10 seconds
I (883529095) ovms-server-v2: Status: Network was reconfigured: disconnect, and reconnect in 10 seconds
I (883529335) ovms-server-v2: Status: Disconnected
I (883548605) ovms-server-v2: Connection is api.openvehicles.com:6867 US33
I (883548605) ovms-server-v2: Status: Connecting...
I (883548795) ovms-server-v2: Connection successful
I (883548795) ovms-server-v2: Status: Logging in...
I (883548795) ovms-server-v2: Sending server login: MP-C 0 ckcTJt/ZXBlyxcklQULIA0 MuBQZZ9X5KpG0ofDjULWsw== US33
I (883549025) ovms-server-v2: Got server response: MP-S 0 6+7upY3iY6hpYdQPk2JihK RylaYqE9Yh/nZ65FG2aSoQ==
I (883549025) ovms-server-v2: Server token is 6+7upY3iY6hpYdQPk2JihK and digest is RylaYqE9Yh/nZ65FG2aSoQ==
I (883549025) ovms-server-v2: Status: Server authentication ok. Now priming crypto.
I (883549025) ovms-server-v2: Shared secret key is 6+7upY3iY6hpYdQPk2JihKckcTJt/ZXBlyxcklQULIA0 (44 bytes)
I (883549025) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (883549035) ovms-server-v2: Incoming Msg: MP-0 Z0
OVMS# net sta
Interface#4: st4 (ifup=1 linkup=1)
  IPv4: 192.168.1.82/255.255.255.0 gateway 192.168.1.254

Interface#3: pp3 (ifup=1 linkup=1)
  IPv4: 10.170.41.247/255.255.255.255 gateway 10.64.64.64

DNS: 8.8.8.8 8.8.4.4

Default Interface: st4 (192.168.1.82/255.255.255.0 gateway 192.168.1.254)
I (883585175) webserver: HTTP GET /status
I (883596435) webserver: HTTP POST /status
I (883596445) webserver: HandleLogin: 'admin' logged in, sid da66bbbc0ea1e7e1
I (883596645) webserver: HTTP GET /menu
I (883596655) webserver: HTTP GET /status



More information about the OvmsDev mailing list