Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT5 support. #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

MQTT5 support. #168

wants to merge 1 commit into from

Conversation

dustin
Copy link

@dustin dustin commented Sep 22, 2019

I'm not quite sure how to make a nice way to move properties around or whether to build a better abstraction to specify the protocol than lwmqtt_protocol_t, e.g.:

homePub.begin(homeMQTTServer, 1883, homeESPClient, LWMQTT_MQTT5);

The important thing to me was to pass in enough properties to publish sensor readings with a timeout so I can keep them available while they remain relevant, but have them expire if they're not being properly updated. e.g.:

        char topic[64];
        char msg[32];

        bool retain(true);
        
        lwmqtt_property_t proplist[] = {
          {.prop = LWMQTT_PROP_MESSAGE_EXPIRY_INTERVAL, .value = {.int32 = 1800}},
        };
        lwmqtt_properties_t props = {1, (lwmqtt_property_t *)&proplist};

        snprintf(topic, sizeof(topic), "%s/counter", base);
        snprintf(msg, sizeof(msg), "%d", counter);
        if (!homePub.publish(topic, msg, strlen(msg), retain, homeQoS, props)) {
            return false;
        }

@dustin
Copy link
Author

dustin commented Mar 9, 2020

This seems to have fallen behind a bit. I'm still using my branch as the v5 stuff is important for my use cases. Is there anything significant to be done here?

@256dpi
Copy link
Owner

256dpi commented Mar 10, 2020

Hi @dustin, sorry about that! My plan I is still to implement MQTT5 in shiftr.io to have a service to test the implementation with. This should happen soon, but ATM I'm fully committed to another project. If you don't mind I'd like to leave things like this for now and revisit this later. People that need MQTT5 will eventually find this PR and probably have the experience to get it up and running.

@gleanlux
Copy link

I would like to ask, will there be MQTT5 support in the near future?
Thank you very much for your work!
Regards:
Gábor

@dustin
Copy link
Author

dustin commented May 22, 2021

I'm still running my fork which works quite well (I pretty much require expiring retained messages), but there are some conflicts with later changes I've not looked into.

@schkovich schkovich mentioned this pull request Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants