microsoft / ros_azure_iothub

This repository contains a ROS node for bidirectional communication with IoT Hub
38 stars 30 forks source link

ROS Melodic How to monitor data on azure iot hub #37

Open kapilPython opened 3 years ago

kapilPython commented 3 years ago

I am using the melodic-devel branch for sending /rosout and /odom data to the azure iot hub. Now how could I read the data sent on IOT Hub. As shown in figure the configuration for azure iot hub device twin is mentioned. image

As shown in the noetic branch I am not able to read the data in the reported properties.

ooeygui commented 3 years ago

Hi @kapilPython, Your ROS Relay format is not set up to relay the properties to the device twin.

It should look something like this:

{
    "deviceId": "devA",
    "properties": {
        "desired": {
            "ros_relays": {
                "1": {
                    "topic": "/odom",
                    "relay_method": "reported"
                }
        }
    }
}
kapilPython commented 3 years ago

For the branch melodic-devel if I set the device twin mentioned as above the ros azure iot hub library is not able to parse the topic and therefore not creating subscribers for the topic and neither sending data to the azure iot hub.

ooeygui commented 3 years ago

Ah, sorry about that. Yes, this was a new feature for Noetic; the change could be backported; however special care would be needed to prevent breaking melodic customers.

kapilPython commented 3 years ago

Yeah, thanks that confirmation was required, I will take up the task and try to backport the package and add the feature to melodic branch. But with the existing package are there any ways to read the data being sent to the iot hub, how are the existing melodic users using the package and reading back the data from azure iot hub.

ooeygui commented 3 years ago

The existing interface in melodic sends these raw events through a telemetry pipeline. Customers would use this as a message bridge, deserializing and use the results directly in backend services. The reported method was built to enable storing just the last message of a topic to enable cases such as map representation.