Author Topic: MQTT QoS and Retain  (Read 9554 times)

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #15 on: June 24, 2016, 06:30:14 am »
I see no connection yet from your mcGateway, maybe you need to reboot it for the new connection to take place.

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #16 on: June 24, 2016, 06:35:55 am »
Now i see that you are connected and i also see that you are publishing with QoS2

Example this:
Received PUBLISH from plains203 (d0, q2, r0, m1, 'MC/TempC/Bedroom

So everything seems to be working ok.

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #17 on: June 24, 2016, 06:46:34 am »
Ok now it's strange because I have received 27.625 on MC/TempC/Lounge with QoS 1 so your setup works and mine is not showing me anything when I sue that QoS tag. I don't get it. I will need to update my gateway firmware to the newest version and test again I guess.
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #18 on: June 24, 2016, 06:57:51 am »
I recieved a good number of messages and most were tagged but occasionally the tag seemed to be missing on a couple of them.

[ Guests cannot view attachments ]
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #19 on: June 24, 2016, 07:07:28 am »
With Tag you mean the QoS?

That I did on purpose.

But what i have seen is that QoS 0 and 1 is working on my client on my pc and 0, 1 and 2 is working on the mqtt broker, but if i publish a message with q2 from mcModule then the broker gets it but not my client.

I dont know what happening here but i will make some more tests.
For now, upgrade your mcGateway to latest firmware and make some test with QoS 0 and QoS 1 and verify if that is working.

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: MQTT QoS and Retain
« Reply #20 on: June 24, 2016, 08:42:40 am »
I believe there might be some issues here with the way the QoS is handled by the gateway I will do some testing today and keep you informed.
Like Like x 1 View List

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #21 on: June 24, 2016, 08:50:28 am »
Thanks, yes I agree there is something strange going on with the QoS.

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #22 on: June 24, 2016, 08:53:18 am »
A few of your messages came through with retain flags Kristofferis. Did you send though through the modules or just using a MQTT Client?
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #23 on: June 24, 2016, 08:55:49 am »
0 and 1 worked from my modules but not 2.
The 2 that you did see was a test from my client to verify that the broker worked with 2.

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #24 on: June 24, 2016, 09:08:23 am »
I received a retain flag on 3 messages as per this screenshot.

[ Guests cannot view attachments ]
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #25 on: June 24, 2016, 09:13:33 am »
Ahh, my answer will be better if I actually reads the question  :)
Yes all the messages with retain was from my client not mcGateway.
Like Like x 1 View List

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #26 on: June 24, 2016, 09:17:47 am »
Ok thanks that clears that up for me then. I will try on the weekend with the qos 1 option but now it is late. Thanks for your help & I'll be interested to hear from you mc-Abe. Also I think I noticed a debug log option in mcStudio, I should try that.
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: MQTT QoS and Retain
« Reply #27 on: June 24, 2016, 12:56:18 pm »
There are definitely some issues around the QoS. I am investigating and will have a solution soon.
Winner Winner x 1 View List

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #28 on: June 24, 2016, 01:00:30 pm »
Good work Abe, and as always just let me know if you need a hand.

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: MQTT QoS and Retain
« Reply #29 on: June 24, 2016, 06:58:49 pm »
Just wanted to let you know that I have resolved this issue but need to do a lot more testing as it was a big change. We will have an update at some point next week that will fix this.

The issue I discovered explains why no QoS2 (Exactly One) MQTT messages get to the subscriber. It was also not honoring proper operation for QoS1 (At Least Once) and messages could have ended up not being delivered.
Like Like x 2 View List