Mark Webb-Johnson wrote:
There seems to be something going on internally in lwip regarding this. It is such a dumb implementation anyway, with a separate task and static initialisation of the interface list at the time of startup; really not ideal for a dynamically changing environment. It would be much more sensible to just have a timer and every N seconds iterate through the current interface list to send out MDNS broadcasts on each active one that is suitable for MDNS (wifi only, really).

I think safest for the moment to just disable MDNS. I’ve done that now, and it is running live. That seems to be pretty good for me. Can you see if that works better for you?

I’m still seeing some issues with ssh/telnet startup that I’m looking at now.

Given where we are, I’m going to tell China that we need another 48 hours to confirm the firmware, before I send to them. That buys us some time to get this as stable as we can.

Regards, Mark.


Better!  Much better!  The scenario where the module boots into a wifi connection, then looses the server connection when the modem gets its IP, appears to be fixed. 

If I drop the wifi connection at that point, the server connection doesn't recover.  Looks like the default interface moves from wifi Client to wifi AP instead of modem.  After a number of attempts, the 3 minute timer kicks in, and the modem resets.  That seems to recover the connection, and the server is getting updates.  Oddly, the default interface is still pointing to the AP... 

I need to do more testing of link state change, but this is definitely a significant step forward.

Greg



Welcome to the Open Vehicle Monitoring System (OVMS) - Async Console
OVMS>
OVMS>
I (4156) wifi: n:1 1, o:1 0, ap:1 1, sta:1 0, prof:1
OVMS>
I (4806) wifi: state: init -> auth (b0)
I (4816) wifi: state: auth -> assoc (0)
I (4836) wifi: state: assoc -> run (10)
I (4846) wifi: connected with gregnet3, channel 1
I (5406) event: sta ip: 192.168.43.49, mask: 255.255.255.0, gw: 192.168.43.1
I (5406) netmanager: Set DNS#0 9.9.9.9
I (5406) netmanager: Set DNS#1 8.8.8.8
I (5406) netmanager: Interface priority is st1 (192.168.43.49/255.255.255.0 gateway 192.168.43.1)
I (5406) time: Starting SNTP client
I (5416) ovms-server-v2: Network is up, so attempt network connection
I (5416) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (5416) ovms-server-v2: Status: Connecting...
I (5426) esp32wifi: WiFi UP with SSID: gregnet3, MAC: 30:ae:a4:37:1b:64, IP: 192.168.43.49, mask: 255.255.255.0, gw: 192.168.43.1
I (5966) ovms-server-v2: Connection successful
I (5966) ovms-server-v2: Status: Logging in...
I (5966) ovms-server-v2: Sending server login: MP-C 0 LIGvptd0M42nObBOtNAvTV sqj5QThbxt53Cwt/xdVTMQ== ROADSTER_834
I (6346) ovms-server-v2: Got server response: MP-S 0 nwNkGr2u0krmtS1inehH08 tl2u2EHPv8gGQ+m+gIB8cg==
I (6346) ovms-server-v2: Server token is nwNkGr2u0krmtS1inehH08 and digest is tl2u2EHPv8gGQ+m+gIB8cg==
I (6356) ovms-server-v2: Status: Server auth ok. Now priming crypto.
I (6356) ovms-server-v2: Shared secret key is nwNkGr2u0krmtS1inehH08LIGvptd0M42nObBOtNAvTV (44 bytes)
I (6356) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (6376) ovms-server-v2: Incoming Msg: MP-0 Z1
I (6376) ovms-server-v2: One or more peers have connected
I (6436) ovms-server-v2: Send MP-0 S0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (6436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,6,0,0,0,0,0.258242,0,0,0,0,0
I (6436) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,0,0,0,0,0
I (6436) ovms-server-v2: Send MP-0 W0,0,0,0,0,0,0,0,0
I (6436) ovms-server-v2: Send MP-0 F3.0.991-91-gffbc545/factory/main build (idf v3.1-dev-429-g7f6161cd) Mar 18 2018 22:02:28,,0,1,TR,gregnet3
OVMS> metric set v.b.soc 66
Metric set
I (10576) simcom: State: Enter PoweredOn state
I (12596) housekeeping: System considered stable (free: 46236 bytes)
I (24366) ovms-server-v2: Incoming Msg: MP-0 Z2
I (24376) ovms-server-v2: One or more peers have connected
I (24376) ovms-server-v2: Incoming Msg: MP-0 Z3
I (24376) ovms-server-v2: One or more peers have connected
I (24436) ovms-server-v2: Send MP-0 S66.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (24436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,24,0,0,0,0,0.274725,0,0,0,0,0
I (24436) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,0,0,0,0,0
I (24436) ovms-server-v2: Send MP-0 W0,0,0,0,0,0,0,0,0
I (24436) ovms-server-v2: Send MP-0 F3.0.991-91-gffbc545/factory/main build (idf v3.1-dev-429-g7f6161cd) Mar 18 2018 22:02:28,,9,1,TR,gregnet3
I (30456) simcom: State: Enter MuxStart state
I (30456) gsm-mux: Start MUX
I (30466) gsm-mux: Channel #0 is open
I (30476) gsm-mux: Channel #1 is open
I (30476) gsm-mux: Channel #2 is open
I (30486) gsm-mux: Channel #3 is open
I (30496) gsm-mux: Channel #4 is open
I (31436) simcom: State: Enter NetWait state
OVMS> metric set v.b.soc 77
Metric set
I (41466) simcom: CREG Network Registration: RegisteredRoaming
I (42436) simcom: State: Enter NetStart state
I (43566) simcom: PPP Connection is ready to start
I (44436) simcom: State: Enter NetMode state
I (44436) gsm-ppp: Initialising...
I (44936) ovms-server-v2: Incoming Msg: MP-0 Z2
I (47626) gsm-ppp: StatusCallBack: None
I (47626) gsm-ppp: status_cb: Connected
I (47626) gsm-ppp:    our_ipaddr  = 10.170.146.142
I (47626) gsm-ppp:    his_ipaddr  = 10.64.64.64
I (47626) gsm-ppp:    netmask     = 255.255.255.255
I (47626) gsm-ppp:    our6_ipaddr = ::
I (47626) netmanager: Set DNS#0 9.9.9.9
I (47626) netmanager: Set DNS#1 8.8.8.8
I (47626) netmanager: Interface priority is st1 (192.168.43.49/255.255.255.0 gateway 192.168.43.1)
I (47626) time: Restarting SNTP client
I (47626) ovms-server-v2: Network is reconfigured, so disconnect network connection (and reconnect in 10 seconds)
E (47626) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (67436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (67436) ovms-server-v2: Status: Connecting...
I (67946) ovms-server-v2: Connection successful
I (67946) ovms-server-v2: Status: Logging in...
I (67946) ovms-server-v2: Sending server login: MP-C 0 +ny7tKvoChfd5TQPgOpvO9 FWPUAhKyST4UvBbVaeLx9w== ROADSTER_834
I (68156) ovms-server-v2: Got server response: MP-S 0 XrkL05XZbhYfvDo8sjCrid vaA5q6BFj5qp0R1nFLYwZA==
I (68166) ovms-server-v2: Server token is XrkL05XZbhYfvDo8sjCrid and digest is vaA5q6BFj5qp0R1nFLYwZA==
I (68166) ovms-server-v2: Status: Server auth ok. Now priming crypto.
I (68166) ovms-server-v2: Shared secret key is XrkL05XZbhYfvDo8sjCrid+ny7tKvoChfd5TQPgOpvO9 (44 bytes)
I (68166) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (68176) ovms-server-v2: Incoming Msg: MP-0 Z3
I (68176) ovms-server-v2: One or more peers have connected
I (68436) ovms-server-v2: Send MP-0 S77.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (68436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,68,0,0,0,0,0.291209,0,0,0,0,0
I (68436) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,0,0,0,0,0
I (68436) ovms-server-v2: Send MP-0 W0,0,0,0,0,0,0,0,0
I (68436) ovms-server-v2: Send MP-0 F3.0.991-91-gffbc545/factory/main build (idf v3.1-dev-429-g7f6161cd) Mar 18 2018 22:02:28,,9,1,TR,T-Mobile Hologram
OVMS> metric set v.b.soc 88
Metric set
I (82016) ovms-server-v2: Incoming Msg: MP-0 Z2
I (82026) ovms-server-v2: Incoming Msg: MP-0 Z3
I (82026) ovms-server-v2: One or more peers have connected
I (82246) ovms-server-v2: Incoming Msg: MP-0 Z4
I (82246) ovms-server-v2: One or more peers have connected
I (82246) ovms-server-v2: Incoming Msg: MP-0 Z3
I (82436) ovms-server-v2: Send MP-0 S88.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (82436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,82,0,0,0,0,0.302198,0,0,0,0,0
I (82436) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,0,0,0,0,0
I (82436) ovms-server-v2: Send MP-0 W0,0,0,0,0,0,0,0,0
I (82436) ovms-server-v2: Send MP-0 F3.0.991-91-gffbc545/factory/main build (idf v3.1-dev-429-g7f6161cd) Mar 18 2018 22:02:28,,9,1,TR,T-Mobile Hologram
OVMS> metric set v.b.soc 11
Metric set
I (111086) wifi: state: run -> auth (2c0)
I (111086) wifi: n:1 0, o:1 1, ap:1 1, sta:1 0, prof:1
I (111086) netmanager: Interface priority is pp3 (10.170.146.142/255.255.255.255 gateway 10.64.64.64)
I (111096) time: Restarting SNTP client
I (111096) ovms-server-v2: Network is reconfigured, so disconnect network connection (and reconnect in 10 seconds)
E (111096) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (130436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (130436) ovms-server-v2: Status: Connecting...
W (140496) ovms-server-v2: Connection failed
E (140496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
OVMS> simcom
SIMCOM
  Network Registration: RegisteredRoaming
  State: NetMode
  Ticker: 101
  User Data: 0

  Mux
    Status: up
    Open Channels: 4
    Framing Errors: 0
    Last RX frame: 11 sec(s) ago
    RX frames: 22
    TX frames: 31

  PPP
    Connected on channel: #2
    Last Error: None

  GPS
    Status: disabled
    Time: disabled
    NMEA: GPS/GLONASS Not Connected
OVMS> netwrok
Unrecognised command
OVMS> network
Interface#3: pp3 (ifup=1 linkup=1)
  IPv4: 10.170.146.142/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=0 linkup=1)
  IPv4: 0.0.0.0/0.0.0.0 gateway 0.0.0.0

Interface#0: lo0 (ifup=1 linkup=1)
  IPv4: 127.0.0.1/255.0.0.0 gateway 127.0.0.1

DNS: 9.9.9.9 8.8.8.8

Default Interface: ap2 (192.168.4.1/255.255.255.0 gateway 192.168.4.1)
I (160436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (160436) ovms-server-v2: Status: Connecting...
W (170496) ovms-server-v2: Connection failed
E (170496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (190436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (190436) ovms-server-v2: Status: Connecting...
W (200496) ovms-server-v2: Connection failed
E (200496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (220436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (220436) ovms-server-v2: Status: Connecting...
I (230216) event: station ip lost
W (230496) ovms-server-v2: Connection failed
E (230496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (250436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (250436) ovms-server-v2: Status: Connecting...
W (260496) ovms-server-v2: Connection failed
E (260496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (280436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (280436) ovms-server-v2: Status: Connecting...
W (290496) ovms-server-v2: Connection failed
E (290496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (310436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (310436) ovms-server-v2: Status: Connecting...
W (320496) ovms-server-v2: Connection failed
E (320496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (340436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (340436) ovms-server-v2: Status: Connecting...
W (350496) ovms-server-v2: Connection failed
E (350496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (370436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (370436) ovms-server-v2: Status: Connecting...
W (380496) ovms-server-v2: Connection failed
E (380496) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (400436) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (400436) ovms-server-v2: Status: Connecting...
W (405436) simcom: 3 minutes since last MUX rx frame - assume MUX has failed
I (405436) gsm-ppp: Shutting down (soft)...
I (405436) time: Stopping SNTP client
I (405436) ovms-server-v2: Network is down, so disconnect network connection
E (405436) ovms-server-v2: Status: Error: Disconnected from OVMS Server V2
I (405446) gsm-nmea: Shutdown (direct)
I (405446) gsm-mux: Stop MUX
I (405446) simcom: Power Cycle
I (405496) webserver: Stopping Web Server
W (405506) ovms-server-v2: Connection failed
I (406446) simcom: State: Enter PoweringOn state
I (406446) simcom: Power Cycle
I (414436) simcom: State timeout, transition to 2
I (414436) simcom: State: Enter PoweringOn state
I (414436) simcom: Power Cycle
I (417446) gsm-ppp: StatusCallBack: User Interrupt
I (417446) gsm-ppp: PPP connection has been closed
I (420526) simcom: State: Enter PoweredOn state
I (440456) simcom: State: Enter MuxStart state
I (440456) gsm-mux: Start MUX
I (440466) gsm-mux: Channel #0 is open
I (440476) gsm-mux: Channel #1 is open
I (440476) gsm-mux: Channel #2 is open
I (440486) gsm-mux: Channel #3 is open
I (440496) gsm-mux: Channel #4 is open
I (441436) simcom: State: Enter NetWait state
I (445436) simcom: State: Enter NetStart state
I (446576) simcom: PPP Connection is ready to start
I (447436) simcom: State: Enter NetMode state
I (447436) gsm-ppp: Initialising...
I (450476) gsm-ppp: StatusCallBack: None
I (450476) gsm-ppp: status_cb: Connected
I (450476) gsm-ppp:    our_ipaddr  = 10.170.146.142
I (450476) gsm-ppp:    his_ipaddr  = 10.64.64.64
I (450476) gsm-ppp:    netmask     = 255.255.255.255
I (450476) gsm-ppp:    our6_ipaddr = ::
I (450476) netmanager: Set DNS#0 9.9.9.9
I (450476) netmanager: Set DNS#1 8.8.8.8
I (450486) netmanager: Interface priority is pp3 (10.170.146.142/255.255.255.255 gateway 10.64.64.64)
I (450486) time: Starting SNTP client
I (450506) webserver: Launching Web Server
I (450546) ovms-server-v2: Network is up, so attempt network connection
I (450546) ovms-server-v2: Connection is tmc.openvehicles.com:6867 ROADSTER_834/Gdbkt2017server
I (450546) ovms-server-v2: Status: Connecting...
I (451726) ovms-server-v2: Connection successful
I (451726) ovms-server-v2: Status: Logging in...
I (451726) ovms-server-v2: Sending server login: MP-C 0 OYBHBLDiR8FsCxd0VtbfA2 Eg1Ekd1iLSJgfoFGDUDNKg== ROADSTER_834
I (452386) ovms-server-v2: Got server response: MP-S 0 wkmxLuN4Qywx3BJ7w+rP4S M8KEoJNS956dHLWFCeA6Kw==
I (452396) ovms-server-v2: Server token is wkmxLuN4Qywx3BJ7w+rP4S and digest is M8KEoJNS956dHLWFCeA6Kw==
I (452406) ovms-server-v2: Status: Server auth ok. Now priming crypto.
I (452406) ovms-server-v2: Shared secret key is wkmxLuN4Qywx3BJ7w+rP4SOYBHBLDiR8FsCxd0VtbfA2 (44 bytes)
I (452416) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (452426) ovms-server-v2: Incoming Msg: MP-0 Z3
I (452436) ovms-server-v2: Send MP-0 S11.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (452436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,452,0,0,0,0,0.269231,0,0,0,0,0
I (452436) ovms-server-v2: Send MP-0 F3.0.991-91-gffbc545/factory/main build (idf v3.1-dev-429-g7f6161cd) Mar 18 2018 22:02:28,,9,1,TR,
I (513436) ovms-server-v2: Send MP-0 S11.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (513436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,513,0,0,0,0,0.269231,0,0,0,0,0
I (513436) ovms-server-v2: Send MP-0 F3.0.991-91-gffbc545/factory/main build (idf v3.1-dev-429-g7f6161cd) Mar 18 2018 22:02:28,,9,1,TR,T-Mobile Hologram
I (574436) ovms-server-v2: Send MP-0 S11.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (574436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,574,0,0,0,0,0.291209,0,0,0,0,0
OVMS>
OVMS>
OVMS>
OVMS>
I (635436) ovms-server-v2: Send MP-0 S11.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (635436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,635,0,0,0,0,0.269231,0,0,0,0,0
OVMS> metric set v.b.soc 22
Metric set
I (696436) ovms-server-v2: Send MP-0 S22.0,K,0,0,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,0.00,0
I (696436) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,696,0,0,0,0,0.269231,0,0,0,0,0
OVMS>
OVMS> network
Interface#3: pp3 (ifup=1 linkup=1)
  IPv4: 10.170.146.142/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=0 linkup=1)
  IPv4: 0.0.0.0/0.0.0.0 gateway 0.0.0.0

Interface#0: lo0 (ifup=1 linkup=1)
  IPv4: 127.0.0.1/255.0.0.0 gateway 127.0.0.1

DNS: 9.9.9.9 8.8.8.8

Default Interface: ap2 (192.168.4.1/255.255.255.0 gateway 192.168.4.1)
OVMS>