Closed
Description
Board
Any (ESP32, ESP32S2, ESP32S3, ESP32C3)
Device Description
Any - it doesn't matter for the issue
Hardware Configuration
Any - it doesn't matter for the issue
Version
latest master (checkout manually)
IDE Name
Any - it doesn't matter for the issue
Operating System
Any - it doesn't matter for the issue
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
115200
Description
It just need to be compiled and the error will be displayed.
Basically IPAddress INADDR_NONE declared in <IPAddress.h> is replaced by an integer due to any network usage in any Arduino sketch. This issue causes a compilation error.
Sketch
// If it DOESN'T include any Network header file, it works perfectly well!
// But it makes no sense to do that and use INADDR_NONE...
#include <WiFi.h>
// or just include <ETH.h>
void setup() {
Serial.begin(115200);
// the code line below causes compilation error
Serial.printf("INADDR_NONE = [%s]", INADDR_NONE.toString());
// This piece of code compiles, but outputs trash: "IP_NONE addr = [⸮⸮⸮?�]"
// it should output [0.0.0.0] instead!
IPAddress addr = INADDR_NONE;
Serial.printf("\n IP_NONE addr = [%s]\n", addr.toString());
}
void loop() {
}
Debug Message
None - just a compilation error message:
Compiling sketch...
C:\Users\espduino\Documents\Arduino\issue_4073_INADDR_UNDEF\issue_4073_INADDR_UNDEF.ino: In function 'void setup()':
issue_4073_INADDR_UNDEF:48:51: error: request for member 'toString' in '4294967295', which is of non-class type 'u32_t' {aka 'unsigned int'}
Serial.printf("INADDR_NONE = [%s]", INADDR_NONE.toString());
^~~~~~~~
Using library WiFi at version 2.0.0 in folder: C:\Users\espduino\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\libraries\WiFi
exit status 1
request for member 'toString' in '4294967295', which is of non-class type 'u32_t' {aka 'unsigned int'}
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Type
Projects
Status
Done
Activity
SuGlider commentedon Apr 21, 2022
The main issue is that <lwip/inet.h> declares
#define INADDR_NONE IPADDR_NONE
and it includes <lwip/ip4_addr.h> that declares#define IPADDR_NONE ((u32_t)0xffffffffUL)
(IP 255.255.255.255)When <lwip/inet.h> is included, it makes the Arduino declaration of "IPAddress INADDR_NONE(0,0,0,0)" invalid. This happens in all the Arduino WiFi and ETH libraries.
VojtechBartoska commentedon Apr 22, 2022
probably related issue #5220 ?
SuGlider commentedon Apr 23, 2022
Yes, it is possible, once IPADDR_NONE will not work at all in Arduino. I'll verify the issue #5220 as well.
update
I checked the issue #5220. WiFiMuilti.ino example seems to be working correctly with 2.0.2 and 2.0.3-RC1.
Thus, it is not related to #6610 issue.
SuGlider commentedon Apr 29, 2022
This is another test case used to verify/test this issue and PR Fix:
issue #4732
8 remaining items