Hi cnlohr,
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
1: Re: Dependency on lwip: I still cannot seem to figure out how to build smartconfig_ack and components/mbedtls/port/net_sockets, or rather build without these components. My stack does not provided BSD-like functionality.
What I mean is: build with all of the normal IDF components, including LWIP. If your code doesn't call any functions that use any of these things, they shouldn't end up linked into the final binary. So you waste some initial compile time (annoying), but it shouldn't make any difference to the final binary.
The only time this definitely won't work is if you need to replace an IDF symbol with a same-named one in your custom component (shouldn't be needed to swap out LWIP because everything depends on what functions the main app calls), or if a symbol that you want to link in happens to have the same name as a global symbol in one of the IDF components.
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
2: Re: Needing COMPONENT_DIRS: Well, I'll be. I guess I was doing something wrong earlier. Now that I've switched things back around, it seems not to be needed in my base project! That's awesome. [RESOLVED]
Yay!
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
3: Re: Not needing header includes. That is still a negatory. Even if I add esp_wifi to cnip, other subsystems like esp_event do require it. It seems to only be "brought in" for cnip.
Ah... you are probably the first person to really test the validity some of the per-component requirements in ESP-IDF. The root cause is: esp_event includes wifi headers directly, but currently esp_wifi is not in its REQUIRES list even though should be.
In a normal IDF project, it will not matter because the public header requirements chain goes esp_event -> tcpip_adapter -> esp_wifi. Because your project overrides tcpip_adapter, there is no longer a path from esp_event to esp_wifi.
The correct fix is to add esp_wifi to the REQUIRES list of esp_event, will submit a patch for this internally but you can also change this in IDF now.
If you don't include "esp_event_legacy.h" then the modified tcpip_adapter component shouldn't matter, as this is the only header that uses tcpip_adapter.
Probably the other errors will have a similar root cause.
(BTW, this is another thing you won't have to worry about if you can get away with a "build all IDF components, but don't link anything you don't need" approach. However we're very happy to fix these dependency declaration problems in IDF as well, as our long term goal is to allow this kind of approach.)
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
4: Re: __COMPONENT_REQUIRES_COMMON: I believe I have circumvented this by overriding/disabling the following components in my project: asio, esp_http_server, libsodium, smartconfig_ack***, esp_https_ota, lwip, tcpip_adapter**, coap, esp_https_server, mdns, tcp_transport, esp_local_ctrl, mqtt, wifi_provisioning, esp-tls, nghttp, esp_http_client, esp_websocket_client and protocomm.
*** = Even though I am overriding this, it still is attempting to build
** = I have my own copy of this.
What does "attempting to build" mean in this context? You may need to add a dummy idf_component_register() line in the CMakeLists.txt so the build system see a component by this name, for resolving dependencies.
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
5: Re: Performance: Performance is significant. I was more inquiring as to if there was a deliberate architectural shift which would impair performance. I noticed that the performance changes significantly depending on the FLASH Settings. It would appear some functions in the critical path are not in IRAM despite my best efforts. I don't believe I have retries, as it's more of my ping-baseline is at around 1.2-2.4ms. Let's not discuss this any further in this thread though. Performance is almost sufficient for this test.
OK, yes you'll probably need to bring this up with the Wi-Fi team.
No deliberate shift of this kind, in fact the flash cache settings have been changed with the goal of improving performance - but probably there is a lot of benchmarking and tweaking which is yet to be done. The default flash cache settings are probably not the ones which give absolute best performance, at this time.
You probably know this, but note that Wi-Fi will retry at the MAC layer, totally transparently to the IP stack. The only way to tell this is happening is to look at a raw Wi-Fi frame capture. Edit: Never mind, I re-read your posts and realised you're seeing 1.2-2.4ms ping times but 5ms round trips on a WebSocket. This sounds like a tuning issue with the IP stack.
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
6: It is a MARLIN3.
Great!
cnlohr wrote: ↑Fri Nov 08, 2019 9:10 am
Also - I have another question - how can you define two separate modules to rely on each other? Or, more importantly, a module which expects an application to implement a function. It "looks" like you guys may have made an effort to make this impossible, for instance, how tcpip_adapter is triggered from events instead of function calls, but events are much slower than function calls. Is there any mechanism to allow this? Or is it now prohibited and all dependences must be unidirectional? If not, how would I define the cmakelists REQUIRES?
EDIT I misunderstood something - this issue doesn't seem to be inter-module, however, the question does stand for final app linkage.
A "REQUIRES B" clause in component A means "A's public interface includes headers from B". A clause "PRIV_REQUIRES B" means "A's source files include headers from B", or "A links against symbols from B", or both of those. More details here:
https://docs.espressif.com/projects/esp ... quirements
(Because REQUIRES is for the public headers, this is why the relationship is transitive across multiple components. PRIV_REQUIRES is not transitive for header paths.)
The esp_event refactor was intended to remove tight coupling from places where it wasn't needed. We benchmark for performance regressions pretty heavily and nothing much came up, although most wifi events don't happen at a particularly high frequency (packets still go via function calls). If you see a performance regression that can be pinned on the event mechanism then please let us know.