ElectronX (Customer) asked a question.

I am not receiving updates on topics I am subscribed to using the MQTTSUB block and I am not sure what to try next.

I am using MQTTSUB to subscribe to a topic on a ThingSpeak broker (it's a MATLAB owned IoT dashboard). I know the broker is working because I am subscribed to the same topic with MQTT.fx and can view updates there when I publish them from the PLC.

 

I know my PLC is connected to the broker because when I turn on MQTTSUB, I see "CONNACK received" and "SUBACK received" in the Do-more logger. I also see my "On Success" bit change from off to on. The payload is supposed to go to SS0, but I never see the data there even when I see the data appear on the MQTT.fx app. I'm not sure what else to look at - does anybody else know what might be going on?


  • HOST_franji1 (HOST Engineering)

    Also, make sure nothing else is writing to SS0. No logic. No array index stuff. No HMI.

     

    Look at the Cross Reference view for SS0 and any array references. This won't point to HMI writes, but it will point to any logic writing to SS0 or SS block as an array (in addition to anything looking at it as an input parameter).

  • ElectronX (Customer)

    Thanks for the really quick replies. I have topic prefixes turned off and I've stripped the ladder logic down to 2 rungs - 1 to turn on logging and 1 for MQTTSUB. Still the same issue

     

    The PLC OS is version 2.8.3 and booter is 1.0.8 - so almost the most recent.

  • HOST_franji1 (HOST Engineering)

    Try updating to most recent OS and GA:

    2.8.4 and 1.10

  • Garry (Customer)

    Can you attach your code? Your topic must have your prefixes.

    Regards,

    Garry

  • ElectronX (Customer)

    I've stripped it down to these two rungs:

    Do-More MQTTSUB 1This is the MQTTSUB configuration. I've entered the topic as the full topic string without a prefix

    Do-More MQTTSUB 2 

    This is my MQTT client config (exact same as MQTTPUB which works)Do-More MQTTSUB 3Thanks again for your quick replies. I hope this is readable

     

    thanks,

    dave

     

    p.s. Garry, I've learned a tonne from your website - I really appreciate all the info there.

    Expand Post
    • Garry (Customer)

      Thanks for the comment Dave.

      I do not see anything out of the ordinary.

      I would try what HOST_franji1 suggested and try updating your system.

      Garry

  • RBPLC (Customer)

    Try putting a forward slash "/" in front of "channels".

  • ElectronX (Customer)

    It must be a problem on the ThingSpeak side because I changed the broker to the HiveMQ test broker and everything worked.

    • Garry (Customer)

      Thanks for the update.

      Garry

10 of 12