项目作者: airtrik

项目描述 :
Airtrik is an IoT Cloud platform for managing communication between IoT devices and software platforms.
高级语言: Python
项目地址: git://github.com/airtrik/python.git
创建时间: 2020-07-05T16:49:45Z
项目社区:https://github.com/airtrik/python

开源协议:Other

下载


Airtrik python

Airtrik is an IoT Cloud platform for managing communication between IoT devices and software platforms.
This is python sdk that can be used for communicating to both IoT device running python as a programming language like Raspberry Pi
and software platform running python. This library can also be used for making realtime data pipeline for applying machine learning on the IoT devices.

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 the following software installed in your system or development system.

  1. python (Version > 3.5)
  2. pip (any recent version)

Installing

Installing airtrik python library is straight forward, just install it with pip. Although it will work pretty well with your system python.
We recommend using the virtual environment for your project

  1. pip install airtrik

Connecting to your App’s Network

  1. import airtrik.iot as iot
  2. # create app in the panel to get the app key
  3. iot.connect("__APP_KEY__")

Subscribe to device in App’s Network

  1. # you have to create device inside app from panel
  2. device = "__DEVICE_ID__"
  3. iot.subscribe(device)

Sending message to device

  1. message = "YOUR MESSAGE TO DEVICE"
  2. iot.send(device, message)

Receiving messages from device

  1. # you can write your custom function handling the incoming message
  2. def onReceive(deviceId, message):
  3. print(deviceId, message)
  4. iot.onReceive = onReceive
  5. iot.waitForMessage()

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