-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiFi.localIP() returns 255.255.255.255 after connect #4732
Comments
Found the problem ! WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); This kills WiFi.localIP() on Core 1.0.5 rc6 ... |
done :) thanks for finding this |
When using this workaround, WiFi.localIP() returns 255.255.255.255 after a successful wifi connect and the signal k server can't be found with mdns. I tested that for the ESP8266 v2 with platform version Espressif 8266 v2.6.3 see here: espressif/arduino-esp32#4732
When will the be fixed? |
wow, surprisingly it's still there! |
Yes, I ran into this bug too. As mention before, no problem if I remove the bugfix for "hostname not sent via dhcp" - >#2537. Is that the final/only solution? Hoping for some words of wisdom from the devs. |
@me-no-dev Can you please test this again? |
Same issue here in all around the projects. :'( |
@YordanYanakiev tested on v2.0.3-rc1? |
yes, also the previous ones downto 2.0.0 |
This issue is linked to #6610 |
The main issue is that <lwip/inet.h> declares When <lwip/inet.h> is included, it makes the Arduino declaration of "IPAddress INADDR_NONE(0,0,0,0)" invalid. This process occurs in all the WiFi/ETH Arduino Libraries. |
This is the test case used to verify/test this issue and PR Fix: #include <Arduino.h>
#include <WiFi.h>
void setup() {
WiFi.begin("Your_SSID", "Your_wifi_password");
String nodeName = "NODE-" + WiFi.macAddress();
nodeName.replace(":", "");
char _nodeName[20]; nodeName.toCharArray(_nodeName, 20);
WiFi.setHostname(_nodeName);
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE);
WiFi.mode(WIFI_STA);
log_i("Connected to: ");
log_i( "%s", WiFi.SSID() );
log_i( "%s", WiFi.localIP().toString().c_str() );
log_i( "%s", WiFi.getHostname());
}
void loop() {
} |
Description of Change Fixes IPAddress INADDR_NONE declaration when using Arduino WiFi or ETH. This symbol was defined as 0xffffffff by lwip /inet.h, making it impossible to use INADDR_NONE correctly. This PR only works when <wifi-provisioning/wifi_config.h> has a modification to include <lwip/ip4_addr.h> instead of <lwip/inet.h>. This will be done directly to the sdk folder in the github structure and it has been fixed in IDF by a separated Merge Request. This will be reflected in the future, for good. Tests scenarios This PR was tested with all Arduino WiFi examples, including AsyncUDP. Also with ETH examples. It was also tested for #6610 test cases. Testing done for ESP32, ESP32-S2, ESP32-C3 and ESP32-S3. Related links fixes #6610 fixes #6247 fixes #4732
Description of Change Fixes IPAddress INADDR_NONE declaration when using Arduino WiFi or ETH. This symbol was defined as 0xffffffff by lwip /inet.h, making it impossible to use INADDR_NONE correctly. This PR only works when <wifi-provisioning/wifi_config.h> has a modification to include <lwip/ip4_addr.h> instead of <lwip/inet.h>. This will be done directly to the sdk folder in the github structure and it has been fixed in IDF by a separated Merge Request. This will be reflected in the future, for good. Tests scenarios This PR was tested with all Arduino WiFi examples, including AsyncUDP. Also with ETH examples. It was also tested for espressif#6610 test cases. Testing done for ESP32, ESP32-S2, ESP32-C3 and ESP32-S3. Related links fixes espressif#6610 fixes espressif#6247 fixes espressif#4732 Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
In This arduino libraries bugs and workaround for hostname on esp32 ... use: to get config definitions of ip 0.0.0.0 and be able to obtain dhcp values. best regards
|
@rysiulg - The PR #6659 works for Arduino Core 2.0.3 onward.
|
* Tasmota changes * Fixes INADDR_NONE (espressif#6659) (#136) Description of Change Fixes IPAddress INADDR_NONE declaration when using Arduino WiFi or ETH. This symbol was defined as 0xffffffff by lwip /inet.h, making it impossible to use INADDR_NONE correctly. This PR only works when <wifi-provisioning/wifi_config.h> has a modification to include <lwip/ip4_addr.h> instead of <lwip/inet.h>. This will be done directly to the sdk folder in the github structure and it has been fixed in IDF by a separated Merge Request. This will be reflected in the future, for good. Tests scenarios This PR was tested with all Arduino WiFi examples, including AsyncUDP. Also with ETH examples. It was also tested for espressif#6610 test cases. Testing done for ESP32, ESP32-S2, ESP32-C3 and ESP32-S3. Related links fixes espressif#6610 fixes espressif#6247 fixes espressif#4732 Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> * Update README.md Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Hardware:
Board: ESP32-WROOM-32
Core Installation version: 1.0.4 & 1.0.5 rc6
IDE name: Arduino 1.8.13
Description:
With 1.0.6 - any version i get always 255.255.255.255 as IP address from WiFi.localIP()
Code:
log_i("Connected to: ");
log_i( "%s", WiFi.SSID() );
log_i( "%s", WiFi.localIP().toString().c_str() );
Core 1.0.4 returns:
[I][Test-2020.ino:85] setup(): Connected to:
[I][Test-2020.ino:86] setup(): NET1
[I][Test-2020.ino:87] setup(): 192.168.0.169
Core 1.0.5 rc1 to rc6 returns:
[I][Test-2020.ino:85] setup(): Connected to:
[I][Test-2020.ino:86] setup(): NET1
[I][Test-2020.ino:87] setup(): 255.255.255.255
Tested all rc versions - no luck. Code runs only on 1.04 flawless. Any suggestions ?
Thank you !
The text was updated successfully, but these errors were encountered: