Announcement

Collapse
No announcement yet.

Bug: "Send Mqtt Message" does not send

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug: "Send Mqtt Message" does not send

    I have created an event that says IF such and such THEN Send Mqtt Message Topic "Test" with Payload "Test". The event trigger "Last Ran" increments, and the mcsMQTT Statistics page shows "MQTT Messages Published by mcsMQTT" increments, but the message never actually gets published.

    Please fix this ASAP.

  • #2
    How do you know it was not published? What do have that is subscribed to this topic? When I try it with manual trigger I see the message published as viewed on another client that has subscribed to it.

    Comment


    • #3
      I saw the same thing today at my mother house.


      I only used it for 4 events . I was working fine 1 months ago. I do not have any logs sorry.
      big5 mqtt work ok now .

      Comment


      • #4
        Originally posted by Michael McSharry View Post
        How do you know it was not published? What do have that is subscribed to this topic? When I try it with manual trigger I see the message published as viewed on another client that has subscribed to it.
        Two ways.

        First, I'm subscribed to the topic here:
        Code:
        ~# mosquitto_sub -v -t Test/\# -u test -P test
        Test/test test-cli-message
        I send a test message from the CLI here (seen above):
        Code:
        ~# mosquitto_pub -u test -P test -t Test/test -m test-cli-message
        I trigger the event here:
        Click image for larger version

Name:	hs-event.png
Views:	78
Size:	21.1 KB
ID:	1320467
        I see nothing.

        Second, here I locate the TCP session between my HomeSeer server and my MQTT server:
        Code:
        ~# netstat -tnp | grep 1883 | grep mono
        tcp        0      0 172.30.0.101:42510      10.110.10.101:1883      ESTABLISHED 1618/mono
        And here, I capture the traffic. Clearly this message is not sent. (Some messages redacted for my own privacy, but I assure you it's not there.)

        Code:
        ~# tcpdump dst port 42510 -X -q -n
        tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
        listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
        01:29:25.563784 IP 10.110.10.101.1883 > 172.30.0.101.42510: tcp 45
                0x0000:  4500 0061 2739 4000 3f06 5308 0a6e 0a65  E..a'9@.?.S..n.e
                0x0010:  ac1e 0065 075b a60e 6123 cf12 438f ac02  ...e.[..a#..C...
                0x0020:  8018 0039 ac5d 0000 0101 080a 007a 9309  ...9.].......z..
                0x0030:  2d37 bede 302b 0025 496e 6672 6173 7472  -7..0+.%Infrastr
                0x0040:  7563 7475 7265 2f50 6f77 6572 2f4e 6573  ucture/Power/Nes
                0x0050:  7444 432f 4c69 6e65 4865 7274 7a35 392e  tDC/LineHertz59.
                0x0060:  30                                       0
        01:29:25.563984 IP 10.110.10.101.1883 > 172.30.0.101.42510: tcp 48
                0x0000:  4500 0064 273a 4000 3f06 5304 0a6e 0a65  E..d':@.?.S..n.e
                0x0010:  ac1e 0065 075b a60e 6123 cf3f 438f ac02  ...e.[..a#.?C...
                0x0020:  8018 0039 5396 0000 0101 080a 007a 9309  ...9S........z..
                0x0030:  2d37 bede 302e 0027 496e 6672 6173 7472  -7..0..'Infrastr
                0x0040:  7563 7475 7265 2f50 6f77 6572 2f4e 6573  ucture/Power/Nes
                0x0050:  7444 432f 4261 7474 5065 7263 656e 7431  tDC/BattPercent1
                0x0060:  3030 2e30                                00.0
        01:29:25.564219 IP 10.110.10.101.1883 > 172.30.0.101.42510: tcp 51
                0x0000:  4500 0067 273b 4000 3f06 5300 0a6e 0a65  E..g';@.?.S..n.e
                0x0010:  ac1e 0065 075b a60e 6123 cf6f 438f ac02  ...e.[..a#.oC...
                0x0020:  8018 0039 91a2 0000 0101 080a 007a 9309  ...9.........z..
                0x0030:  2d37 bede 3031 002a 496e 6672 6173 7472  -7..01.*Infrastr
                0x0040:  7563 7475 7265 2f50 6f77 6572 2f4e 6573  ucture/Power/Nes
                0x0050:  7444 432f 5275 6e74 696d 654d 696e 7574  tDC/RuntimeMinut
                0x0060:  6573 3830 372e 30                        es807.0
        01:29:25.564486 IP 10.110.10.101.1883 > 172.30.0.101.42510: tcp 47
                0x0000:  4500 0063 273c 4000 3f06 5303 0a6e 0a65  E..c'<@.?.S..n.e
                0x0010:  ac1e 0065 075b a60e 6123 cfa2 438f ac02  ...e.[..a#..C...
                0x0020:  8018 0039 5968 0000 0101 080a 007a 9309  ...9Yh.......z..
                0x0030:  2d37 bede 302d 0027 496e 6672 6173 7472  -7..0-.'Infrastr
                0x0040:  7563 7475 7265 2f50 6f77 6572 2f4e 6573  ucture/Power/Nes
                0x0050:  7444 432f 4c6f 6164 5065 7263 656e 7432  tDC/LoadPercent2
                0x0060:  312e 30                                  1.0
        01:29:25.564731 IP 10.110.10.101.1883 > 172.30.0.101.42510: tcp 41
                0x0000:  4500 005d 273d 4000 3f06 5308 0a6e 0a65  E..]'=@.?.S..n.e
                0x0010:  ac1e 0065 075b a60e 6123 cfd1 438f ac02  ...e.[..a#..C...
                0x0020:  8018 0039 8e78 0000 0101 080a 007a 9309  ...9.x.......z..
                0x0030:  2d37 bedf 3027 0021 496e 6672 6173 7472  -7..0'.!Infrastr
                0x0040:  7563 7475 7265 2f50 6f77 6572 2f4e 6573  ucture/Power/Nes
                0x0050:  7444 432f 5465 6d70 4639 362e 38         tDC/TempF96.8
        So I'm 100% sure it's not being sent by mcsMQTT. This topic isn't defined anywhere else in the mcsMQTT system. Is there anything I need to do besides simply set up the event?

        Comment


        • #5
          There was a related discussion at https://forums.homeseer.com/forum/li...ndles-payloads that never really came to closure. It does show the debug that is available when the debug setting is used on the General tab. To continue with the debug use the version with latest debug. This version with debug is at http://mcsSprinklers.com/mcsMQTT_4_1_2_2.zip.

          The segment of applicable code in the plugin is below. Since you are getting update in the Statistics it shows that the last lines of this segment are being executed. The actual lower level transmit is handled by M2MQTT.dll and invoked in the code below "oMQTTClient.Publish". In my case the default QOS and default retain on General tab are "At Most" and "Do Not Retain at Broker". While mcsMQTT does not use these to control publishing, they may affect how M2MQTT.dll deals with them. Please review the values you have setup for these two parameters. Also provide the debug log sequence around "Handle Action Entry" as shown in the other referenced thread. It is located in the \Data\mcsMQTT\mcsMQTTDebug.txt.

          Code:
                                  If gDebugLog Then
                                      hsWritelog(PLUGIN_DEBUG, "Handle Action Topic " & sTopic)
                                  End If
                                  'if a sign topic then remove the HTML
                                  If sTopic <> "" Then
                                      Dim arrSignTopic As String() = FindSignTopic()
                                      If arrSignTopic IsNot Nothing Then
                                          For Each sSignTopic As String In arrSignTopic
                                              If gDebugLog Then
                                                  hsWritelog(PLUGIN_DEBUG, "Handle Action Sign " & sTopic.Length.ToString & "=" & sTopic.Substring(0, sSignTopic.Length) & "=" & sSignTopic)
                                              End If
                                              If sTopic.Length > sSignTopic.Length AndAlso sTopic.Substring(0, sSignTopic.Length) = sSignTopic Then
                                                  sPayload = StripHTML(sPayload)
                                                  Exit For
                                              End If
                                          Next
                                      End If
                                      oMQTTClient.Publish(sTopic, Encoding.UTF8.GetBytes(sPayload), gDefaultQOS, gDefaultRetain)
                                  End If
                                  If gDebugLog Then
                                      hsWritelog(PLUGIN_DEBUG, "Handle Action Topic=Payload " & sTopic & "=" & sPayload)
                                  End If
                                  gPublishCount = gPublishCount + 1
                                  gPublishCountToday = gPublishCountToday + 1
                                  gLastPublishTopic = sTopic
                                  gLastPublishPayload = sPayload

          Comment


          • #6
            I also have the same issue
            nothing is sent from event. This have worked before so something have happened in last update
            I havent changed anything cause i have been away from the house for 2 months, and only updated plugin

            Comment


            • #7
              Did you follow the suggestion of updating the latest version at http://mcsSprinklers.com/mcsMQTT_4_1_2_2.zip.
              All you need is the HSPI...exe file from it.

              Comment


              • #8
                That fixes it! Thanks!

                Comment


                • #9
                  I will submit to updater so others do not have the problem.

                  Comment


                  • #10
                    I'm having an issue with the Send function as well. My MQTT message fires but the payload is not correct. Below is my event

                    Click image for larger version  Name:	mqtt_01.png Views:	0 Size:	44.5 KB ID:	1321238

                    and what gets sent is

                    Click image for larger version  Name:	mqtt_02.png Views:	0 Size:	3.8 KB ID:	1321241

                    It's not substituting the variable. I have verified 482 is the correct value

                    I'm running 4.1.2.2
                    Attached Files

                    Comment


                    • #11
                      You are correct. I was using the wrong syntax for decoding when I was setting up some of my events. It is fixed in http://mcsSprinklers.com/mcsMQTT_4_1_2_3.zip.

                      It did seem odd to me that I had to make changes to get my event to work. I just thought nobody was using the event action substitution so that was it was not discovered before and my change would not break anything.

                      Comment

                      Working...
                      X