Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const awsIot = require('aws-iot-device-sdk');
- const device = awsIot.device({
- keyPath: '9xxxx9x999-private.pem.key',
- certPath: '9xxxx9x999-certificate.pem.crt',
- caPath: 'root.pem',
- clientId: 'iotTest',
- host: 'endpoint.iot.ap-northeast-1.amazonaws.com'
- });
- device.on('connect', () => {
- device.publish('topic_1', JSON.stringify({ message_id: 1, Message: 'Hello World' }));
- });
Add Comment
Please, Sign In to add comment