0
votes

I have added 2 type of devices in Watson-Iot platform, one is Iot-Bridge and one is gateway. When I make the API call to get device info for gateway type of device, it gives me the information but same type of call for Iot-Bridge type device says NotFound. e.g. https://internetofthings.ibmcloud.com/api/v0002/organizations/{orgId}/device/types/gateway01/devices/{deviceId} gives device Info but below call gives NOT FOUND, however there is a device by that name as /bulk/devices gives list of all devices. https://internetofthings.ibmcloud.com/api/v0002/organizations/{orgId}/device/types/iot-bridge/devices/{deviceId}

Can anyone provide any idea?

Also how can I get all the information for data sent by these devices to Iot Platform? API endpoint is given but its giving Bad Request.

1
If you can provide you 6 character org for the IoT service, we can search the logs for errors.ValerieLampkin
@ValerieLampkin organization id is jt80lquser1542652
@ValerieLampkin hi Valerie, Actually now I am able get the details for iot-bridge type devices as well. But would like to tell you the problem was device type name case sensitivity. For Devices by device type endpoint, API doesn't check case sensitivity for device type name however for device info endpoint it checks for case sensitivity of device type name.user1542652
@ValerieLampkin one thing I would like to ask you about device information, Can we get the device status whether it is connected OR disconnected using the API call. Please let me know if that is possible?user1542652

1 Answers

0
votes

I am glad to hear you identified the device info endpoint was checking for cases sensitivity and resolved the problem by correcting the case of the device type name.

An application can subscribe to monitor the status of one or more devices, for example:

Subscribe to topic iot-2/type/device_type/id/device_id/mon

Note: To subscribe to updates from more than one device, use the MQTT "any" wildcard character (+) for any of the following components:

device_type
device_id

For managed devices, you can use the API to get log connection information to determine when managed devices have connected and disconnected.

You may find this recipe for displaying status of devices useful: https://developer.ibm.com/recipes/tutorials/display-status-of-registered-devices-on-watson-iot-platform/