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

How can I send messages to azure iot hub?

Highlighted
Regular Member

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

Re: How can I send messages to azure iot hub?

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!

Re: How can I send messages to azure iot hub?

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