[X] I have read the documentation for esp-protocols components and the issue is not addressed there.
[X] I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
I am using BG96 to connect to AWS iot Core over MQTT.
I am using the newest libs foir boith esp-modem and esp-aws-iot
I am trying to combine pppos_client axample from esp-modem with mqtt_demo_mutual_auth from esp-aws-iot.
I have all the appropriate certs and keys embedded, and the modem initializes well, and I get an IP address.
The demo file mqtt_demo_mutual_auth.c calls xTlsConnect and this fails with TLS_TRANSPORT_CONNECT_FAILURE.
Researching online, it looks like there is an issue that esp-modem uses lwip, but the esp-aws-iot wants TCP. Indeed, the example files in esp-modem all use the esp-mqtt library, which appears to use lwip. My assumption is that xTlsConnect is not finding the network connection at all.
One problem with trying to learn using the example files is that most of them use C++, so trying to emulate ex. modem_tcp_client for a C context is very hard.
How can I use these 2 powerful libraries together?
Would it be possible to publish an example file using C, and not C++?
it turns out xTlsConnect requires a very long timeout.
In coreMQTT/port/network_transport.c, I changed xEspTlsConfig.timeout_ms = 10000.
Now everything works well.
Answers checklist.
General issue report
I am using BG96 to connect to AWS iot Core over MQTT.
I am using the newest libs foir boith esp-modem and esp-aws-iot I am trying to combine pppos_client axample from esp-modem with mqtt_demo_mutual_auth from esp-aws-iot.
I have all the appropriate certs and keys embedded, and the modem initializes well, and I get an IP address.
The demo file mqtt_demo_mutual_auth.c calls
xTlsConnect
and this fails withTLS_TRANSPORT_CONNECT_FAILURE
.Researching online, it looks like there is an issue that esp-modem uses lwip, but the esp-aws-iot wants TCP. Indeed, the example files in esp-modem all use the esp-mqtt library, which appears to use lwip. My assumption is that
xTlsConnect
is not finding the network connection at all.One problem with trying to learn using the example files is that most of them use C++, so trying to emulate ex. modem_tcp_client for a C context is very hard.
How can I use these 2 powerful libraries together? Would it be possible to publish an example file using C, and not C++?