title: Bluemix Connection Refused: not authorised, can't register device
body: <p>I have read several tutorials and topics and I did everything as described, but still I am not able to register device.</p>
  
  <p>I have been trying to use MQTTlens and mosquitto but same problem, not authorised</p>
  
  <p>Bellow is command for mosquitto</p>
  
  <pre><code>mosquitto_pub -h xwc8vm.messaging.internetofthings.ibmcloud.com -u use-token-auth -P 'YpSP?P98Wwe0pYGXPj' -i 'd:xwc8vm:devicetype:mydevice' -t /iot/x -m '{"d":"heloo"}'
  </code></pre>
  
  <p>This are devices data</p>
  
  <pre><code>Organization ID         xwc8vm
  Device Type             devicetype
  Device ID               mydevice
  Authentication Method   token
  Authentication Token    XXXXXXXXXX
  </code></pre>
  
  <p>I have used host</p>
  
  <pre><code>xwc8vm.messaging.internetofthings.ibmcloud.com
  </code></pre>
  
  <p>and client </p>
  
  <pre><code>d:xwc8vm:devicetype:mydevice
  </code></pre>
  
  <p>I even tried using <a href="http://mqtt-helper.mybluemix.net/?cm_sp=dw-bluemix-_-nospace-_-answers" rel="nofollow noreferrer">http://mqtt-helper.mybluemix.net/?cm_sp=dw-bluemix-<em>-nospace-</em>-answers</a>, but got this error</p>
  
  <pre><code>(23:42:45.044)Failed to connect to xwc8vm.messaging.internetofthings.ibmcloud.com:1883. Code: 1, Message: AMQJSC0001E Connect timed out.
  </code></pre>
  
  <p>Everything is configured as here <a href="http://heidloff.net/article/useful-mqtt-tools-ibm-watson-iot-bluemix?cm_mc_uid=27677244132415055778021&amp;cm_mc_sid_50200000=1505944109" rel="nofollow noreferrer">http://heidloff.net/article/useful-mqtt-tools-ibm-watson-iot-bluemix?cm_mc_uid=27677244132415055778021&amp;cm_mc_sid_50200000=1505944109</a></p>