dl9rdz / rdz_ttgo_sonde

279 stars 99 forks source link

0.0.0.0 as ip #452

Closed dl9rdz closed 2 months ago

dl9rdz commented 2 months ago
          hello hansi, I also have the connection problem with the new Dev2 version, (wifi mode =1), it sometimes tells me 0.0.0.0 as ip, so (reboot), it did not do it with dev1, it automatically switched from my Box to my 4G router in the car, and this every time I leave the house, is there a solution?, cdt

_Originally posted by @14ri004 in https://github.com/dl9rdz/rdz_ttgo_sonde/issues/449#issuecomment-2307964016_

dl9rdz commented 2 months ago

I have seen this myself once, but not able to reproduce reliably.

My code has not changed at all and does what "official" examples are doing (calling WiFi.localIP() after WiFi.isconnected() returns true), but my suspicion is that isconnecteed might return true after WiFI association but before an IP address was assigned via DHCP. Maybe the timing is a bit different with the new IDF, I did not find any significant changes there either.

In any case, I thing I will make an attempt using the "got an IP address" events to update the IP address. Or maybe just checking for WiFi.ready() instead of WiFi.isconnected()?

dl9rdz commented 2 months ago

This might be related, i.e. other projects do have similar issues with arduino-esp 2.x and 3.x. (dev2 is 3.0.4, the old devel was the by-now very outdated 1.8.x)

https://github.com/espressif/arduino-esp32/issues/8069

dl9rdz commented 2 months ago

(Mainly for me, to remember this) There is one important difference:

dl9rdz commented 2 months ago

dev20240824 should now always wait for the IP address.