Comments (7)
I add the lines above with the + on them
I got this:
/Users/jcdonelson/Documents/Arduino/libraries/ESPAsyncWebServer/src/AsyncWebSocket.cpp: In member function 'void AsyncWebSocketClient::_queueMessage(AsyncWebSocketMessage*)':
/Users/jcdonelson/Documents/Arduino/libraries/ESPAsyncWebServer/src/AsyncWebSocket.cpp:551:7: error: 'ets_printf' was not declared in this scope; did you mean 'vswprintf'?
551 | ets_printf("ERROR: Too many messages queued\n");
| ^~~~~~~~~~
| vswprintf
If I comment out line 551 then it all compiles.
from espasyncwebserver.
This needs guardrails for when to include, but here are the necessary includes
diff --git a/src/AsyncEventSource.cpp b/src/AsyncEventSource.cpp
index f2914df..230e3f6 100644
--- a/src/AsyncEventSource.cpp
+++ b/src/AsyncEventSource.cpp
@@ -19,6 +19,7 @@
*/
#include "Arduino.h"
#include "AsyncEventSource.h"
+#include "rom/ets_sys.h"
static String generateEventMessage(const char *message, const char *event, uint32_t id, uint32_t reconnect){
String ev = "";
diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp
index f76f2fc..ef94775 100644
--- a/src/AsyncWebSocket.cpp
+++ b/src/AsyncWebSocket.cpp
@@ -28,6 +28,7 @@
#else
#include <Hash.h>
#endif
+#include "mbedtls/compat-2.x.h"
#define MAX_PRINTF_LEN 64
@@ -829,7 +830,7 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer)
IPAddress AsyncWebSocketClient::remoteIP() {
if(!_client) {
- return IPAddress(0U);
+ return IPAddress(0,0,0,0);
}
return _client->remoteIP();
}
diff --git a/src/WebAuthentication.cpp b/src/WebAuthentication.cpp
index 45246a1..01fb567 100644
--- a/src/WebAuthentication.cpp
+++ b/src/WebAuthentication.cpp
@@ -22,6 +22,7 @@
#include <libb64/cencode.h>
#ifdef ESP32
#include "mbedtls/md5.h"
+#include "mbedtls/compat-2.x.h"
#else
#include "md5.h"
#endif
from espasyncwebserver.
This needs guardrails for when to include, but here are the necessary includes
diff --git a/src/AsyncEventSource.cpp b/src/AsyncEventSource.cpp index f2914df..230e3f6 100644 --- a/src/AsyncEventSource.cpp +++ b/src/AsyncEventSource.cpp @@ -19,6 +19,7 @@ */ #include "Arduino.h" #include "AsyncEventSource.h" +#include "rom/ets_sys.h" static String generateEventMessage(const char *message, const char *event, uint32_t id, uint32_t reconnect){ String ev = ""; diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp index f76f2fc..ef94775 100644 --- a/src/AsyncWebSocket.cpp +++ b/src/AsyncWebSocket.cpp @@ -28,6 +28,7 @@ #else #include <Hash.h> #endif +#include "mbedtls/compat-2.x.h" #define MAX_PRINTF_LEN 64 @@ -829,7 +830,7 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer) IPAddress AsyncWebSocketClient::remoteIP() { if(!_client) { - return IPAddress(0U); + return IPAddress(0,0,0,0); } return _client->remoteIP(); } diff --git a/src/WebAuthentication.cpp b/src/WebAuthentication.cpp index 45246a1..01fb567 100644 --- a/src/WebAuthentication.cpp +++ b/src/WebAuthentication.cpp @@ -22,6 +22,7 @@ #include <libb64/cencode.h> #ifdef ESP32 #include "mbedtls/md5.h" +#include "mbedtls/compat-2.x.h" #else #include "md5.h" #endif
Hi lbernstone,
I see there are 3 files that needs to be updated. I can update it manually. However, I like to learn how to update it from your given code. What tool should I use for that? It looks similar to some diffs I've seen very long time ago using patch
command. Thanks a lot!
from espasyncwebserver.
That was a git diff. It was updated with my own 2 hands :) I just looked at what was missing, grep'd for those functions in the arduino-esp32/tools/esp32-arduino-libs/esp32/include folder, and included those files in the correct locations. To make a PR, I need to figure out a way to only include those headers if the version is >3.0.0.
from espasyncwebserver.
Oh got it. I knew I will have issues when Arduino popped up something on the lower right corner. Do you want to update to 3.0.0?
I said yes. Few hours later, I encountered the issues above.
Alrighty, I'll make changes to my local. Thank you.
from espasyncwebserver.
That was a git diff. It was updated with my own 2 hands :) I just looked at what was missing, grep'd for those functions in the arduino-esp32/tools/esp32-arduino-libs/esp32/include folder, and included those files in the correct locations. To make a PR, I need to figure out a way to only include those headers if the version is >3.0.0.
I found this:
#ifdef ESP_ARDUINO_VERSION_MAJOR
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
// Code for version 3.x
#else
// Code for version 2.x
#ifdef ESP32
#else
#endif
#endif
#endif
on h2zero/NimBLE-Arduino#676 (comment), from a comment made by ednieuw. ednieuw says they got this piece of code from the Espressif migration 2.x -> 3.x document. Supposedly, this piece of code makes a library compatible for both ESP32 versions. I hope this helps.
Update: I found a file with a piece a code explaining the manipulation of the ESP32 versions better in the Espressif's official repository for Arduino core for the ESP32. A little bit more information can be found in Espressif's Compatibility Guide for ESP32 Arduino Core page
from espasyncwebserver.
If I comment out line 551 then it all compiles.
Just an observation, but in AsyncWebSocket.cpp
the ets_printf()
function is used 7 times, but 6 of these are commented out. The one that triggers the compile error is the only one that is not commented out. Perhaps that one got missed when the debug lines were added and commented out six years ago.
I can confirm that after making the changes above and commenting out this line, it compiles and seems to work fine on an ESP32 dev board.
from espasyncwebserver.
Related Issues (20)
- Send content with beginChunkedResponse
- Question: is it possible to replicate AsyncWebSocket with WebServer in arduino-esp32 v3.0.0 ? HOT 4
- AsyncWebServer Questions HOT 6
- Images won't load randomly
- I Can't make the web explorer to offer to save credentials
- Change bool AsyncStaticWebHandler::canHandle to use exact match instead of String::startsWith(_uri)
- small ddos (press F5) crash: async_tcp ....watchdog got triggered HOT 1
- Compilation Error for Newer ESP32 HOT 3
- possible memory leak at send_p?
- Forwarding Webserver with websockets HOT 2
- Get new client ID at every refresh :( HOT 1
- Refusing connection when making httpGet request with mDNS
- Problem resolved ? "Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?" HOT 10
- does not compile with ESP32C3
- ESP8266: Compilation error: invalid conversion from 'const AsyncWebParameter*' to 'AsyncWebParameter*' [-fpermissive] HOT 1
- IDF 5 Coexistence support HOT 1
- It is possible Increase buffer size for rx data by websocket?
- Cant set Table or Cell width % because of template processing HOT 2
- Web server hangs up
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espasyncwebserver.