JSON and MQTT configuration in Embed

Robbert Lee
Robbert Lee Altair Community Member
edited December 2022 in Community Q&A

In NEW platform, I want to configure JSON and MQTT. How can I find those key parameters in the NEW SmartWorks and fill them in Embed?

image

image

 

image

Best Answer

  • Ragini Sahu_21863
    Ragini Sahu_21863
    Altair Employee
    edited December 2022 Answer ✓

    Hi Robbert,

    I am attaching an Embed example as well for your reference.

    In this example, Smartworks broker is being used to echo the data

    The broker is:mqtt.swx.altairone.com

    You need to have an account in Altair Smartworks site:

         https://idp.swx.altairone.com/auth/registration

    Create a device.

     

    In Embed, place an MQTT Publish and Subscribe block in a diagram and configure as below:

    HostName: mqtt.swx.altairone.com

    Topic: <The topic you have created in your Smartcore portal. You can retrieve Topic from Things->Details field->href:

    Eg: spaces/smartwork/categories/mqtt/things/01GKPF0SX8JKAFVFDNCA42PVGS/data >

    Username: <The account username attached to your device. Eg: Embed@smartwork >

    Password: <The password for your account>

Answers

  • Ragini Sahu_21863
    Ragini Sahu_21863
    Altair Employee
    edited December 2022

    Hi Robbert,

    You can find the details to be filled in Embed MQTT Block in Smartworks site as below:

    For hostname: mqtt.swx.altairone.com

    Username and Password has to be filled from Things -> Interfaces field:

    image

    You can retrieve Topic from Things->Details field->href:

    image

     

    And use it as below (Remove "/" before spaces and append "/data" at the end of href):

    spaces/smartwork/categories/mqtt/things/01GKPF0SX8JKAFVFDNCA42PVGS/data

     

    For subscription, you need to use the same credential.

    For your reference, attached is an image of Embed MQTT Publish block updated with correct details:

     

    image

  • Ragini Sahu_21863
    Ragini Sahu_21863
    Altair Employee
    edited December 2022 Answer ✓

    Hi Robbert,

    I am attaching an Embed example as well for your reference.

    In this example, Smartworks broker is being used to echo the data

    The broker is:mqtt.swx.altairone.com

    You need to have an account in Altair Smartworks site:

         https://idp.swx.altairone.com/auth/registration

    Create a device.

     

    In Embed, place an MQTT Publish and Subscribe block in a diagram and configure as below:

    HostName: mqtt.swx.altairone.com

    Topic: <The topic you have created in your Smartcore portal. You can retrieve Topic from Things->Details field->href:

    Eg: spaces/smartwork/categories/mqtt/things/01GKPF0SX8JKAFVFDNCA42PVGS/data >

    Username: <The account username attached to your device. Eg: Embed@smartwork >

    Password: <The password for your account>