Gateway AWS IotCore to Mongodb.
The Service captures any data payload sent directly by the Amazon AWS Iot Core and sends
it to a database in Mongodb. The transferred data can be displayed in real time on the terminal.
npm run build
= Transpilation with babel ts for js.
npm run dev
= Run in development environment.
npx pm2-runtime dist/index.js
= Running in production environment.
The application proved to be promising, with low latency in the event loop,
low CPU and memory consumption at short, medium and long periods of use.
For easy manipulation of the script, without necessarily having to make direct contact
with the code when making a simple change. Everything that is necessary for proper functioning
must be inserted in the other environment variables :
Variable to define the time of receipt of data according to your zone:
Forgot you time Zone? View your time zone here.
TIMEZONE= Ex: America/Sao_Paulo
Variable to set connection URI with Mongodb:
MONGOO_URI= mongodb+srv://:[email protected]/?retryWrites=true&w=majority
Variables to define the connection to AWS IOT CORE via MQTT server.
Not familiar with AWS IOT CORE? Meet here
NOTE: Files referring to certificates and authentication keys must be informed by their storage url.
IOT_CORE_CERTPATH_URL= Ex: https://www.exemple.com/certPath.txt IOT_CORE_KEYPATH_URL= Ex: https://www.exemple.com/key.txt IOT_CORE_CATH_URL= Ex: https://www.exemple.com/ca.txt IOT_CORE_HOST= Ex: Your Custom Endpoint IOT_CORE_CLIENT_ID= Ex: Your Unique ClientI dentifier IOT_CORE_TOPIC= Ex: Your Topic
To monitor application status, PM2 is a service that allows us to do real-time monitoring.
If you don't have an account, create a PM2 account right now Create an account here.
PM2_PUBLIC_KEY= Your Public Key PM2_SECRET_KEY= Your Secret Key