Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I'm currently using MQTT to send sensor data to the thingworx platform. The data is in json format and looks like this:
{"tire_pressure":4.7,"speed":55,"timestamp":"2020-05-07 11:25:19.971","status":"success","vehicle":"car"}
In the MQTT master template I created a property called Speedometer which receives this json data. Now, I'm trying to extract the data by using another property (called Speed, base type: int) which subscribes to the Speedometer. The subscription looks like this:
me.Speed = me.Speedometer.speed;
But the property Speed doesn't change it's value. Do you know how to solve this?
Solved! Go to Solution.
me.Speed= me.Speedometer["speed"];
Thanks a lot!
Unfortunately it worked only once. Now I have always the same value for Speed but the Speedometer json changes every 5 seconds
Is the JSON property getting updated in ThingWorx as well?
Are you using MQTT extension?Which version? Also, have you enabled SSL for communication with the broker?
Please check the logs for any error message.
I found the problem. I had to change the visibility in the permissions.
Now it's working!
Thank you!