0.1.2 • Published 4 years ago

airtrik v0.1.2

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Airtrik node

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.

Summary

Getting Started

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.

Prerequisites

  • 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__

Installing

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

Connecting to your App's Network

var airtrik = require("airtrik")

// create an app in the panel to get the app key
client = airtrik.connect("__APP_KEY__")

Subscribe to device in App's Network

// 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)
})

Sending message to device

message = "YOUR MESSAGE TO DEVICE"
client.send(device, message)

Receiving messages from device

// you can write your custom function handling the incoming message
client.on('receive', (message, deviceId)=>{
  console.log(message, deviceId)
})

Versioning

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT Creative Commons License - see the LICENSE file for details

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago