0

I have a device on IBM cloud IoT platform and I want to subscribe mendix to its events... I am using MQTT client form mendix app store for subscribing to device events.

Project Explorer:

enter image description here

Micro Flow enter image description here

MQTT Subscription

enter image description here

I have also debug the micro-flow it is giving me value of output variable named variable = false

enter image description here

and I have noticed that whenever app is started it is logs

subscribe: iot-2/type/TemperatureSensorSimulator/id/TemperatureSensorSimulator_1/mon as highlighted in micro-flow screenshot.

All I want is my mendix app to be subscribed to a device on IBM watson IoT platform and show me events sent by device to IBM IoT platform. Can Anyone tell me how can I do this in mendix?

I have already subscribed to events in nodejs app everything is fine. App is showing me events in log. I think I am doing something wrong in mendix micro-flow. I have pasted all the screenshots here. Any help in this regard will be highly appreciated

Thanks in Advance.

Al Fahad
  • 2,378
  • 5
  • 28
  • 37

1 Answers1

1

First, you need to make sure that you use an API-Key/token to connect and then you need to correct the topic to which you subscribe. The rule is:

iot-2/type/device_type/id/device_id/evt/event_id/fmt/format_string

So, yours should be:

iot-2/type/TemperatureSensorSimulator/id/TemperatureSensorSimulator_1/evt/mon/fmt/json

You should be fine afterwards.

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60
idan
  • 554
  • 6
  • 19
  • Thankyou @idan for your reply I have tried this as well but not working... its receiving events in node js but not in mendix app.... can you suggest me what is mistake??? I can share my live credentials with you as well if needed.. – Al Fahad Apr 15 '19 at 08:58
  • what other errors do you see? kinda blank here as configuration seem to be ok, for the connection part. You can check on the logs within IBM IoT Platform Dashboard to see if you connect successfully. – idan Apr 15 '19 at 13:13
  • Connectivity has been established successfully it is now subscribed to my IoT device... All I did is changed `timeout` from `empty` to `60` and issue was resolved.... Thanks alot for you time. Your answer has helped me alot Please update your answer and i will approve it... – Al Fahad Apr 15 '19 at 14:15