espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
267 stars 164 forks source link

Conflicting coreMQTT and coreHTTP network_transport modules (CA-348) #232

Open rodmaz opened 2 weeks ago

rodmaz commented 2 weeks ago

Checklist

Issue or Suggestion Description

Both coreMQTT and coreHTTP components uses different port/network_transport modules but sharing same symbols. When integrating both components, linker complains about duplicated symbols. Besides, network_transport.cin coreMQTT seems more sophisticated that the one used in coreHTTP. Why?

avsheth commented 5 days ago

Hi @rodmaz Ideally the build system should pick the network_transport.o object based on the order of the components in the CMakeLists and linker shouldn't have seen multiple definitions. This theory holds for the ota_http example on release/202210.01-LTS branch. But I suppose that's true if both components dependency for a single library. Can you help share the branch you're on and share the error logs as well as your CMakeLists changes?

But agree that it kind of introduces a subtle bug as well where one gets picked over the other and another one is ignored silently.

About differences between the two files, there are couple of reasons:

  1. The latest LTS release introduces new APIs for MQTT transport to set the connect, receive and send timeouts individually at runtime to help applications control the latency and wait time for various requests (publish, subscribe, suback etc). Since this was more from the context of device control over MQTT, we haven't yet added the same in the HTTP transport.
  2. Latest AWS IoT LTS release, 202406.01, has moved to Modular OTA now. For which, application can control and customise the transport, job document etc, to suit their needs. For reference, MQTT stream is used as streaming medium for the OTA, hence coreMQTT transport has been updated with those API to manage OTA latency as well.

Hope this helps.