I'm not sure why you closed this ticket and especially deleted all content.
Retry happens at the top level, so entire publish sequence will be repeated (which may be an issue for QoS2, but it's cunningly not supported). The only issue then is that PUBLISH will be retried with new packet ID, unlike standard says. That can be fixed, but would require few lines => more memory pressure. So, unless given non-speculative evidence that this is a real problem for esp8266 software which affects many people, I'd consider this "known issue".
I am interested to know too
qos 2 is needed sometimes
Yes, implementing support for QOS 2 will increase the code size of the
umqtt.simplemodule. Currently thepublishmethod only handles QOS 0 and 1 and the logic for receivingPUBLISHpacket from the server in thewait_msgmethod also only handles QOS 0 and 1.For QOS 1 the method has to listen for a
PUBACKpacket from the server after it sends aPUBLISHpacket.For QOS 2 the client, after sending the
PUBLISHpacket, has to listen for aPUBRECpacket from the server, then send aPUBRELpacket and then listen for aPUBCOMPpacket.The simplistic way to implement this would be to handle all this in a synchronous, blocking fashion, i.e. for publishing client -> server, in the method
publishreplace theassertin line 142 with somethings like this (pseudo code):And for receiving QOS 2 from server -> client, do something like this in the
wait_msgmethod at line 197:The problem with this is:
PUBRECorPUBCOMPresp. thePUBRELpackage, the client will block forever (same it does currently with QOS 1, if noPUBACKis received)-.The only way I see around these problems is handling reception of all packet types in
wait_msgand passing them to different callback methods. But that would a) make a record of sent and received packet ids necessary (which increases memory requirements) and b) go against the stated goal of the module to avoid "callback hell".@SpotlightKid Thank you so much!!
this was so helpful indeed, my gratitude.
@SpotlightKid Thank You ! that's pretty awesome
Is this still relevant? Are there other MQTT implementations that people know of that support QoS 2 ?