-
Notifications
You must be signed in to change notification settings - Fork 397
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
Now can't build with Core 2.3.0? #60
Comments
Yeah, commit 9b0cc37 builds under 2.3.0 People who don't sit on the bleeding edge of everything might want to know. |
It would have been better to commit 036ea44 to a "staging" branch and keep master compatible with stable 2.3.0. I'm too receiving issues in ESPurna firmware and fauxmoESP library due to this... |
it would have actually been best to have some sort of define switch that could be used to make it compatible with both but seems that the lwip headers were not updated together with the lib :( |
I'm running 2.4.0 and I'm getting the same errors. |
@kherNI how come? Changes were checked. Maybe you are running ssl? |
I just tried with the standard example. The Board Manager has : https://github.com/esp8266/Arduino/releases/download/2.4.0-rc2/package_esp8266com_index.json Here is the compiler message:
|
Something is wrong. This can not be 2.4.0 |
You're right. I just did a git clone for the standard ESP8266 and this repository and now it compiles fine. Sorry about that. Thanks for all your help on this platform! |
could you @me-no-dev maybe add a condition based on |
Fixed in master and can be closed? |
I still get the compilation errors when using the latest master branch of this project and the following setup: Ubuntu 16.04 (amd64) I wouldn't consider this closed, it's a problem because it doesn't work "out of the box" with a standard installation! Is this a matter of putting some macros somewhere to select between different function signatures? |
The root problem seems to be the hard-coding of "long" instead of "err_t". err_t is defined in lwip/err.h, and in my case maps to "s8" (signed char). I created a patch, but I'm a noob to git/github, so I don't know the proper way to upload it. I put it inline here wrapped in a triple backtick block. If this work for you, please speak up and let's get this into the master branch! index 593d6d6..433d318 100644
--- a/src/ESPAsyncTCP.cpp
+++ b/src/ESPAsyncTCP.cpp
@@ -478,23 +478,23 @@ void AsyncClient::_s_dns_found(const char *name, const ip_addr *ipaddr, void *ar
reinterpret_cast<AsyncClient*>(arg)->_dns_found(ipaddr);
}
-long AsyncClient::_s_poll(void *arg, struct tcp_pcb *tpcb) {
+err_t AsyncClient::_s_poll(void *arg, struct tcp_pcb *tpcb) {
return reinterpret_cast<AsyncClient*>(arg)->_poll(tpcb);
}
-long AsyncClient::_s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, long err) {
+err_t AsyncClient::_s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err) {
return reinterpret_cast<AsyncClient*>(arg)->_recv(tpcb, pb, err);
}
-void AsyncClient::_s_error(void *arg, long err) {
+void AsyncClient::_s_error(void *arg, err_t err) {
reinterpret_cast<AsyncClient*>(arg)->_error(err);
}
-long AsyncClient::_s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len) {
+err_t AsyncClient::_s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len) {
return reinterpret_cast<AsyncClient*>(arg)->_sent(tpcb, len);
}
-long AsyncClient::_s_connected(void* arg, void* tpcb, long err){
+err_t AsyncClient::_s_connected(void* arg, void* tpcb, err_t err){
return reinterpret_cast<AsyncClient*>(arg)->_connected(tpcb, err);
}
@@ -973,7 +973,7 @@ long AsyncServer::_accept(tcp_pcb* pcb, long err){
return ERR_OK;
}
- long AsyncServer::_s_accept(void *arg, tcp_pcb* pcb, long err){
+ err_t AsyncServer::_s_accept(void *arg, tcp_pcb* pcb, err_t err){
return reinterpret_cast<AsyncServer*>(arg)->_accept(pcb, err);
}
diff --git a/src/ESPAsyncTCP.h b/src/ESPAsyncTCP.h
index 1e72dfd..2954b37 100644
--- a/src/ESPAsyncTCP.h
+++ b/src/ESPAsyncTCP.h
@@ -26,6 +26,7 @@
#include "IPAddress.h"
#include <functional>
#include "lwip/init.h"
+#include "lwip/err.h"
class AsyncClient;
@@ -97,11 +98,11 @@ class AsyncClient {
#else
void _dns_found(const ip_addr *ipaddr);
#endif
- static long _s_poll(void *arg, struct tcp_pcb *tpcb);
- static long _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, long err);
- static void _s_error(void *arg, long err);
- static long _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len);
- static long _s_connected(void* arg, void* tpcb, long err);
+ static err_t _s_poll(void *arg, struct tcp_pcb *tpcb);
+ static err_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err);
+ static void _s_error(void *arg, err_t err);
+ static err_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len);
+ static err_t _s_connected(void* arg, void* tpcb, err_t err);
#if LWIP_VERSION_MAJOR == 1
static void _s_dns_found(const char *name, struct ip_addr *ipaddr, void *arg);
#else
@@ -234,14 +235,14 @@ class AsyncServer {
protected:
long _accept(tcp_pcb* newpcb, long err);
- static long _s_accept(void *arg, tcp_pcb* newpcb, long err);
+ static err_t _s_accept(void *arg, tcp_pcb* newpcb, err_t err);
#if ASYNC_TCP_SSL_ENABLED
int _cert(const char *filename, uint8_t **buf);
long _poll(tcp_pcb* pcb);
long _recv(tcp_pcb *pcb, struct pbuf *pb, long err);
static int _s_cert(void *arg, const char *filename, uint8_t **buf);
- static long _s_poll(void *arg, struct tcp_pcb *tpcb);
- static long _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, long err);
+ static err_t _s_poll(void *arg, struct tcp_pcb *tpcb);
+ static err_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err);
#endif
};
|
@fdarling that worked perfectly for me, thanks! |
@whitebird can you upload the patched variant somewhere? |
@me-no-dev would it make sense to change |
I think we should be using
You can verify this by checking the source. Under Linux, using the boards manager version of the esp8266 core, the header resides here: You can also see this from their lwIP's online documentation: |
@max5555 I've uploaded it here: |
merged ;) |
Requires AsyncTCP. See issue: me-no-dev/ESPAsyncTCP#60 No delays during processing of web page requests. Deffered debug messages to main loop for later display. Much faster, seems more reliable, but not 100%. Sometimes the web pages still fail to appear after the debug message indicates they have been sent. Hope it's good enough. Also: - Consolidate misc config web pages to single Pages.h file. - config.interval added as count of wakeups before checkin - Added RFon flag in RTC memory so that sleeping with RF off can allow low power wake without RF, and then restart to turn RF on as needed. - Check config and inputs to see if we need to turn RF on or if we can just go back to sleep, before actual setup. - DEBUGGING define to remove extra code when not doing debugging. - Added 1 minute debug with all status and memory count - When logging data to the server, don't send anything to the device if the server didn't tell us to. It was always sending nul which caused a blink... - Boolean flag havedata to avoid checking rxbuf.length during main loop. This was to try to avoid having to switch to AsyncWebServer as the standard web server was unreliable when the extra code was needed in the loop. Probably not necessary now, but whatever.
Just started trying to use this library yesterday, and I'm thinking your fixes to support 2.4.0 might have broken support for 2.3.0?
I really don't want to upgrade to 2.4.0 before it's had a chance to bleed a bit...
...I guess I will try to download the prior version of your library, but figured I should mention this first.
The text was updated successfully, but these errors were encountered: