[Ovmsdev] WiFi client not switching to better AP

Stephen Casner casner at acm.org
Tue Dec 8 06:30:29 HKT 2020


Michael,

Switching to another network would imply a change of IP address and,
as you say, breaking all TCP connections.  But the case I was talking
about with my laptop is just switching to another AP on the same
network, so the IP address does not change and TCP connections are
maintained.  In the OVMS case, even if the scan for networks does
report multiple APs for the same network, it might still be that
switching causes a problem at the LWIP or Mongoose level.

                                                        -- Steve

On Mon, 7 Dec 2020, Michael Balzer wrote:

> Steve,
>
> scanning for networks is possible now without disrupting the Wifi mode, but
> TCP connections won't survive a switch to another network.
>
> So if you implement that, I suggest only switching to another known network if
> it's substantially better than the current one.
>
> Regards,
> Michael
>
>
> Am 07.12.20 um 22:27 schrieb Stephen Casner:
> > Michael,
> >
> > Thanks for the suggestions.  Since I only use the WiFi when the car is
> > in my garage where I now have a nearby AP, I don't need to worry about
> > trying to keep a connection when the signal is poor so the event idea
> > should do the trick.
> >
> > My laptop can switch from one AP to another as I move around without
> > dropping network connections.  So I guess it can hear other APs and
> > decide when to switch for a better signal.  Could the OVMS hardware
> > and driver allow that?
> >
> >                                                          -- Steve
> >
> > On Mon, 7 Dec 2020, Michael Balzer wrote:
> >
> > > Steve,
> > >
> > > that's something we can control.
> > >
> > > If you don't mind frequent disconnects in poor Wifi situations, a simple
> > > solution now is to attach a "wifi reconnect" command call to the
> > > "network.wifi.sta.bad" event. I added that command on the Wifi rework some
> > > months ago.
> > >
> > > For a better, general solution, we could e.g. count the
> > > "network.wifi.sta.bad"
> > > events on the same network (or better: check the event frequency) and
> > > disconnect when reaching some (tunable) threshold. The next automatic scan
> > > then connects to the best network available. Getting stuck in the "bad
> > > signal"
> > > state for too long would also need to trigger a disconnect.
> > >
> > > Regards,
> > > Michael
> > >
> > >
> > > Am 07.12.20 um 07:21 schrieb Stephen Casner:
> > > > Many months ago I installed another AP for the home network in my
> > > > garage because the signal quality to the main router was too poor for
> > > > OVMS to operate.  Today I needed to restart the garage AP, so OVMS
> > > > hear the main router again and associated to it.  But even after the
> > > > garage AP came back up, OVMS stuck with the main router and kept
> > > > toggling between WiFi and modem because the signal quality was bad.
> > > >
> > > > It this behavior just a function of the WiFi driver that we can't
> > > > control, or is it something we could improve?
> > > >
> > > > I fixed it by "wifi mode off" then "wifi mode client".
> > > >
> > > >                                                           -- Steve
> > > >
> > > > I (513443477) netmanager: WIFI client has bad signal quality (-89.2
> > > > dBm);
> > > > disconnect
> > > > I (513443477) netmanager: Interface priority is pp2
> > > > (10.170.41.247/255.255.255.255 gateway 10.64.64.64)
> > > > I (513443477) netmanager: Set DNS#0 8.8.8.8
> > > > I (513443477) netmanager: Set DNS#1 8.8.4.4
> > > > I (513443477) netmanager: WIFI client down (with MODEM up): reconfigured
> > > > for
> > > > MODEM priority
> > > > I (513443537) time: Network was reconfigured: restarting SNTP client
> > > > I (513443547) ovms-server-v2: Network was reconfigured: disconnect, and
> > > > reconnect in 10 seconds
> > > > I (513443547) ovms-server-v2: Status: Network was reconfigured:
> > > > disconnect,
> > > > and reconnect in 10 seconds
> > > > I (513443717) ovms-server-v2: Status: Disconnected
> > > > I (513463467) ovms-server-v2: Connection is api.openvehicles.com:6867
> > > > US33
> > > > I (513463467) ovms-server-v2: Status: Connecting...
> > > > I (513466157) ovms-server-v2: Connection successful
> > > > I (513466157) ovms-server-v2: Status: Logging in...
> > > > ...
> > > > I (513522477) netmanager: WIFI client has good signal quality (-86.9
> > > > dBm);
> > > > connect
> > > > I (513522477) netmanager: Interface priority is st13
> > > > (192.168.1.74/255.255.255.0 gateway 192.168.1.254)
> > > > I (513522477) netmanager: Set DNS#0 8.8.8.8
> > > > I (513522477) netmanager: Set DNS#1 8.8.4.4
> > > > I (513522477) netmanager: WIFI client up (with MODEM up): reconfigured
> > > > for
> > > > WIFI client priority
> > > > I (513522527) time: Network was reconfigured: restarting SNTP client
> > > > I (513522527) ovms-server-v2: Network was reconfigured: disconnect, and
> > > > reconnect in 10 seconds
> > > > I (513522527) ovms-server-v2: Status: Network was reconfigured:
> > > > disconnect,
> > > > and reconnect in 10 seconds
> > > > I (513522697) ovms-server-v2: Status: Disconnected
> > > > I (513529477) netmanager: WIFI client has bad signal quality (-89.0
> > > > dBm);
> > > > disconnect
> > > > I (513529477) netmanager: Interface priority is pp2
> > > > (10.170.41.247/255.255.255.255 gateway 10.64.64.64)
> > > > I (513529477) netmanager: Set DNS#0 8.8.8.8
> > > > I (513529477) netmanager: Set DNS#1 8.8.4.4
> > > > I (513529477) netmanager: WIFI client down (with MODEM up): reconfigured
> > > > for
> > > > MODEM priority
> > > > I (513529527) time: Network was reconfigured: restarting SNTP client
> > > > I (513529537) ovms-server-v2: Network was reconfigured: disconnect, and
> > > > reconnect in 10 seconds
> > > > I (513529537) ovms-server-v2: Status: Network was reconfigured:
> > > > disconnect,
> > > > and reconnect in 10 seconds
> > > > I (513539467) ovms-server-v2: Connection is api.openvehicles.com:6867
> > > > US33
> > > > I (513539467) ovms-server-v2: Status: Connecting...
> > > > I (513541987) ovms-server-v2: Connection successful
> > > > I (513541987) ovms-server-v2: Status: Logging in...
> > > > _______________________________________________
> > > > OvmsDev mailing list
> > > > OvmsDev at lists.openvehicles.com
> > > > http://lists.openvehicles.com/mailman/listinfo/ovmsdev
> > > --
> > > Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> > > Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
> > _______________________________________________
> > OvmsDev mailing list
> > OvmsDev at lists.openvehicles.com
> > http://lists.openvehicles.com/mailman/listinfo/ovmsdev
>
> --
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
>
>
>


More information about the OvmsDev mailing list