Closed caseyhagen closed 8 years ago
The device in config.json needs to point to a device. The code is tested and sends the information to Azure properly given the correct inputs.
No it doesn't work. The message that is created from the buttons is properly sent to the IoT Hub.... However the message is then consumed within node. Once the message is consumed it is dequeued. The message will never make it back to the hardware. There are two consumers but only one will receive the message. If you comment out the device stuff in server.js then it works.
/* deviceClient.open(function(err, result) { if (err) { console.log('could not connect: ' + err.message); return; } console.log('client connected');
deviceClient.on('message', function(msg) {
console.log('Id: ' + msg.messageId + ' Body: ' + JSON.stringify(msg.data));
deviceClient.complete(msg, completedCallback);
});
deviceClient.on('error', function(err) {
console.error('Error: ' + err.message);
})
deviceClient.on('disconnect', function() {
console.log('client disconnected');
deviceClient.removeAllListeners();
deviceClient.connect(connectCallback);
});
}); */
The 'device' in server.js consumes the LED messages so the board never gets them.