Airtrik is an IoT Cloud platform for managing communication between IoT devices and software platforms. This is the node library that can be used for communicating to IoT device connected to your airtrik app network.
Follow the below instructions to get your device and application up and running within minutes. It is very easy to integrate airtrik into your project.
- Before proceeding further you have would need a node js running on your system install the latest version of nodejs and npm for your platform from here https://nodejs.org/en/
- Create an account at airtrik.com and create an app and devices to get your
__APP_KEY__
and__DEVICE_ID__
Airtrik node library can easily be loaded to your project through npm following is the you need to run inside your node project terminal to install airtrik.
npm install airtrik
var airtrik = require("airtrik")
// create an app in the panel to get the app key
client = airtrik.connect("__APP_KEY__")
// you have to create device inside app from panel
var device = __DEVICE_ID__
// you can only subscribe to any device inside the onConnect callback function
client.on('connect', ()=>{
client.subscribe(device)
})
message = "YOUR MESSAGE TO DEVICE"
client.send(device, message)
// you can write your custom function handling the incoming message
client.on('receive', (message, deviceId)=>{
console.log(message, deviceId)
})
- Vishal Pandey - Written Python Library - vishal-pandey
See also the list of contributors who participated in this project.
This project is licensed under the MIT Creative Commons License - see the LICENSE file for details