I am trying build a IoT small application, using IBM Bluemix platform. I found a video of Ryan J Baxter's on connecting a Sensor Tag to the IoT Cloud Foundation with a Beagle-bone. Now I'm trying the same procedure with a Raspberry Pi device instead of a Beagle-Bone, facing some issues with the sensor-tag.js file we are not able to get the cfg parameter values like cfg type, cfg org, cfg id from config.properties file.
I got the mac address which I gave when I'm registering the device I gave my Raspberry Pi mac address as it is connected to my Ethernet eth0.
if(cfg.id != deviceId) {
console.warn('The device MAC address does not match the ID in the configuration file.');
}
//------------- This is where I'm facing a problem --------
var clientId = ['d', cfg.org, cfg.type, cfg.id].join(':');
var client = mqtt.connect("mqtts://" + cfg.org +
'.messaging.internetofthings.ibmcloud.com:8883',
{
"clientId" : clientId,
"keepalive" : 30,
"username" : "use-token-auth",
"password" : cfg['auth-token']
});
client.on('connect', function() {
console.log('MQTT client connected to IBM IoT Cloud.');
});
client.on('error', function(err) {
console.log('client error' + err);
process.exit(1);
});
client.on('close', function() {
console.log('client closed');
process.exit(1);
});
monitorSensorTag(client);
});
});
function monitorSensorTag(client) {
console.log('Make sure the Sensor Tag is on!');