khoih-prog / ESPAsync_WiFiManager

This is an ESP32 (including ESP32-S2 and ESP32-C3) / ESP8266 WiFi Connection Manager, using ESPAsyncWebServer, with fallback web configuration portal. Use this library for configuring ESP32, ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson 6.0.0+ as well as 5.13.5- . Using AsyncDNSServer instead of DNSServer now.
MIT License
291 stars 73 forks source link

typedef declaration conflicts #24

Closed malves61 closed 3 years ago

malves61 commented 3 years ago

Khoih,

Please be patient, I'm new on platformio and github, so this is probably a very dumb question and not a real issue.

I started experimenting with ESPAsync_WiFiManager. I am having conflicting typedef declaration when trying to build the example Async_ConfigOnSwitch.ino (renamed it main.cpp on vscode). The declarations are on the underlying libraries, please see the build output below.

Do you see anything that I might have missed? Any hints?

Thank you

malves61


> Executing task in folder ESPbrute-digital-sensor-relay-MQTT: pio run <

Processing ESP8266 (platform: espressif8266; framework: arduino; board: d1_mini_pro)

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html
PLATFORM: Espressif 8266 (2.6.2) > WeMos D1 mini Pro
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.7 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP Async WebServer> 1.2.3
|   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson> 6.17.2
|-- <ESPAsyncTCP> 1.2.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP_DoubleResetDetector> 1.0.3
|   |-- <LittleFS(esp8266)> 0.1.0
|-- <OneButton> 0.0.0-alpha+sha.eb583d713a
|-- <ArduinoJson> 6.17.2
|-- <Adafruit MQTT Library> 2.1.0
|-- <ESPAsync_WiFiManager> 1.3.0
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Hash> 1.0
|   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <ArduinoJson> 6.17.2
|   |-- <ESP_DoubleResetDetector> 1.0.3
|   |   |-- <LittleFS(esp8266)> 0.1.0
|   |-- <DNSServer> 1.1.1
|   |   |-- <WiFi101> 0.16.1
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <WiFi101> 0.16.1
|-- <ESP8266WiFi> 1.0
|-- <LittleFS(esp8266)> 0.1.0
|-- <WiFi101> 0.16.1
Building in release mode
Compiling .pio/build/ESP8266/src/main.cpp.o
src/main.cpp:324:4: warning: #warning Using DHCP IP [-Wcpp]
   #warning Using DHCP IP
    ^
Compiling .pio/build/ESP8266/libb94/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
In file included from .pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager.h:597:0,
                 from src/main.cpp:347:
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:994:3: warning: multi-line comment [-Wcomment]
   // Add option if didn't input/update SSID/PW => Use the previous saved Credentials. \
   ^
Compiling .pio/build/ESP8266/libb94/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Compiling .pio/build/ESP8266/libb94/ESP8266WiFi/WiFiUdp.cpp.o
Compiling .pio/build/ESP8266/libe61/ESPAsyncTCP/AsyncPrinter.cpp.o
Compiling .pio/build/ESP8266/libe61/ESPAsyncTCP/ESPAsyncTCP.cpp.o
Compiling .pio/build/ESP8266/libe61/ESPAsyncTCP/ESPAsyncTCPbuffer.cpp.o
Compiling .pio/build/ESP8266/libe61/ESPAsyncTCP/SyncClient.cpp.o
In file included from .pio/libdeps/ESP8266/WiFi101/src/common/include/nm_common.h:45:0,
                 from .pio/libdeps/ESP8266/WiFi101/src/socket/include/socket.h:60,
                 from .pio/libdeps/ESP8266/WiFi101/src/WiFiUdp.h:24,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src/DNSServer.h:3,
                 from src/main.cpp:103:
.pio/libdeps/ESP8266/WiFi101/src/bsp/include/nm_bsp.h:110:23: error: conflicting declaration 'typedef long unsigned int uint32'
 typedef unsigned long uint32;
                       ^
In file included from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include/ets_sys.h:28:0,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/pgmspace.h:11,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/WString.h:29,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/IPAddress.h:24,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h:31,
                 from src/main.cpp:101:
/home/marcelo/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include/c_types.h:49:29: error: 'uint32' has a previous declaration as 'typedef unsigned int uint32'
 typedef unsigned int        uint32;
                             ^
In file included from .pio/libdeps/ESP8266/WiFi101/src/common/include/nm_common.h:45:0,
                 from .pio/libdeps/ESP8266/WiFi101/src/socket/include/socket.h:60,
                 from .pio/libdeps/ESP8266/WiFi101/src/WiFiUdp.h:24,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src/DNSServer.h:3,
                 from src/main.cpp:103:
.pio/libdeps/ESP8266/WiFi101/src/bsp/include/nm_bsp.h:133:22: error: conflicting declaration 'typedef long int sint32'
 typedef signed long  sint32;
                      ^
In file included from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include/ets_sys.h:28:0,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/pgmspace.h:11,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/WString.h:29,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/IPAddress.h:24,
                 from /home/marcelo/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h:31,
                 from src/main.cpp:101:
