esp-mqtt icon indicating copy to clipboard operation
esp-mqtt copied to clipboard

MQTT5 packet support (IDFGH-7572)

Open KonssnoK opened this issue 2 years ago • 5 comments

This is an ongoing pull request

New features:

  • supports MQTT5 packets
  • support for multiple subscriptions/unsubscriptions

Fixes:

  • events data is now cleaned on new received packet
  • removed some gotos
  • Removed duplicated code related to defines
  • keepalive won't expire if time changes before connect but after initialization

TODO:

  • implement checks for received properties not matching MQTT5 standard (disconnects for protocol errors)

TOCHECK:

  • oversized publish

Note A commit on esp-idf will be required as well, currently: https://github.com/KonssnoK/esp-idf/commit/37cd0998e324d3963b3cc72bf69bbd9e78288247

KonssnoK avatar May 19 '22 06:05 KonssnoK

rebased on top of master and squashed implementation commits into a single one

KonssnoK avatar Jun 09 '22 07:06 KonssnoK

Hi @KonssnoK thank you for your contribution. We have an internal implementation of MQTT5 that was recently merged. Could you please take a look and see if you miss some feature on our implementation?

euripedesrocha avatar Jun 27 '22 17:06 euripedesrocha

@euripedesrocha I'm using esp-idf (master). The esp-mqtt submodule alerady includes the mqtt5 related code but I cannot test mqtt5 because there is no config option to enable it. i.e. CONFIG_MQTT_PROTOCOL_5 is always not defined.

AxelLin avatar Jul 09 '22 06:07 AxelLin

@euripedesrocha I'm using esp-idf (master). The esp-mqtt submodule alerady includes the mqtt5 related code but I cannot test mqtt5 because there is no config option to enable it. i.e. CONFIG_MQTT_PROTOCOL_5 is always not defined.

Hi @AxelLin, there is an idf MR that should be merged soon (there is a trend on our interactions here :) ), it also contains an example of MQTT5 usage.

euripedesrocha avatar Jul 11 '22 10:07 euripedesrocha

Hi @AxelLin , MQTT5 example in idf has been merged. You can test it with newest IDF master branch. If you have any questions during the test, please feel free to ask.

ESP-YJM avatar Aug 01 '22 07:08 ESP-YJM

Closing as MQTTv5 was merged in https://github.com/espressif/esp-idf/commit/5a7b17ff7d39e3768a1ee5a7fe6b04f8dca7f3be and the examples are available in https://github.com/espressif/esp-idf/tree/release/v5.0/examples/protocols/mqtt5

david-cermak avatar Aug 18 '22 14:08 david-cermak

sorry for not keeping up with the discussion, i'm currently working on other stuff, i'll pick up the MQTT5 topic as soon as necessary.

On the PR on IDF, is there any plan to backport to v4.4 or is it to be considered as part of v5.0?

KonssnoK avatar Aug 23 '22 14:08 KonssnoK