cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

MQTT Extension values does not refresh Mashup

alcubierre
10-Marble

MQTT Extension values does not refresh Mashup

I have added MQTT Extension 3-1-0 to Thingworx 9.3 platform, and trying to show in a little mashup the temp value from MQTT ESP8266 publisher.

 

I receive a temperature value mapped ok to the MQTT Thing, I test that values transferred values are shown when refreshing as 

 

My problem is that this value is not refreshed into a LED widget... The refresh only happens when I uptate manually the value from console, but not when values are changed from MQTT subscriber.

 

Why values are not refreshed?

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

8 REPLIES 8
DanZ
15-Moonstone
(To:alcubierre)

I assume because you do not use the "GetProperties" service of the thing containing the values with the "Automatically update when able" option. In this case you only calling the service for retrieving the values once.

 

See also: https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Mashup_Builder/Mashups/MashupAutoUpdate.html

alcubierre
10-Marble
(To:DanZ)

I have the getProperties in place, I have followed the Fundamentals Overview tutorial but retrieving from the new field comming from MQTT.

 

I have attached all views from compose to show all configurations.

 

Summarizing:

1) ESP8266 delivers HeatPreMQTT, this field is refresing in properties perfectly inside ReflowOven that is based upon MQTT thing Template.

2) New Mashup with Led, I add data from ReflowOven, use GetProperties.preHeatMQTT and bind this property to data from leddisplay-9 with "Automatically values when able" to data activated.

 

But nothing changes in the mashup, Instead it changes always to 0. Refreshing page, new view mashup, nothing changes.

DanZ
15-Moonstone
(To:alcubierre)

Can you check if you have any errors in the script or application log? Also please look at the "Application Keys" section if Thingworx created some temporary application keys when you opened the mashup.

alcubierre
10-Marble
(To:DanZ)

I read:

 

Error Executing Event Handler 'ForwardEvent' for event Type.Thing:Entity.ReflowOven:Event.DataChange:Property.preHeatMQTT

 

From https://community.ptc.com/t5/ThingWorx-Developers/Error-Executing-Event-Handler-ForwardEvent-for-event-Type-Thing/td-p/732013 I'm trying to put permissions for Administrator and System allow at entity and collection leven but still the same error.

 

No keys found in Application Keys section.

DanZ
15-Moonstone
(To:alcubierre)

As far as I know the MQTT extension uses the "System" user internally. That means that the "System" user must have permission for "Event Execute" on your "ReflowOven" thing. Not sure if subscription permissions are also necessary. Maybe grant all permissions on your thing for the System user and then narrow it down.

alcubierre
10-Marble
(To:DanZ)

Its working.

 

The problem: I was importing a Mashup.xml that I get from the Fundamental course. I't seems this xml is no compatible with Thingworkx current metadata version (9.3).

 

When I have just created a new Mashup from scratch it works.

 

Thanks for your help.... 

It works better now, but I have to refresh manually (F5) and does not update automatically.

 

I have checked "Automatically updates then enable"....

 

image.png

 

And I have added the autorefresh function....

 

alcubierre_0-1674110781514.png

I dunno exactly how to bind the autorefresh event with the mashup widget.... I have selected any of them without any result....

 

alcubierre_1-1674110926452.png

 

I have attached the "example project". It shoult work in any installation because my device is always connected to a public MQTT broker.

 

 

Solved. Simply assign runtime permissions to system (execute and subscribe) to thing.

 

https://community.ptc.com/t5/ThingWorx-Developers/Error-Executing-Event-Handler-ForwardEvent-for-event-Type-Thing/td-p/732013

Announcements


Top Tags