Skip to content
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

Unify the ESP32 and ESP8266 version. #7

Closed
BlackEdder opened this issue Oct 31, 2017 · 14 comments
Closed

Unify the ESP32 and ESP8266 version. #7

BlackEdder opened this issue Oct 31, 2017 · 14 comments
Labels

Comments

@BlackEdder
Copy link

My library works on both ESP32 and ESP8266, but I had trouble getting my project to reliably switch between using AsyncTCP and ESPAsyncTCP depending on the hardware (this was with platformio). In the end I decided to make AsyncTCP also work/compile on ESP8266 hardware. If you are interested the relevant files/changes can be found here:

https://gitlab.com/BlackEdder/painlessMesh/blob/tcp_locking/src/AsyncTCP.h
https://gitlab.com/BlackEdder/painlessMesh/blob/tcp_locking/src/AsyncTCP.cpp

@me-no-dev
Copy link
Owner

switching is quite easy ;) it's done by define switch like here: https://github.com/me-no-dev/ESPAsyncWebServer/blob/master/src/ESPAsyncWebServer.h#L31-L39
Platformio also has ways for that to work (it should with later versions out of the box. also look at the web server lib config).
With what you have above, you first have a copy of this lib and second will miss on development for each platform. It was not worth it keeping them in the same lib because the platforms are vastly different and that will only cause code clutter.
Not to say I do not even see you mention my two libs in your readme ;)

@BlackEdder
Copy link
Author

The problem I keep running into is that when I compile for one board and then the other platformio tries to include both libraries, i.e. I have to delete the temporary directories before I can switch. Maybe I am doing something wrong though, but I'd rather not have users have to deal with that.

Not to say I do not even see you mention my two libs in your readme ;)

The development is on a merge request currently ;) Will certainly add a reference when/if merged

@me-no-dev
Copy link
Owner

@ivankravets have a clue about this? I would rather @BlackEdder not have to use some sort of both libs into one to make it work.

@BlackEdder would be much better if you try to make it work as it should, instead of going the way you went ;)

@BlackEdder
Copy link
Author

@ivankravets You can recreate the issue I mean by running:

git clone https://gitlab.com/BlackEdder/painlessMesh.git
cd painlessMesh
pio run -t upload -e nodemcuv2 -d examples/webServer/
pio run -t upload -e esp32 -d examples/webServer/

The nodemcuv2 build will work, while the esp32 build will fail, because it tries to include ESPAsyncTCP.cpp

@BlackEdder
Copy link
Author

BlackEdder commented Oct 31, 2017 via email

@ivankravets
Copy link
Contributor

@BlackEdder Thanks! I see an error. I'll take a look soon and reply here. Temporary solution is to put ESPAsyncTCP to ignore list for ESP32 build environment

[env:esp32]
...
lib_ignore = ESPAsyncTCP

@BlackEdder
Copy link
Author

@ivankravets Thanks!

I guess there is no lib_ignore for library.json? That way the library that depends on either AsyncTCP or ESPAsyncTCP could lib_ignore the one that causes a conflict :)

@andig
Copy link
Contributor

andig commented Nov 2, 2017

I'm seeing similar problems as @BlackEdder with library resolution, see platformio/platformio-core#1111. I've also switched to lib_ignore for short-term fix. This inlcudes ignoring AsyncTCP on ESP8266, too.

@ivankravets
Copy link
Contributor

This is a bug and we have an issue for that platformio/platformio-core#1153

I'm going to fix it as soon as possible.

@ColomeDisco
Copy link

many thanks! works like a charm!

@stale
Copy link

stale bot commented Sep 21, 2019

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 21, 2019
@stale
Copy link

stale bot commented Oct 5, 2019

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Oct 5, 2019
@gmag11
Copy link

gmag11 commented Nov 19, 2019

I have a similar problem with VisualMicro. When compiling with ESP8266 or ESP32 it tries to include AsyncTCP.h and ESPAsyncTCP.h in both cases. Should I blame VisualMicro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants