title: get data from mqtt broker -6lbr
body: <p>I followed this tutorial :</p>
  <p><a href="http://processors.wiki.ti.com/index.php/Cc26xx_sw_examples" rel="nofollow noreferrer">Running the CC26xx Contiki Examples</a></p>
  <p>but instead of using the cc26xx-demo I used the cc26xx-web-demo and successfully manged to get everything up and running and I can access the 6lbr web page, when I access the sensorTag page I see a mqtt configuration page as shown:
  <a href="https://i.stack.imgur.com/Ukdaf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ukdaf.png" alt="sensorTag page" /></a></p>
  <p>and if I click index in the sensorTag page (pic above) I get to see the <strong>data</strong>:</p>
  <p><a href="https://i.stack.imgur.com/aLj6f.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aLj6f.jpg" alt="enter image description here" /></a></p>
  <p>the question is , how can I write a simple nodejs js file that uses the mqtt broker information to grab all the sensorTag <em><strong>sensors</strong></em> data and save it in an local object.</p>
  <p>I tried to do run this example but no luck</p>
  <pre><code>var mqtt = require('mqtt') 
  client = mqtt.createClient(1883, '192.168.1.109'); 
  client.subscribe(what do I write here); 
  client.on('message', function(topic, message) { console.log(message); });
  </code></pre>
  <p>I don't know what I'm doing wrong</p>
  <h1><strong>UPDATE:</strong></h1>
  <p>mqtt configuration page :<a href="https://i.stack.imgur.com/ztZUI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ztZUI.png" alt="enter image description here" /></a></p>
  <p>javascript file :
  <a href="https://i.stack.imgur.com/YxpUg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YxpUg.png" alt="enter image description here" /></a></p>
  <p>and I run the js with node and listen on port 1883:
  <a href="https://i.stack.imgur.com/bT5xU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bT5xU.png" alt="enter image description here" /></a></p>
  <p>tcpdump seems to detect mqqt packets on 1883 port but I can't to seem to be able to console.log the sensor data when I run the js file with node ??</p>
  <p>I went on the contiki wiki and came across this info
  &quot;You can also subscribe to topics and receive commands, but this will only work if you use &quot;Org ID&quot; != 'quickstart'. Thus, if you provide a different Org ID (do not forget the auth token!), the device will subscribe to:</p>
  <p>iot-2/cmd/+/fmt/json&quot;</p>
  <p>does this mean that the topic to subscribe to is quickstart but even if that's so, I used '+/#'  which subrcibes to all topics and still got nothing printing on the console ?</p>