Coder Social home page Coder Social logo

airtrik / javascript Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

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

Home Page: https://cdn.airtrik.com/js/0.1.1/index.js

HTML 24.79% JavaScript 69.96% Shell 5.25%

javascript's Introduction

Airtrik javascript

Airtrik is an IoT Cloud platform for managing communication between IoT devices and software platforms. This is the javascript 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 webserver to run your html file.

Install apache
Or you can use node server also

Installing

Airtrik javascript library can easily be loaded to any webpage/web app through cdn following is the link which you need to add to the head tag of your HTML page.

<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.airtrik.com/js/0.1.1/index.js" type="text/javascript"></script>

Connecting to your App's Network

// create an app in the panel to get the app key
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
onConnect = ()=>{
  subscribe(device)
}

Sending message to device

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

Receiving messages from device

// you can write your custom function handling the incoming message
onReceive = (message, deviceId)=>{
  console.log(message)
  console.log(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

javascript's People

Contributors

vishal-pandey avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.