Guest User

Untitled

a guest
Jan 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. const awsIot = require('aws-iot-device-sdk');
  2.  
  3. const device = awsIot.device({
  4. keyPath: '9xxxx9x999-private.pem.key',
  5. certPath: '9xxxx9x999-certificate.pem.crt',
  6. caPath: 'root.pem',
  7. clientId: 'iotTest',
  8. host: 'endpoint.iot.ap-northeast-1.amazonaws.com'
  9. });
  10.  
  11. device.on('connect', () => {
  12. device.publish('topic_1', JSON.stringify({ message_id: 1, Message: 'Hello World' }));
  13. });
Add Comment
Please, Sign In to add comment