Skip to content

Cannot publish because incorrect flag topic id type #3

@nottledim

Description

@nottledim

Having trouble with your example WiFiUdpMqttSnClient program in that it does not successfully publish the test messages. I'm using paho-mqtt-sn gateway.

I'm bashing around in the dark a bit but I think this is because it publishes the messages with the flag TopicIdType set to 2. I think it should be zero (normal) because it's not pre-registered nor is it a short topic.

In file MqttSnClient.h line 216 the call to send_publish has short_topic set to true. But that's not all; in file mqttsn_messages.h around line 215 if short_topic flag is false it sets the flag to predefined.
I've removed the latter 'else' clause so the flag is set to zero and I can now publish successfully.

I suspect my hack is not a complete solution but I hope it helps you resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions