I’m not following 100% what you’re saying here, but a couple of things jump out.
It’s not a great idea to have a device subscribed to a topic, and then have the same device publish to that topic. You seem to be saying that this is something you are doing, and it could lead to an endless loop of outgoing and incoming topics.
Issues with Char variable types is one of the biggest problems (as far as I’m concerned) when using PubSubClinet to publishing, subscribing and handling messages. I hate Char variables - this is probably more about my lack of understanding, but that doesn’t stop me hating them!
I explained a bit about my my approach to MQTT in this post…
The c_str()
command is your friend when it comes to converting stuff to Char variable types.
I cant really comment more without seeing your code, but happy to help anyone who makes the move over to the dark side.
Pete.