How to configure mqtt client of V6

Forum Home Forums Understanding the Software How to configure mqtt client of V6

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #12534
    grhsc
    Participant

    Dear developer, the mqtt client V6 seems to provide graphical configuration, but I can’t find the new version of mqtt client configuration method in the forum, could you help me?

    I guess it might have something with these configurations
    S1

    https://drive.google.com/file/d/1If_IzRcrsqQNo0mDPm04F5IMmnycSKEa/view?usp=share_link

    Configure broker here,
    S2

    https://drive.google.com/file/d/1Wfk0v1FwOZ9z730giawKdtaODYd49_qV/view?usp=share_link
    If it needs to use self signed certificate, like this

    s3

    https://drive.google.com/file/d/1oh1VZPbpycoYCAsei6nuwQK7_QoI5btS/view?usp=share_link

    how should it be set in rapidscada?

    After completing the setting in the last step, where should I check the subscription payload?

    How to turn them into variables in rapidscada?

    If the the payload format is like this, how to set up JS?

    {“data”:{“A_CV”:3391.09,”B.F_CV”:3402.010986328125},”Timestamp”:”2023-05-05 08:59:45.947143″}

    Sorry for asking so many questions, because it’s really changed a lot and my previous experience with V5 doesn’t seem to be available anymore.

    #12535
    grhsc
    Participant

    Dear developer,
    These 2 questions I’ve found through testing, they are in the logs.
    After completing the setting in the last step, where should I check the subscription payload?
    How to turn them into variables in rapidscada?

    This is the questions I still need your help
    1. use self signed certificate
    2. If the the payload format is like this, how to set up JS?

    {“data”:{“A_CV”:3391.09,”B.F_CV”:3402.010986328125},”Timestamp”:”2023-05-05 08:59:45.947143″}

    thank you!

    #12536
    Mikhail
    Moderator

    Hello,

    1. Probably, support of certificates hasn’t been implemented yet by MQTT client communication channel.

    2. Please check this example. The JS file should be located in the Communicator configuration directory in the project. You should enable JS and specify the file and subitems in the Advanced Parameters of the subscription.

    • This reply was modified 2 years, 3 months ago by Mikhail.
    #12538
    Mikhail
    Moderator

    The driver works with current data. If you mean that the Timestamp field in JSON specifies historical data (in the past), the driver should be modernized.

    #12540
    grhsc
    Participant

    Thanks for the example, it worked.

    Probably, support of certificates hasn’t been implemented yet by MQTT client communication channel.
    For Internet communication, TLS seems to be a must, hopefully it will be supported in the future

    “The driver works with current data. If you mean that the Timestamp field in JSON specifies historical data (in the past), the driver should be modernized.”
    I currently need real-time data only. But this is interesting, how to write the data somewhere (dat file or database?) It will be able to do the data source of rapidSCADA?
    in other words, is it to create a new data interface/Drive and get the data directly without using the existing driver?
    Can you provide relevant information?

    #12542
    Mikhail
    Moderator

    TLS is supported. There is a checkbox for that.
    Currently, there are no settings to specify particular certificates.
    When TLS is enabled, may be the driver uses certificates from some location. I didn’t research.

    Communicator sends data to the data sources, specified in its configuration. Data sources are implemented as drivers. There are Server, MQTT and OPC UA data sources. It’s possible to develop any other data source.

    I wrote about a feature of setting a timestamp in JSON package to write historical data. Historical data would be sent to the data sources specified in Communicator.

    • This reply was modified 2 years, 3 months ago by Mikhail.
    #12544
    grhsc
    Participant

    Dear Mikhail, could you keep helping me please?

    I met new problem, based on your script, I wrote script to get data. Because the target data is about 200, I can’t define them one by one, but use such a loop

    https://drive.google.com/file/d/1lDt15k4eTqIaBvb-F64ZabLB8jcbPp0k/view?usp=share_link

    However, a problem was found in actual use. The mqtt client setting of the other party is: only the quality is good to publish, and the bad one is skipped.

    For example: 200 tags, but occasionally there will be 5 bads in the middle (like it is between 50-54). The data parsed in this way is only 195, and the above program leads to data misalignment.
    The program makes 1-195 always have data, instead of skipping wrong tags, let 1-50, 55-200 have data

    #12550
    Mikhail
    Moderator

    Hello,

    To set the Undefined status, write NaN
    For example, setValue(0, NaN)
    In JS usually for...of is used, not for…in. Link.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.