The new esp-idf works good, I think I'll push the changes this evening.

I even have some more free IRAM now, it used to be down to ~1K and is now ~7K.

Remaining crashes recorded up to now:
Regards,
Michael


Am 06.07.2018 um 22:07 schrieb Michael Balzer:
I've been using APCLIENT all the time and only had one crash that looked like a wifi problem. This really is a very specific problem. I also have a very good wifi signal, I can perfectly use my module's web UI while the car is in my garage two floors below. But I live in an uncrowded area, not much wifi competition.

I have updated my esp-idf to the latest upstream master (it's v3.2 now) and could build without any memory issues. The wifi driver now, besided loads of bug fixes, also supports CSI. Our code only needs a minor adjustment if you'd like to compile yourself, add…

#define _SOC_SPI_PERIPH_H_ // don't include spi_periph.h (type conflict)

…in components/spinodma/spi_master_nodma.h before #include "driver/spi_common.h".

If you don't want to compile, the new build (with CSI enabled) is also on my server:

http://ovms.dexters-web.de/firmware/ota/v3.1/edge/

…and now being installed by my beta testers.

Regards,
Michael


Am 06.07.2018 um 16:28 schrieb Mark Webb-Johnson:
My 2c:

For the access points I normally use, it works 100% of the time for me. The only issue I had was when the SSID password was wrong on one of my access points (sharing the same SSID) and that was randomly causing me connection issues (every time the ESP32 picked it).

I also don’t use APCLIENT, and only use SCLIENT mode. I’ve found APCLIENT to be buggy as hell.

But, I do have problems connecting to some access points. In particular phone hotspots. I suspect either bugs in the wifi stack, or some issue with channels.

The only thing I am wary of is that our current code does this:

esp_wifi_set_config…
esp_wifi_start…
esp_wifi_connect...

But the Espressif examples have:

esp_wifi_set_config…
esp_wifi_start…
Wait for SYSTEM_EVENT_STA_START
esp_wifi_connect...

I had that working the Espressif way in my big wifi refactor that never made it to production. But our current code doesn’t wait for the SYSTEM_EVENT_STA_START before calling esp_wifi_connect.

Regards, Mark.

On 6 Jul 2018, at 9:04 PM, Michael Balzer <dexter@expeedo.de> wrote:

I've had similar reports regarding poor wifi connectivity, and this seems to affect some modules more than others (or may be channel/frequency dependant?). One
user has just 1-2 bars AP wifi signal with the module placed ~ 50 cm away from the phone.

I also still get reports of spurious strange crashes, that mostly seem to be related to situations with poor wifi signal. Some crash backtraces just are
complete blank / null, and there is no crash report on the USB output for these before reboot.

Yesterday, Frank tried to perform some wifi scans. The first scan went fine, the second never returned, he had to power off the module. After reboot, all
successive scans worked.

Two users reported they occasionally cannot auth to the OVMS AP with the correct password, and they can then reconnect just by retrying for some minutes or by
connecting & disconnecting another client to the AP.

I already had a look at the wifi tx power configuration, it's at 100% by default.

This all feels like a) we need to change something about the antenna, and b) there are quite some bugs in the wifi blob.

Looking at https://github.com/espressif/esp32-wifi-lib/commits/master it seems there have been numerous wifi blob fixes lately. Last time I checked I still was
out of memory with the current esp-idf, I'll check again.

Regards,
Michael


Am 06.07.2018 um 01:48 schrieb Stephen Casner:
I find the wifi performance of OVMS v3 to be poor, and I'm wondering
how it might be improved.  I have a mix of thoughts here.

For both my own unit and that of Timothy Rodgers, wifi reception in
our garages was unusable.  You can blame that on too much distance
from the access point, but my iPhone and MacBook both access the wifi
just fine from my garage.  The wifi antenna in the OVMS is probably
smaller and its location within the metal framework around the car's
firewall may impede radio transmission.  Perhaps it would be feasible
to switch to an ESP32-WROVER-I with an external antenna to improve
performance, but that would be a big deal.  If there is a transmit
power adjustment, perhaps that could be increased?

When Timothy parks his car next to his house, which is about 50 feet
closer than the garage, then the wifi reception was good enough for
the update to 3.1.008 to succeed.  But when he tries to connect with
the browser, page updates often time out, so it is close to unusable.
Perhaps we could improve usability by increasing the timeout in our
javascript to allow more time for TCP to retransmit?

For my own unit, I switched from AP+client to just client mode and at
first it seemed that had improved the client performance.  But still
the next day I had no access from the iPhone app.  When I connected to
the console to find out why I saw that server v2 was repeatedly trying
to connect and failing.  I'm presuming that the cause was poor wifi
connectivity since I was also not able to reach the web server on the
client address, although I have not proven that.  But since the client
wifi was associated with the home AP and had an address, the OVMS
network routing preferred the wifi and did not try to use the modem.
For now I have resorted to turning off wifi.  I suggest that the
network routing algorithm be enhanced to back off to use the modem if
some number of attempts to connect to the server over wifi have
failed.  The iPhone will do this for itself (there is a setting to
enable this called Wi-Fi Assist).

The behavior of repeated connection attempts and failures by server v2
seems to induce a more serious failure after a while, perhaps due to
some resource starvation.  At that point there is a failure message
"mg_connect(api.openvehicles.com:6867) failed: cannot parse address"
every time server v2 tries to connect.  I expect that is a bug that
could be fixed.

Lastly, since we may encounter situations where network communication
is not working, we should facilitate access to the console.  When I
was trying to help Timothy change a location radius setting remotely
by phone and the web browser was timing out, I suggested that he find
a micro-USB cable so he could connect to the console.  But then I
realized he would not have any application on his laptop that would
allow him to connect to the console.  Developers use "make monitor" in
the software development cycle, but users won't have that tool.  I
have my own program on the MacBook that I use as an alternative when I
don't want to induce a reset when I connect.  But is there a simple
program for Windows suitable for non-developer users that can connect
to the OVMS console?

                                                       -- Steve
_______________________________________________
OvmsDev mailing list
OvmsDev@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@lists.openvehicles.com
http://lists.openvehicles.com/mailman/listinfo/ovmsdev



_______________________________________________
OvmsDev mailing list
OvmsDev@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@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