As per the documentation the devices in Watson IoT Platform can send events and subscribe to commands from the Platform. Note that the devices can only subscribe to commands and not events. Can you make sure that the topics used are correct?
Events
Events are the mechanism by which devices publish data to the Watson IoT Platform (and to the application). Devices control the content of their messages and assign a name for each event that is sent.
The following MQTT topic to be used to publish the events,
iot-2/evt/event_id/fmt/format_string
where
- event_id is the ID of the event, for example status. The event ID can be any string that is valid in MQTT. If wildcards are not used, subscriber applications must use this string in their subscription topic to receive the events that are published on their topic.
- format_string is the format of the event payload, for example json. The format can be any string that is valid in MQTT. If wildcards are not used, subscriber applications must use this string in their subscription topic to receive events that are published on their topic.
Commands
Commands are the mechanism by which applications communicate with devices. Only applications can send commands, and the commands are sent to specific devices. The device must determine which action to take on receipt of any given command.
2
Devices can subscribe to command topics in the following format:
iot-2/cmd/command_id/fmt/format_string
Where
- command_id is the ID of the command, for example, update. The command ID can be any string that is valid in the MQTT protocol. If wildcards are not used, a device must use this string in its subscription topic to receive commands that are published on their topic.
- format_string is the format of the command payload, for example json. The format can be any string that is valid in the MQTT protocol. If wildcards are not used, a device must use this string in its subscription topic to receive commands that are published on their topic.
Refer to this section of the document for more information about the device connectivity to the Watson IoT Platform.
We have written a step by step guide to show how one can conect a device to Watson IoT Platform, publish events, subscribe to commands from application, subscribe to events in application, publish commands from the application to deivce using the Java client library for Watson IoT Platform and is availabe here - Java Client Library for IBM Watson IoT Platform.
Also, you can find samples in multiple languages. Refer this document for the list of available libraries and samples.