CoAP + HTTP possible on ESP32?

I have a situation where I’m needing to have the ESP32 act as an HTTP client. This same ESP32 also needs to talk to Golioth via CoAP.

I’m running into issues where implementing the basic HTTP client on the ESP also starts causing CoAP issues. Specifically, I’m getting a “failed to open a connection” error on the http client, and getting an intermittency on the CoAP side of things.

I wanted to check: Is there anything under the hood that would cause conflicts between these two? Both CoAP and HTTP are application layer protocols, so I’m assuming they shouldn’t step on each others “toes”, but I wanted to see if there’s an issue I’m not aware of.

Hi Seth!

I don’t think we’ve tried running both yet, but I agree, in theory there shouldn’t be anything fundamental that prevents HTTP and CoAP from coexisting. Just curious, what are you trying to run over HTTP?

Can you share a minimal example that reproduces the issue?

Thanks,
Sam

Hi Seth,

I was able to get HTTP and CoAP running side-by-side by taking the ESP-IDF http_request example and adding it in to our golioth_basics example. Can you try that and see if it works for you?

Best,
Sam

Hi Sam,

Thanks for checking that. I’ll have to give it a try at some point.

At the moment, we decided to take another path, which is to just run a small server which will do the http requests, and post it as a setting in Golioth.

Thanks,
Seth

Hi @sam,
I am currently facing the same problem can and i could find your example in golioth-zephyr-sdk can you please share the link.

Hi @mkabaoglu!

This topic is referencing ESP-IDF and our cross platform SDK, golioth-firmware-sdk. It sounds like you’re using Zephyr and our Zephyr specific SDK. Can you open a new post with details of the issue you’re having? That will help reduce noise and unnecessary notifications for this topic. In that new post, it would be great to get information on exactly what error you’re seeing, which version of the SDK you’re using, and what hardware you’re using.

Thanks!
Sam

Hi @sam,
Thank you for your response i have figured it out.
My problem was that i couldnt create more than one TLS context it seems there is a option named CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS.

1 Like