title: Node-RED, IOT Foundation Out Node Not Sending Commands
body: <p>I have a Node-RED application that is bound to an IOT Foundation (iotf) service. I can receive events from devices and handle them appropriately.</p>
  
  <p>However, I am now interested in sending commands back to my devices and am having some problems. Nothing is showing up at the device, but by creating an IOTF in node, I can confirm that the command is passing through iotf.</p>
  
  <p>I can definitely get commands to pass through iotf using pure python, as the follow code works well:</p>
  
  <p><strong>Client code:</strong></p>
  
  <pre><code>#!/usr/bin/python
  
  import ibmiotf.device
  from time import sleep
  
  options = {
    "org": "cgmncc",
    "type": "table",
    "id": "b827eb764b7a",
    "auth-method": "token",
    "auth-token": "redacted"
  }
  
  def myCommandCallback(cmd):
    print('inside command callback')
    print cmd
  
  def main():
    client = ibmiotf.device.Client(options)
    client.connect()
    client.commandCallback = myCommandCallback
    while True:
      sleep(1)
  
  if __name__ == "__main__":
    main()
  </code></pre>
  
  <p><strong>Application code:</strong></p>
  
  <pre><code>#!/usr/bin/python
  
  import ibmiotf.application
  
  options = {
    "org": "redacted",
    "id": "python app",
    "auth-method": "apikey",
    "auth-key": "redacted",
    "auth-token": "redacted"
  }
  
  try:
    client = ibmiotf.application.Client(options)
    client.connect()
    client.publishCommand('table', 'b827eb764b7a', 'test')
    client.disconnect()
  except ibmiotf.ConnectionException as e:
    print e
  </code></pre>
  
  <p>Whenever I run the application code, I see the following output:</p>
  
  <pre><code>root@raspberrypi ~ # ./app.py 
  inside command callback
  &lt;ibmiotf.device.Command instance at 0x14e8490&gt;
  </code></pre>
  
  <p>I have a Node-RED iotf output node configured as shown below, but when I trigger the flow, the command callback function doesn't trigger!</p>
  
  <p><img src="https://i.stack.imgur.com/77h87.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/2V7Ve.png" alt="enter image description here"></p>
  
  <p>I'm thinking there maybe something wrong either with trying to use a timestamp trigger to fire the command, or with the way I've configured the output node itself -- any suggestions or advice would be appreciated!</p>