Skip to content
/ node Public

Airtrik is an IoT Cloud platform for managing communication between IoT devices and software platforms.

Notifications You must be signed in to change notification settings

airtrik/node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Airtrik is an IoT Cloud platform for managing communication between IoT devices and software platforms.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published