/home/marcelo/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include/c_types.h:52:29: error: 'sint32' has a previous declaration as 'typedef int sint32'
 typedef signed int          sint32;
                             ^
Compiling .pio/build/ESP8266/libe61/ESPAsyncTCP/tcp_axtls.c.o
Compiling .pio/build/ESP8266/lib607/Hash/Hash.cpp.o
Archiving .pio/build/ESP8266/libb51/libArduinoJson.a
Indexing .pio/build/ESP8266/libb51/libArduinoJson.a
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/AsyncEventSource.cpp.o
In file included from .pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager.h:597:0,
                 from src/main.cpp:347:
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h: In member function 'void ESPAsync_WiFiManager::scan()':
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:559:16: warning: unused variable 'res' [-Wunused-variable]
           bool res=WiFi.getNetworkInfo(i, wifiSSIDs[i].SSID, wifiSSIDs[i].encryptionType, wifiSSIDs[i].RSSI, wifiSSIDs[i].BSSID, wifiSSIDs[i].channel, wifiSSIDs[i].isHidden);
                ^
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h: In member function 'void ESPAsync_WiFiManager::criticalLoop()':
src/main.cpp:51:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define TIME_BETWEEN_MODELESS_SCANS       30000
                                           ^
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:670:47: note: in expansion of macro 'TIME_BETWEEN_MODELESS_SCANS'
     if (scannow == -1 || millis() > scannow + TIME_BETWEEN_MODELESS_SCANS)
                                               ^
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h: In member function 'boolean ESPAsync_WiFiManager::startConfigPortal(const char*, const char*)':
src/main.cpp:48:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define TIME_BETWEEN_MODAL_SCANS          20000
                                           ^
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:800:48: note: in expansion of macro 'TIME_BETWEEN_MODAL_SCANS'
     if ( scannow == -1 || millis() > scannow + TIME_BETWEEN_MODAL_SCANS)
                                                ^
Archiving .pio/build/ESP8266/libb94/libESP8266WiFi.a
In file included from .pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager.h:597:0,
                 from src/main.cpp:347:
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h: In member function 'boolean ESPAsync_WiFiManager::isIp(String)':
.pio/libdeps/ESP8266/ESPAsync_WiFiManager/src/ESPAsync_WiFiManager-Impl.h:2166:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < str.length(); i++)
                                  ^
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/AsyncWebSocket.cpp.o
Indexing .pio/build/ESP8266/libb94/libESP8266WiFi.a
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/SPIFFSEditor.cpp.o
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/WebAuthentication.cpp.o
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/WebHandlers.cpp.o
Archiving .pio/build/ESP8266/libe61/libESPAsyncTCP.a
Indexing .pio/build/ESP8266/libe61/libESPAsyncTCP.a
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/WebRequest.cpp.o
Archiving .pio/build/ESP8266/lib607/libHash.a
Indexing .pio/build/ESP8266/lib607/libHash.a
Compiling .pio/build/ESP8266/lib8af/ESP Async WebServer/WebResponses.cpp.o
*** [.pio/build/ESP8266/src/main.cpp.o] Error 1
In file included from .pio/libdeps/ESP8266/ESP Async WebServer/src/SPIFFSEditor.cpp:1:0:
.pio/libdeps/ESP8266/ESP Async WebServer/src/SPIFFSEditor.h:16:101: warning: 'SPIFFS' is deprecated (declared at /home/marcelo/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
     SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS);
                                                                                                     ^
====================================================================== [FAILED] Took 3.89 seconds ======================================================================

Environment    Status    Duration
-------------  --------  ------------
ESP8266        FAILED    00:00:03.886
================================================================ 1 failed, 0 succeeded in 00:00:03.886 ================================================================
The terminal process "pio 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.
khoih-prog commented 3 years ago

There is something wrong with your library usage.

The ESP8266 doesn't need WiFi101 library. Adding it will create sure conflict errors.

Just remove all instances of WiFi101 and it'll be OK.

|-- <DNSServer> 1.1.1
|   |   |-- <WiFi101> 0.16.1
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <WiFi101> 0.16.1
|-- <ESP8266WiFi> 1.0
|-- <LittleFS(esp8266)> 0.1.0
|-- <WiFi101> 0.16.1

It's also possible you don't use the correct DNSServer library for ESP8266. Be sure to check.

khoih-prog commented 3 years ago

Another note is that the DNSServer library is included in the ESP8266/ESP32 cores

  1. ESP8266 built-in library => DNSServer Library
  2. ESP32 built-in library . => DNSServer Library

You don't need to download any new DNSServer library at all.

malves61 commented 3 years ago

Thanks for your patience and kind answer. I found WiFi101 referenced at c_cpp_properties.json on the .vscode folder - probably I made a mistake with Intellisense. Deleting .vscode and all libraries from the project and adding khoih-prog/ESPAsync_WiFiManager @ ^1.3.0 to the dependencies did the trick.

khoih-prog commented 3 years ago

That's great. Your complete bug report is very helpful to locate the issue and remember doing the same way next time (hopeful no more issue;=))

Without complete picture, no one can have psychic power to guess what's wrong, so it'll be time-consuming to solve, even the smallest issue.

Cheers,