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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How can I send messages to azure iot hub?

mvolanti
8-Gravel

How can I send messages to azure iot hub?

Hi,

I want to send messages from thingworx to iothub-thing (device).

I installed correctly the azure iot connector and I can read messages from edge devices.

I need to send message from thingwox  as JSON like this:

{"Id":"0x02","Type":"Command"}

How can I do this????

Thanks

2 REPLIES 2
ttielebein
14-Alexandrite
(To:mvolanti)

I am not sure of the best way to do this, but if your other server has a public rest api, you could make a call from a ThingWorx service using the PostJSON code snippet.

Seems like you may have to just add the property you wish to update as a remote property on your thing and then you can just update it on the Platform, and this will push it to the edge device. Check out page 61 of the ThingWorx Azure Connector Installation and Operations Guide.

Hope this helps at all!

it is not exact match but you can send a following message:

{

"msg": {

"Id":"0x02","Type":"Command"

}

}

by using ConnectionServicesHub.writeAzureProperty(devId, "msg", value). Value could be a JSON object or an Infotable

Announcements


Top Tags