I'm trying to use the NodeMCU with Espruino IDE and Javascript to send data to AWS IoT Core. However, there's a problem because the Espruino doesn't find the aws-iot-device-sdk module. How can I import it? Or what's an alternative for what I want to do?
Below is the code:
var wifi = require("Wifi");
var awsIot = require('aws-iot-device-sdk');
var WIFI_SSID = "<Wifi>";
var WIFI_OPTIONS = {
  password : "<Password>"
};
var device = awsIot.device({
   keyPath: 'xxxxxxxxxx-private.pem.key',
  certPath: 'xxxxxxxxxx-certificate.pem.crt',
    caPath: 'rootCA.pem',
  clientId: 'nodejs-thing',
      host: 'xxxxxxxxxxxxxx-ats.iot.us-east-2.amazonaws.com'
});
wifi.stopAP(); // disable Wi-Fi AP
wifi.connect(WIFI_SSID, WIFI_OPTIONS, function(err) {
  if (err) {
    console.log("ERROR: Connection failed, error: " + err);
  } else {
    console.log("INFO: Successfully connected");
    console.log(wifi.getStatus());
    console.log(wifi.getIP());
    // set hostname and make the NodeMCU available
    // through espruino.local (ping or for using the
    // Espruino IDE over Wi-Fi
    wifi.setHostname("espruino");
    // save the Wi-Fi settings and they'll be used
    // automatically at power-up.
    wifi.save();
  }
});
device
  .on('connect', function() {
    console.log('connect');
    //device.subscribe('topic_1');
    device.publish('topic_1', JSON.stringify(
      { 
        user: 'user',
        device_id: '02',
        timestamp: '00:00:00',
        temp: 45
      }));
  });
device
  .on('message', function(topic, payload) {
    console.log('message', topic, payload.toString());
  });
Thank you so much in advance.
 
    