<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">i use this: <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi" class="">https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi</a> for some ESP Projects. Happy with it.</div><div class="">You can enter some ssid incl. Password so it connect to one of them.</div><div class=""><br class=""><div>Bye</div><div>Michael</div><div><br class=""><blockquote type="cite" class=""><div class="">Am 28.10.2017 um 13:28 schrieb Tom Parker <<a href="mailto:tom@carrott.org" class="">tom@carrott.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">I've been driving around with the v3 hardware in my car for a couple of weeks using my phone's wifi hotspot. I found that it wouldn't re-connect to my phone after I turned off the hotspot and it wouldn't connect to my house wifi when the car is at home. So fixed it with a terrible network manager:<br class=""><br class=""><a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/compare/master...carrott:terrible-network-manager" class="">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/compare/master...carrott:terrible-network-manager</a><br class=""><br class="">This network manager is terrible:<br class=""><br class="">* it doesn't scan for available wifi and try to connect to only those that are available<br class="">* it tries to connect to the next network once per minute, meaning it can take several minutes to connect<br class="">* it iterates through a list of 3 networks, if you don't have 3 networks, you still have to wait<br class="">* it's implemented using a mixture of events, scripts and terrible C++ code<br class="">* it should use string concatenation to make the event names, rather than 3 hard coded names, but if it did that then the terrible C++ code wouldn't be so terrible<br class="">* you can't turn it on or off except in sdkconfig. If it's compiled in, it tries to connect every minute<br class="">* it doesn't connect to my office wifi, I haven't looked in to why, maybe it is because there is a space in the SSID name on that network<br class=""><br class="">Despite being so terrible, it's been pretty reliable for me. I'm not sure if you want a pull request for this thing, or perhaps someone could re-write it "properly". The obvious thing to do is to scan for available networks, look at the list of configured SSID-Password pairs and if any are in range, trigger the wifi connection directly rather than triggering an event that runs a script that attempts to connect to the network.<br class=""><br class="">If you want to try it out, I wrote some instructions:<br class=""><br class="">Beware that the following advice appends to files, but does not confirm they are empty before doing so, be sure you don't end up with unexpected scripts or script content, as unexpected things could happen.<br class=""><br class="">Store the credentials for your wifi network(s) with<br class="">config set wifi.ssid <ssid> <password><br class=""><br class="">Create a script to stop the v2 server when the network goes down (note the "network.down" doesn't fire, so use system.wifi.sta.disconnected):<br class="">vfs mkdir /store/events/system.wifi.sta.disconnected<br class="">vfs append "server v2 stop" /store/events/system.wifi.sta.disconnected/shutdown<br class=""><br class="">Create a script to start the v2 server client when the network comes up:<br class="">vfs mkdir /store/events/network.up<br class="">vfs append "server v2 start" /store/events/network.up/startmeup<br class=""><br class="">Create a script to select a vehicle on startup:<br class="">vfs mkdir /store/events/system.start<br class="">vfs append "vehicle module NL" /store/events/system.start/startmeup<br class=""><br class="">Create scripts to connect to your wifi network in response to the terrible network manager events:<br class="">vfs mkdir /store/events/tnm.connect.0<br class="">vfs append "wifi mode client <ssid_1>" /store/events/tnm.connect.0/connect<br class="">vfs mkdir /store/events/tnm.connect.1<br class="">vfs append "wifi mode client <ssid_2>" /store/events/tnm.connect.1/connect<br class="">vfs mkdir /store/events/tnm.connect.2<br class="">vfs append "wifi mode client <ssid_3>" /store/events/tnm.connect.2/connect<br class="">_______________________________________________<br class="">OvmsDev mailing list<br class="">OvmsDev@lists.teslaclub.hk<br class="">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></body></html>