title: How to connect mosquitto_sub and mosquitto_pub via Watson IoT?
body: <p>I'd like to make the following application.</p>
  
  <pre><code>1.Send a command from mosquitto_pub to Arduino device via Watson IoT.  
  2.Arduino subscribes to commands.
  3.Arduino publishes sensor information to mosquitto_sub via Watson IoT.
  </code></pre>
  
  <p>In order to make a simple connection test I registered mosquitto_sub on Watson as a device.</p>
  
  <p>I subscribed with mosquitto_sub.</p>
  
  <pre><code>mosquitto_sub - h osdjco.messaging.internetofthings.ibmcloud.com -p 1883 -u　use-token-auth -P &lt;TOKEN&gt; -i "d:osdjco:mosquitto:18fe34cd17S1" -t "iot-2/cmd/shot/fmt/json" -d -v
  </code></pre>
  
  <p>Next I published with the following command.</p>
  
  <pre><code>mosquitto_pub -i a:osdjco:mosquittopub -h osdjco.messaging.internetofthings.ibmcloud.com -u "a-osdjco-xztcbezrwh" - P '&lt;TOKEN&gt;' -t "iot-2/cmd/shot/fmt/json" -m '{"d":{"cmd":"shot"}}' -d
  </code></pre>
  
  <p>The publish was successful but the command was not subscribed.</p>
  
  <p>What is the problem?</p>