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

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #30 on: June 24, 2016, 07:02:50 pm »
Thanks heaps for letting us know. This should be a nice improvement for my device that has flakey connectivity with the gateway.
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 #31 on: June 29, 2016, 04:01:35 pm »
We just uploaded a new version of the mc-Gateway. This should have resolved the QoS issue. Note that we are still not supporting the Retain feature.
Like Like x 2 View List

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: MQTT QoS and Retain
« Reply #32 on: June 29, 2016, 04:07:19 pm »
Perfect, thanks.

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #33 on: June 29, 2016, 05:52:38 pm »
I am having another issue now that I have added a second event to my I am finding that some of my modules aren't sending messages but are still sending beacons. I changed one string value between modules and some are working some are not. They all sent out one message after programming. I also attempted to connect to one module in mcSudio and had it connect to a different one about 5 different times. This only started after I had 6 instead of 3 talking. I had to restart mcStudio a few times to get the connection to work. I will paste my messy code below so you can see it.

Class Temperature
    Const area As String = "Outside"
   
   
    Shared Event GetTemp() RaiseEvent Every 2 Minutes
       
        Dim TempC As Float = TempSensor.GetTemp
        //Dim TempF As Float = TempSensor.ToFarenheit(TempC)
        Dim payload As ListOfByte = New ListOfByte
        Dim payString As String = ""
        Dim decpos As Integer
        Dim topic As String
       
        topic = "MC/TempC/" + area
       
        //TempC = (TempC * 10).ToInteger() / 10
       
        payString = TempC.ToString
        decpos = payString.IndexOf(46, 0)
        payString = payString.SubString(0, (decpos + 2))
        payload.Add(payString)
       
        Lplan.Publish(topic, payload)
       
    End Event
   
    Shared Event CheckVoltage() RaiseEvent Every 6 Hours
        Dim BattVolt As Short = Device.BatteryVoltage
        Dim voltpayload As ListOfByte = New ListOfByte
        Dim voltstring As String       
        Dim topic As String
       
        topic = "MC/Voltage/" + area
       
        voltstring = BattVolt.ToString
        voltpayload.Add(voltstring)
        Lplan.Publish(topic, voltpayload)
       
    End Event
   
End Class
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 #34 on: June 30, 2016, 03:05:06 am »
And the problem started when you added the CheckVoltage() event?

If you delete that part of the code and upload to all your modules then they all are sending as they should?

plains203

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: MQTT QoS and Retain
« Reply #35 on: June 30, 2016, 08:27:00 am »
Been out all day and night but to answer a few of them worked perfectly with this code and others only published 3 or 4 updates. I changed the battery voltage to report every 2 minutes and then the rest of the modules report correctly although they occasionally only publish the temperature and not the voltage. It seems like there is something going wrong with the build function in mcStudio because I rebuilt and re flashed the code on one of the modules that had the 6 hour voltage publish and it worked properly after that, with the same code it was failing with. I have since updated the gateway firmware to the next revision.
McGateway 0.6-360, 0.7-405
McModules 0.7-358
McStudio 0.7-894