You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I need some help understanding the current issue that I am having.
Problem
In my original POC (using the code found in the mqtt examples) I subscribed to my topics before creating a thread that would WaitMessage and Ping, which worked fine. Being able to publish messages fine as well.
I plan to change it so that upon request, a MQTT module will connect to the requested topics, which can happen at any time during the runtime of the program.
Scenarios
While trying some ideas to solve the problems I hit two roadblocks.
Scenario 1
With some minor adjustments to the base subscribe code: rc = MqttClient_Subscribe(&mqttCtx->client, &mqttCtx->subscribe); returns MQTT_CODE_CONTINUE. I added a do while loop which keeps me stuck in an infinite loop.
PendResp Found: 0x2000c8d0, Type Subscribe Ack (9), ID 1, InProc 0, Done 0
MqttClient_WaitType: Type Subscribe Ack (9), ID 1, State 0-0
Scenario 2
This might be completely wrong, because I did not see it in the multithread example, but I added a wm_Sem that the code below will make use of. PUBLISH, SUBSCRIBE and UNSUBSCRIBE utilize the same 1 with mqtt_get_packetid_threadsafe()
You'll want to reinitialize the command structures in between successful calls. So for scenario 1, are you zeroing the structure before calling subscribe? Could you share the full context of the API call?
For scenario 2, same question. Are you clearing the ping structure in between successful calls?
Could you tell us a bit about your project using wolfMQTT? Feel free to create a support ticket by emailing [email protected] for a more private conversation.
It seems like after mqtt_get_packetid_threadsafe(s). mqttCtx gets zeroed in its entirety
I don't really undestand what is going on with scenario 2, but my guess is that resolving that issue would just lead back to Scenario 1. Not confident about this assumption though.
Hi,
I think I need some help understanding the current issue that I am having.
Problem
In my original POC (using the code found in the mqtt examples) I subscribed to my topics before creating a thread that would WaitMessage and Ping, which worked fine. Being able to publish messages fine as well.
I plan to change it so that upon request, a MQTT module will connect to the requested topics, which can happen at any time during the runtime of the program.
Scenarios
While trying some ideas to solve the problems I hit two roadblocks.
Scenario 1
With some minor adjustments to the base subscribe code:
rc = MqttClient_Subscribe(&mqttCtx->client, &mqttCtx->subscribe);
returns MQTT_CODE_CONTINUE. I added a do while loop which keeps me stuck in an infinite loop.Scenario 2
This might be completely wrong, because I did not see it in the multithread example, but I added a wm_Sem that the code below will make use of. PUBLISH, SUBSCRIBE and UNSUBSCRIBE utilize the same 1 with mqtt_get_packetid_threadsafe()
The result will be that
rc = client->net->write(client->net->context, buf, buf_len, timeout_ms);
returns -1.Some additional info
Zephyr RTOS
I am connected to a MQTT Broker using TLSv1.3
Any insight is greatly appreciated!
The text was updated successfully, but these errors were encountered: