# Open IoE  - 3.0.0

Internet of Things Platform

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>     <strong>Open IoE App</strong></td><td>How to work in OpenIoE Platform?</td><td></td><td><a href="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FExEv1873BUZT0N9oLtBs%2Fbannerphoto.png?alt=media&amp;token=a6ab43ec-feba-4620-b943-592281a637da">bannerphoto.png</a></td><td><a href="/open-ioe-app/introduction">Introduction</a></td></tr><tr><td>  <strong>Python Library</strong></td><td>How to work with python using classes/function?</td><td></td><td><a href="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2F7CZeANB1WXUn41zgUWkb%2FPython-Symbol.png?alt=media&amp;token=f3b81a1c-b1e1-40f3-a605-adf8269bb20f">Python-Symbol.png</a></td><td><a href="/python-library/introduction">Introduction</a></td></tr><tr><td>   <strong>API Reference</strong></td><td>How to integrate OpenIoE with third-parties?</td><td></td><td><a href="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FPj0EjCzzS27EqjCaRjxL%2Fapi.png?alt=media&amp;token=20f179ba-d60d-4e59-8568-3f7f14b135b9">api.png</a></td><td><a href="/api-references/overview">Overview</a></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="137.5"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Web portal</strong></td><td><a href="https://openioe.in">https://openioe.in</a></td><td></td></tr><tr><td><strong>Version</strong></td><td>3.0.0</td><td></td></tr><tr><td><strong>Authors</strong></td><td>Dr. Venkataswamy R</td><td></td></tr></tbody></table>


# Introduction

Open Internet of Everything (OpenIoE)

Open IoE is a free IoT platform that fetched sensor data and provide control signal through IoT devices. Data acquisition, storage, analytics, and visualization of physical systems are possible in the OpenIoE platform. &#x20;

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FtHju7hh1StQVME9dJGSJ%2FIoTArchi.png?alt=media&amp;token=3bc573c0-99cd-405c-94d4-880ca5a74e29" alt=""><figcaption><p>Architechure of IoT Platform</p></figcaption></figure>

### Supported Hardware/IoT Devices

* Raspberry Pi
* NodeMCU/ESP8266
* Jetson Nano
* and so on... (Any SBC/Digital device which executes web services)

### Supported Programming Languages

* All the programming languages (C++/Java/Matlab/Python/...)
* All API tools (curl, Postman, ...)


# Getting Started

### Register

Register for OpenIoE Portal using the following Link. Click on \<Register> Link

{% embed url="<http://app.openioe.in/pages/userapp/register.jsp>" %}

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FL4gnmBQc0gPvpprsghfY%2Freg1.png?alt=media&amp;token=cd63c2dc-d7ea-4cf6-a7e8-dabb374aacc8" alt="" width="375"><figcaption><p>Registration Form</p></figcaption></figure>

### Login

After successful registration, login to OpenIoE using the following link.

{% embed url="<http://app.openioe.in/pages/userapp/login.jsp>" %}

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2Fudc21TDtAzP4iRM02fYi%2Flog1.png?alt=media&amp;token=37da328a-2416-4563-89f8-b754e247bfb4" alt="" width="370"><figcaption><p>Login Form</p></figcaption></figure>

### Create IoT Device

1. Go to Components >> IoT Devices >> Add IoT Devices

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FT96C3E3tvMXassP0RV0J%2Fadddevice1.png?alt=media&amp;token=fc782ce2-1265-4378-80de-452a898c55ed" alt="" width="375"><figcaption><p>Dashboard</p></figcaption></figure>

2. Provide the device name, hardware type, data format, and click on the \<Generate User ID and PIN> button. A notification will pop up.

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FIQQHQcTQ8quD3whPDHz2%2Fadddevice2.png?alt=media&amp;token=e1f4a0c7-93b3-47ab-bbb2-1778389ba882" alt="" width="375"><figcaption><p>Add IoT device Form</p></figcaption></figure>

### View Devices

Go to Components >> IoT Devices >> List of Devices

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FnvZ0MR0MhycSF955PU3f%2Flistdevices.png?alt=media&amp;token=b731b9b1-da8d-4635-a420-e61729e812b1" alt="" width="375"><figcaption></figcaption></figure>

### Read and Write APIs

Click on <img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FevkMH3AKYXn88akBFe7z%2Fimage.png?alt=media&amp;token=4c2ac619-0806-47ea-a1b2-387d1598453c" alt="" data-size="line">  button to see REST APIs as shown below. Note down Read and Write APIs.

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FX8xASJHRvJNUel2DiTAl%2Fapi1.png?alt=media&amp;token=67421e21-31b7-4c3c-a9d7-62c44a9eeace" alt="" width="375"><figcaption></figcaption></figure>

Open any browser or API client tools (curl/Postman/Python/Matlab/..). Paste read API in URL box to see the values

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FZ4NMwsNENUZaMTKLL0da%2Fapi2.png?alt=media&amp;token=08d8d2c0-2a52-4682-8f5a-6696da736a77" alt="" width="375"><figcaption></figcaption></figure>

Open any browser or API client tools (curl/Postman/Python/Matlab/..). Paste write API in URL box to see the updation

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2Fb4u2b5iQclYTxPqN9ZFY%2Fapi3.png?alt=media&amp;token=52513c41-704f-46fa-b711-9ce08d2fad21" alt="" width="375"><figcaption></figcaption></figure>

Note: Actually, Write API is embedded inside the IoT Device to modify the value in actual practice.&#x20;


# Features


# IoT Devices

Add | List | Edit | Delete | View | Download | API

### Add New IoT Device

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FCXLLfRWmcJIM80A2hYaN%2Faddiotdevice.png?alt=media&amp;token=89547750-7dcf-4a9f-8261-5768b5de6607" alt=""><figcaption></figcaption></figure>

1. Components >> IoT Devices >> Add IoT Device
2. Provide any device name
3. Choose hardware device. Available is only Generic.
4. Choose type of data
   * Value
   * JSON
   * XML
5. Click on 'Generate User ID and PIN' button.

### List of IoT Devices

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FwGE14PmSV9cCBoQiUbLO%2Flistdevices.png?alt=media&amp;token=03fca307-6b82-469f-acca-13e600ba9733" alt=""><figcaption></figcaption></figure>

**Operations**:

* View IoT Device data
* Edit Data
* Edit Device Configuration
* View REST APIs
* Download Time Series Data
* Delete IoT Device


# Plots


# Gauges


# Controls


# Examples


# Temperature-Humidity Monitoring & LED Control

{% embed url="<https://youtu.be/guov3_6X9Vs>" %}

1. **Make the circuit as shown below,**

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FzdzqgM5RQVP0HjMzfhJT%2FSlide2.PNG?alt=media&amp;token=6e73090c-5ffc-4e94-8183-80f43e6278d6" alt="" width="375"><figcaption></figcaption></figure>

2. **Create IoT devices**

Login to OpenIoE,&#x20;

Compoents >> IoT Devices >> Add IoT Device

Names: Temperature, Humidity, and LED&#x20;

Data Format: Value, Hardware: Generic

3. **Creates plots, and control**

Components >> Plots >> Add Plot

Plot Name: Temperature, Humidity, Sampling Time: 2s, Frames:100

Control Name: LED, Type: On/Off

4. **Upload the program to Microcontroller**

```arduino
include "DHT.h"
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>

DHT dht;
ESP8266WiFiMulti WiFiMulti;
uint8_t LED_Pin =D1;
char TEMP_SENSOR[]="http://app.gnanodaya.org/openioe/api/updatedevicevalue/xxxxxx/xxx/xxx/";
char HUMIDITY_SENSOR[]="http://app.gnanodaya.org/openioe/api/updatedevicevalue/xxxxxx/xxx/xxx/";
char DHT_LED[]="http://app.gnanodaya.org/openioe/api/showdevicevalue/xxxxxxx/xxx/xxx/";

void setup() {
  Serial.begin(9600);
  pinMode(LED_Pin, OUTPUT);
  dht.setup(D4);
  WiFi.mode(WIFI_STA);
  WiFiMulti.addAP("xxxxx", "xxxxx");
}

void loop() {
  delay(dht.getMinimumSamplingPeriod());

  if ((WiFiMulti.run() == WL_CONNECTED)) {

    float humidity = dht.getHumidity();
    float temperature = dht.getTemperature();
    WiFiClient client;
    HTTPClient http;

     if (http.begin(client, TEMP_SENSOR+String(temperature))) { 
      int httpCode = http.GET();
      if (httpCode > 0) {
        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
          String payload = http.getString();
        }
      }
      http.end();
      }

    if (http.begin(client, HUMIDITY_SENSOR+String(humidity))) { 
      int httpCode = http.GET();
      if (httpCode > 0) {
        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
          String payload = http.getString();
        }
      }
      http.end();
    }


    if (http.begin(client, DHT_LED)) { 
      int httpCode = http.GET();
      if (httpCode > 0) {
        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
          String payload = http.getString();
          if (payload=="1"){
              digitalWrite(LED_Pin, HIGH);
            }
            else if (payload.equals("0")){
             digitalWrite(LED_Pin, LOW);
            }
            else{
              digitalWrite(LED_Pin, LOW);
            }
        }
      }
      http.end();
    }
  } 
}
```

5. **Open Temperature and Humidity plots**
6. **Turn on/off LED in control gadget**
7. **Fetch Temparature and Humidity data Python**

```python
pip install openioe
```

```python
from openioe.openioe_apis import *
oi=openioe_apis()
```

```python

oi.APIKey='xxxxxxxxxx'
oi.DeviceID=xxx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadValue()
print(SensorData)
print(ResposeCode)
```

8. **Control LED using Python**

```python
oi.APIKey='xxxxxxxxxx'
oi.DeviceID=12
oi.DevicePin=27
oi.Data=0
SensorData,ResposeCode=oi.WriteValue()
print(SensorData)
print(ResposeCode)
```


# Overview

The following are the types of APIs OpenIoE provides,

* Create, read, write and delete APIs
* Three types of data types are supported. i.e., single value, XML and JSON

<table data-header-hidden><thead><tr><th width="128.5"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>End Point</td><td><a href="http://app.openioe.in/api/">http://app.openioe.in/api/</a></td><td></td></tr></tbody></table>


# Read API

There are many types of reads possible based on the type of data.

## Read Device Value from IoT Device

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/showdevicevalue`

**Format:** <http://app.openioe.in/api/_showdevicevalue/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |

{% tabs %}
{% tab title="200: OK Successfully returned value from read API" %}
Read API:&#x20;

```
http://app.gnanodaya.org/openioe/api/showdevicevalue/pnHEmHgjFl0PT247Eae9/25/957
```

Response:

```
29.70
```

{% endtab %}
{% endtabs %}

## Read Device JSON from IoT Device

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/showdevicejson`

**Format:** <http://app.openioe.in/api/_showdevicejson/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 634                  |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 28                   |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |

{% tabs %}
{% tab title="200: OK Successfully returned JSON from read API" %}
Read API:

```
http://app.gnanodaya.org/openioe/api/showdevicejson/pnHEmHgjFl0PT247Eae9/28/634 
```

Response:

```
{}
```

{% endtab %}
{% endtabs %}

## Read Device XML from IoT Device

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/showdevicexml`

**Format:** <http://app.openioe.in/api/_showdevicexml/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |

{% tabs %}
{% tab title="200: OK " %}
Read API:&#x20;

```
http://app.gnanodaya.org/openioe/api/showdevicxml/pnHEmHgjFl0PT247Eae9/25/957
```

Response:

```
<data>29.70</data>
```

{% endtab %}
{% endtabs %}


# Write API

## Write Value to IoT Device

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/updatedevicevalue`

**Format:** <http://app.openioe.in/api/_updatedevicevalue/\\><APIKey>/\<DeviceID>/\<DevicePIN>/\<Data>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |
| \<Data><mark style="color:red;">\*</mark>      | String  | e.g.,: 99.15                |

{% tabs %}
{% tab title="200: OK Successfully updated value from write API" %}
Successfully updated value from write API
{% endtab %}
{% endtabs %}

## Write JSON to IoT Device

<mark style="color:green;">`POST`</mark> `http://app.openioe.in/api/updatedevicejson`

**Format:** <http://app.openioe.in/api/_updatedevicejson/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |

#### Request Body

| Name                                      | Type | Description              |
| ----------------------------------------- | ---- | ------------------------ |
| \<Data><mark style="color:red;">\*</mark> | JSON | e.g.,: {"name": "India"} |

{% tabs %}
{% tab title="200: OK Successfully updated JSON from write API" %}
Successfully updated JSON from write API
{% endtab %}
{% endtabs %}

## Write XML to IoT Device

<mark style="color:green;">`POST`</mark> `http://app.openioe.in/api/updatedevicexml`

**Format:** <http://app.openioe.in/api/_updatedevicexml/\\><APIKey>/\<DeviceID>/\<DevicePIN>\_

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| \<APIKey><mark style="color:red;">\*</mark>    | String  | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceID><mark style="color:red;">\*</mark>  | Integer | e.g.,: 25                   |
| \<DevicePin><mark style="color:red;">\*</mark> | Integer | e.g.,: 957                  |

#### Request Body

| Name                                      | Type | Description                   |
| ----------------------------------------- | ---- | ----------------------------- |
| \<Data><mark style="color:red;">\*</mark> | XML  | e.g.,: \<name> India\</name>} |

{% tabs %}
{% tab title="200: OK Successfully updated XML from write AP" %}
Successfully updated XML from write AP
{% endtab %}
{% endtabs %}


# Additional APIs

## Generate new API Key by providing user creds

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/generateapikey`

**Format:** <http://app.openioe.in/api/generateapike&#x79;_/\\><emailid>/\<password>\_

#### Path Parameters

| Name        | Type   | Description                  |
| ----------- | ------ | ---------------------------- |
| \<emailid>  | String | e.g.,: <bangalore@india.com> |
| \<password> | String | e.g.,: Abc\@123              |

{% tabs %}
{% tab title="200: OK Successfully API key is generated" %}
Successfully API key is generated
{% endtab %}
{% endtabs %}

## Add new IoT device to your account

<mark style="color:blue;">`GET`</mark> `http://app.openioe.in/api/createuserdevice`

**Format:** <http://app.openioe.in/api/createuserdevic&#x65;_/\\><APIKey>/\<DeviceName>/\<CryptoName>/\<DataFormat>\_

#### Path Parameters

| Name          | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| \<APIKey>     | String | e.g.,: pnHEmHgjFl0PT247Eae9 |
| \<DeviceName> | String | e.g.,: Temperature Device   |
| \<CryptoName> | String | e.g.,: None                 |
| \<DataFormat> | String | e.g.,: Value/JSON/XML       |

{% tabs %}
{% tab title="200: OK Device is created successfully" %}
Device is created successfully
{% endtab %}
{% endtabs %}


# Integration

#### Read API Integration

{% tabs %}
{% tab title="Python" %}

```python
#pip install requests
import requests
output=requestes.get("http://app.openioe.in/api/showdevicevalue/aaqASmKkCi4YbYT3YjTo/4/944")
print(output.text)
```

{% endtab %}

{% tab title="Matlab" %}

{% endtab %}

{% tab title="Java" %}

{% endtab %}

{% tab title="Scilab" %}

```
```

{% endtab %}
{% endtabs %}

#### Write API Integration

{% tabs %}
{% tab title="Python" %}

{% endtab %}

{% tab title="Matlab" %}

{% endtab %}
{% endtabs %}

#### Additional API Integrations

{% tabs %}
{% tab title="Python" %}

{% endtab %}

{% tab title="Matlab" %}

{% endtab %}
{% endtabs %}


# Introduction

The OpenIoE Python library provides convenient access to the OpenIoE API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

To install the official Python bindings, run the following command

```python
pip install openioe
```

The recent release is hosted in The Python Package Index (PyPI).

```html
https://pypi.org/project/openioe/
```

{% embed url="<https://pypi.org/project/openioe/>" %}

Current Version: 1.1.0


# Getting Started

1. Register for openioe web portal

&#x20;      <https://openioe.gnanodaya.org>

2. Install openioe from the terminal(Linux)/ cmd (Windows)

```
pip install openioe
```

3. Generate API Key

```python
from openioe.openioe_apis import *
oi=openioe_apis()
oi.UserEmail='xxxxxxxxxx'
oi.UserPassword='xxxxxxxxxxx'
ResponseJson,ResponseCode=oi.GenerateAPIKey()
APIKey=ResponseJson['API Key'])
```

3. Add IoT Device/s

```python
oi.APIKey=APIKey
oi.DeviceName='Test000'
oi.CryptoName='None'
oi.DataFormat='Value'
ResponseTest,ResponseCode=oi.CreateDevice()
print(ResponseTest)
print(ResponseCode)
```

4. Read from IoT Device

```python
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadValue()
print(SensorData)
print(ResposeCode)
```

5. Write to IoT Device

```python
oi.Data=10
SensorData,ResposeCode=oi.WriteValue()
print(SensorData)
print(ResposeCode)
```


# List of Functions

<table><thead><tr><th width="69">No</th><th width="165">Method</th><th width="465">Description</th></tr></thead><tbody><tr><td>1</td><td>ReadValue</td><td>To read the sensor data from single nodes. The type of data is "Numeric/String". </td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadValue()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>2</td><td>WriteValue</td><td>To modify the control signal at single nodes. Type of data is "Numeric/String".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xx
oi.Data=10
SensorData,ResposeCode=oi.WriteValue()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>3</td><td>ReadJSON</td><td>To read the sensor data from single nodes. Type of data is "JSON".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadJSON()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>4</td><td>WriteJSON</td><td>To modify the control signal at single nodes. Type of data is "JSON".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
oi.DataJSON={'Value': '10'}
SensorData,ResposeCode=oi.WriteJSON()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>5</td><td>ReadXML</td><td>To read the sensor data from single nodes. Type of data is "XML".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadXML()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>6</td><td>WriteXML</td><td>To modify the control signal at single nodes. Type of data is "XML".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
oi.DataXML='&#x3C;Name>OpenIoE&#x3C;/Name>'
SensorData,ResposeCode=oi.WriteXML()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>7</td><td>Read</td><td>To read the sensor data from multiple nodes. Type of data is "Numeric/String".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.UserIDPinAPIKeys=[[xx, xxx], [x, xxx]]
SensorData,ResposeCode=oi.Read()
print(SensorData)
print(ResposeCode)
</code></pre></td></tr><tr><td>8</td><td>Write</td><td>To modify the control signal at multiple nodes. Type of data is "Numeric/String".</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.UserIDPinAPIKeys=[[xx, xxx], [xx, xxx]]
oi.Data=[xx,xx]
Confirmation,ResposeCode=oi.ReadAPI()
print(Confirmation)
print(ResposeCode)
</code></pre></td></tr><tr><td>9</td><td>GenerateAPIKey</td><td>To generate new API key for a given email and password.</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi.UserEmail='xxxxxxxxxx'
oi.UserPassword='xxxxxxxxxxx'
ResponseJson,ResponseCode=oi.GenerateAPIKey()
print(ResponseJson['User ID'])
print(ResponseJson['API Key'])
print(ResponseJson['Message'])
print(ResponseCode)
</code></pre></td></tr><tr><td>10</td><td>CreateDevice</td><td>To add new IoT device for a given API key, name, cryptotype and data format.</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi.APIKey='pnHEmHgjFl0PT247Eae9'
oi.DeviceName='Test000'
oi.CryptoName='None'
oi.DataFormat='Value' # 'XML' or 'JSON'
ResponseTest,ResponseCode=oi.CreateDevice()
print(ResponseTest)
print(ResponseCode)
</code></pre></td></tr><tr><td>11</td><td>Developer</td><td>To display the developer information</td></tr><tr><td></td><td></td><td><pre class="language-python"><code class="lang-python">from openioe.openioe_apis import *
oi=openioe_apis()
oi.Developer()
</code></pre></td></tr></tbody></table>


# Examples


# Read Function


# Write Function


# Create Function


# Matlab Client

Open IoE Matlab client is developed using Matlab App Designer and Matlab programming. This application is used to interact with Open IoE Platform. https\://openioe.in

<figure><img src="https://2832191669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgk0vtTewlg1A7XSefbCZ%2Fuploads%2FE4AJLS11b5SR4N5AJ7Eu%2Fmatlabplot.png?alt=media&amp;token=a7da07d9-7228-49e9-9334-ea0657c004f9" alt=""><figcaption></figcaption></figure>

Features of Matlab CLient are,

* Fetch data from IoT paltform
* Plot real time data
* Display sensor value in a gauge
* Control the IoT devices

Procedure to work on Matlab Client

* Register - OpenIoE (<https://openioe.in>)
* Login to OpenIoE platform
* Create IoT devices using Online portal. (<https://app.openioe.in>)
* Open Matlab Client from Matlab and Login
* Add IoT devices in the configuration tab
* Click on Data>>Fetch Data
* Click on Plot>>Plot Start
* Click on Gauge>>Gauge start

Download Matlab client from the following places,

{% embed url="<https://in.mathworks.com/matlabcentral/fileexchange/160856-openioe-matlab-client>" %}

{% @github-files/github-code-block url="<https://github.com/Gnanodaya/OpenIoE-Matlab-Client/>" %}


