Pendahuluan

ANTARES merupakan sebuah Horizontal IoT Platform, yang berarti kami mencoba untuk menjadikan layanan kami se-umum mungkin agar solusi vertikal IoT anda dapat menyesuaikan dengan arsitektur yang umumnya digunakan. Banyak kasus-kasus IoT yang dapat dipecahkan dengan menggunakan layanan kami, contohnya adalah smart home, smart metering, asset tracking, smart building, dan lain-lain.

Dokumentasi ini akan menunjukkan anda cara untuk mengirim data sensor ke ANTARES. Ada 4 tahapan yang dapat ditempuh untuk mencapai hal tersebut:

  1. Registrasi akun
  2. Buat app
  3. Tambahkan device
  4. Pengiriman data ke Antares

Langkah-langkah yang lebih rinci dapat anda temukan setelah segmen ini. Jika terdapat informasi yang salah atau ada bagian dari tutorial ini yang tidak lengkap, jangan ragu untuk memberitahu kami pada email support@antares.id.


1. Registrasi Akun

Konsol ANTARES terdapat pada link berikut. Jika anda telah memiliki akun ANTARES, silahkan langsung login ke konsol. Jika belum, anda perlu melakukan registrasi agar dapat menggunakan layanan ANTARES. Ingin melakukan registrasi? silahkan kunjungi link berikut atau dengan klik tombol Register di halaman konsol.

Gambar 1. Antarmuka Halaman Login

Gambar 2. Antarmuka Halaman Registrasi

Setelah mengisi hal-hal yang diperlukan, kami akan mengirim anda email verifikasi. Harap untuk klik tautan yang terdapat pada email tersebut untuk melakukan verifikasi pada akun anda. Jika email verifikasi belum muncul pada email anda, anda bisa klik Resend Verification seperti pada gambar di bawah.

Gambar 3. Antarmuka Kirim Ulang Verifikasi

Karena anda sudah membuat akun, anda bisa langsung masuk ke konsol ANTARES. Tampilannya akan seperti di bawah.

Gambar 4. Antarmuka Konsol Pengguna

2. Buat App

Sebelum membuat application, anda harus membangkitkan access key. Proses ini hanya dilakukan sekali jika anda merupakan pengguna baru ANTARES. Anda dapat menemukan pilihan ini dengan mengunjungi menu Account -> Access Key -> Get Access key. Access Key merupakan identitas akun anda. Harap simpan access key anda secara aman.

Gambar 4. Antarmuka Mendapatkan Access Key

Setelah selesai, kita dapat membuat application. Kembali ke menu Application pada halaman dashboard, klik Create an Application. Anda akan masuk ke halaman berikut:

Gambar 5. Antarmuka Pembuatan Application

Silahkan isi dengan informasi yang diperlukan.

Gambar 6. Antarmuka Pembuatan Application

Selamat, anda telah membuat application pertama anda di ANTARES! Anda dapat menemukan application yang telah dibuat pada dashboard anda.

3. Tambah Device ke Application

Internet of Things bersangkutan dengan benda-benda atau things. Pada segmen ini, kita akan membuat suatu device untuk tempat menaruh data.

Halaman di bawah akan muncul. Silahkan klik Add Device. Selain klik Add Device untuk menambahkan device, anda juga dapat membuat device dengan menggunakan RESTful API pada segmen HTTP API. Anda juga dapat melakukan subscription ke device, jadi jika ada data baru yang masuk ke device, anda akan mendapatkan notifikasi. Anda dapat memanfaatkan notifikasi tersebut untuk membuat logika pada program yang anda buat.

Ambil nama untuk device anda. Dalam kasus ini, kami akan beri nama "SmartEye1"

Setelah device berhasil dibuat, akan muncul di dashboard anda seperti berikut.

Anda telah sukses membuat sebuah device. Ikuti langkah berikutnya untuk menaruh data pada device yang telah anda buat.

4. Quickstart

Di bawah ini adalah beberapa contoh kode yang dapat anda gunakan untuk mengirim data dari proyek yang telah anda buat ke ANTARES.

Di bawah ini adalah video tutorial yang dapat anda gunakan untuk mengirim dan mendapatkan data dari ANTARES melalui ESP8266 (HTTP).
Harap install library ini pada Arduino IDE.
#include <AntaresESP8266HTTP.h>

#define ACCESSKEY "your-access-key"
#define WIFISSID "your-wifi-ssid"
#define PASSWORD "your-wifi-password"

#define projectName "your-project-name"
#define deviceName "your-device-name"

AntaresESP8266HTTP antares(ACCESSKEY);

void setup() {
  Serial.begin(115200);
  antares.setDebug(true);
  antares.wifiConnection(WIFISSID,PASSWORD);
}

void loop() {
  int temp = random(25,30);
  int hum = random(75,90);

  antares.add("temperature", temp);
  antares.add("humidity", hum);

  antares.send(projectName, deviceName);
  delay(10000);
}
Harap install library ini pada Arduino IDE.
#include <AntaresESP8266MQTT.h>

#define ACCESSKEY "your-access-key"
#define WIFISSID "your-wifi-ssid"
#define PASSWORD "your-wifi-password"

#define projectName "your-project-name"
#define deviceName "your-device-name"

AntaresESP8266MQTT antares(ACCESSKEY);

void setup() {
  Serial.begin(115200);
  antares.setDebug(true);
  antares.wifiConnection(WIFISSID,PASSWORD);
  antares.setMqttServer();
}

void loop() {
  int temp = random(25,30) ;
  int hum = random(75,90);

  antares.add("temperature", temp);
  antares.add("humidity", hum);

  antares.publish(projectName, deviceName);
  delay(5000);
}

Silahkan install antares-http dengan npm terlebih dahulu, pastikan npm dan NodeJS terinstall pada CMD (Windows) atau Terminal (Linux):

Informasi lebih lanjut mengenai Antares untuk NodeJS dapat dilihat di halaman npm antares-http.

npm init
npm install antares-http --save
const antares = require('antares-http');

data = {
  temperature: 32,
  humidity: 80,
}
antares.setAccessKey('your-access-key');
antares.send(data, 'your-project-name', 'your-device-name')
.then((response) => {
  console.log(response);
});

Silahkan install antares-http dengan pip terlebih dahulu, pastikan pip dan Python terinstall pada CMD (Windows) atau Terminal (Linux):

Informasi lebih lanjut mengenai Antares untuk Python dapat dilihat di halaman PyPi antares-http.

pip install antares-http
from antares_http import antares

data = {
    'temperature' : 32,
    'humidity' : 80
}
antares.setAccessKey('your-access-key')
antares.send(data, 'your-project-name', 'your-device-name')

Selamat, anda telah mengirim data ke ANTARES.


Contoh Kode dan Library

Di bawah ini adalah SDK (Source Development Kit) untuk beberapa device IoT. Jika device yang anda pakai tidak terdapat di bawah ini, anda tetap dapat menggunakan layanan kami dengan menggunakan RESTful API. Apakah anda merupakan seorang device maker? Ingin bekerjasama dengan kami? Ingin membuat library device anda tersedia untuk komunitas kami? Anda dapat menghubungi kami pada support@antares.id

.

Arduino Uno

Go To Tutorial

ESP 32 (Wi-Fi)

Go To Tutorial

Raspberry Pi

Go To Tutorial

Arduino Pro Mini (LoRa)

Go To Tutorial

ESP32 (LoRa)

Go To Tutorial

LoRa STM32 (Arduino IDE)

Go To Tutorial

LoRa STM32 (STM32Cube IDE)

Go To Tutorial

MIT App Inventor

Go To Tutorial

MQTT | Push data to Device

Go To Tutorial

HTTP | Subscribe and Notify Mechanism

Go To Tutorial

Orange Pi Zero

Go To Tutorial

Library PHP

Go To Tutorial

MQTT | Subscribe LoRa Device

Go To Tutorial
Go To Tutorial

Register Perangkat LoRaWAN

Go To Tutorial

GPS TrackerID

Go To Tutorial

Data Model


Port Configuration

HTTP

Non-TLS

8080

TLS

8443

MQTT

Non-TLS

1883

TLS

8883

CoAP

Non-TLS

5683

TLS

5684


API HTTP

Pendahuluan

Antares menggunakan approach RESTful dalam mengembangkan API sehingga API yang disediakan lebih representatif dan mudah digunakan user. Sebuah API terdiri atas URL dan parameter.

URL

URL merupakan kependekan dari Uniform Resource Locator. URL dalam bahasa sederhana adalah link. URL tersusun dari domain dan diikuti port. Dalam banyak kasus, https tidak terlihat portnya, ketika server tersebut menggunakan port default (443). Oleh karena itu, server yang tidak menggunakan port default, harus dicantumkan portnya, contoh

https://platform.antares.id:8443

Penjelasan lebih detail terkait RESTful API bisa didapatkan di https://www.restapitutorial.com/

Parameter

Parameter digunakan ketika ingin menginputkan sesuatu melalui API. Parameter bisa terdapat di Headers, Path, dan Query String Parameter.

Header Parameter

X-M2M-Origin:{{access-key}}
Content-Type:application/json;ty=3
Accept:application/json

Path Parameter

https://platform.antares.id:8443/~/antares-cse/antares-id/{{your-application-name}}

Query String Parameter

Query string parameters digunakan dengan simbol tanda tanya (?) di URLnya. Setelah tanda tanya (?) adalah parameter dan nilainya yang dihubungkan dengan simbol sama dengan (=). Setiap query string parameter dipisahkan dengan simbol (&).

https://platform.antares.id:8443/~/antares-cse/antares-id/{{your-application-name}}?fu=1&ty=3&lim=5

Penjelasan lebih detail terkait parameters silahkan dapatkan di https://idratherbewriting.com/learnapidoc/docapis_doc_parameters.html


List Query String Parameter

Parameter Value Keterangan
fu
0 Non-aktifkan Filter
1 Aktfikan Filter
lim
n Jumlah response yang diharapkan

Device

Create

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=3
    Accept application/xml
    Body
    <m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="your-device-name">
    </m2m:cnt>
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=3
    Accept application/json
    Body
    {
        "m2m:cnt": {
        "rn": "your-device-name"
        }
    }
  • Response
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" 
    xmlns:hd="http://www.onem2m.org/xml/protocols/homedomain" rn="your-device-name">
    <ty>3</ty>
    <ri>/antares-cse/cnt-377170374</ri>
    <pi>/antares-cse/CAE492050112</pi>
    <ct>20191119T160648</ct>
    <lt>20191119T160648</lt>
    <acpi>/antares-cse/acp-35730207</acpi>
    <acpi>/antares-cse/acp-891035820</acpi>
    <et>20201119T160648</et>
    <st>0</st>
    <mni>30000000</mni>
    <mbs>10000</mbs>
    <mia>0</mia>
    <cni>0</cni>
    <cbs>0</cbs>
    <ol>/antares-cse/antares-id/your-application-name/your-device-name/ol</ol>
    <la>/antares-cse/antares-id/your-application-name/your-device-name/la</la>
    </m2m:cnt>
    {
        "m2m:cnt": {
            "rn": "learnLora",
            "ty": 3,
            "ri": "/antares-cse/cnt-456680027",
            "pi": "/antares-cse/CAE492050112",
            "ct": "20191119T162939",
            "lt": "20191119T162939",
            "acpi": [
                "/antares-cse/acp-35730207",
                "/antares-cse/acp-891035820"
            ],
            "et": "20201119T162939",
            "st": 0,
            "mni": 30000000,
            "mbs": 10000,
            "mia": 0,
            "cni": 0,
            "cbs": 0,
            "ol": "/antares-cse/antares-id/your-application-name/your-device-name/ol",
            "la": "/antares-cse/antares-id/your-application-name/your-device-name/la"
        }
    }

Retrieve All Devices ID of a Particular Project

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name?fu=1&ty=3
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID?fu=1&ty=3

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name?fu=1&ty=3
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID?fu=1&ty=3

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json
    Accept application/json
  • Response
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain">/antares-cse/antares-id/your-application-name/your-device-name
    /antares-cse/antares-id/your-application-name/your-device-name2
    </m2m:uril>
    {
        "m2m:uril": [
            "/antares-cse/antares-id/your-application-name/your-device-name",
            "/antares-cse/antares-id/your-application-name/your-device-name2",
        ]
    }

Retrieve a Particular Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json
    Accept application/json
  • Response
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:cnt xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/xml/
    protocols/homedomain" rn="your-device-name">
        <ty>3</ty>
        <ri>/antares-cse/cnt-456680027</ri>
        <pi>/antares-cse/CAE492050112</pi>
        <ct>20191119T162939</ct>
        <lt>20191119T162939</lt>
        <acpi>/antares-cse/acp-35730207</acpi>
        <acpi>/antares-cse/acp-891035820</acpi>
        <et>20201119T162939</et>
        <st>0</st>
        <mni>30000000</mni>
        <mbs>10000</mbs>
        <mia>0</mia>
        <cni>0</cni>
        <cbs>0</cbs>
        <ol>/antares-cse/antares-id/your-application-name/your-device-name/ol</ol>
        <la>/antares-cse/antares-id/your-application-name/your-device-name/la</la>
    </m2m:cnt>
    {
        "m2m:cnt": {
            "rn": "your-device-name",
            "ty": 3,
            "ri": "/antares-cse/cnt-456680027",
            "pi": "/antares-cse/CAE492050112",
            "ct": "20191119T162939",
            "lt": "20191119T162939",
            "acpi": [
                "/antares-cse/acp-35730207",
                "/antares-cse/acp-891035820"
            ],
            "et": "20201119T162939",
            "st": 0,
            "mni": 30000000,
            "mbs": 10000,
            "mia": 0,
            "cni": 0,
            "cbs": 0,
            "ol": "/antares-cse/antares-id/your-application-name/your-device-name/ol",
            "la": "/antares-cse/antares-id/your-application-name/your-device-name/la"
        }
    }

Delete a Particular Device

Field Value
URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name
or
https://platform.antares.id:8443/~/antares-cse/your-device-ID

Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
Method DELETE
Header Key Value
X-M2M-Origin access-id:access-password
Content-Type application/xml
Accept application/xml
Body -
Field Value
URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name
or
https://platform.antares.id:8443/~/antares-cse/your-device-ID

Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
Method DELETE
Header Key Value
X-M2M-Origin access-id:access-password
Content-Type application/json
Accept application/json
Body -

Data of Device

Store Data of a Particular Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=4
    Accept application/xml
    Body
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols">
    <con>&lt;obj&gt;
            &lt;num key1="value1"/&gt;
            &lt;str key2="value2"/&gt;
            &lt;bool keyN="valueN"/&gt;
    &lt;/obj&gt;</con>
    </m2m:cin>
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=4
    Accept application/json
    Body
    {
        "m2m:cin": {
        "con": "{\"key1\":integer-value, \"key2\":\"string-value\", \"keyN\":\"valueN\"}"
        }
    }
    Note!!
    Key adalah nama variable sedangkan value adalah nilai dari variable tersebut.
  • Response
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="cin_178578843">
        <ty>4</ty>
        <ri>/antares-cse/cin-178578843</ri>
        <pi>/antares-cse/cnt-995741382</pi>
        <ct>20191119T171604</ct>
        <lt>20191119T171604</lt>
        <st>0</st>
        <cnf>text/plain:0</cnf>
        <cs>100</cs>
        <con><obj>
            <num key1="value1"/>
            <str key2="value2"/>
            <bool keyN="valueN"/>
        </obj></con>
    </m2m:cin>
    {
        "m2m:cin": {
            "rn": "cin_893238184",
            "ty": 4,
            "ri": "/antares-cse/cin-893238184",
            "pi": "/antares-cse/cnt-995741382",
            "ct": "20191119T180722",
            "lt": "20191119T180722",
            "st": 0,
            "cnf": "text/plain:0",
            "cs": 62,
            "con": "{\"key1\":integer-value, \"key2\":\"string-value\", \"keyN\":\"valueN\"}"
        }
    }

Retrieve All Data ID of Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name?fu=1&ty=4&drt=1
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID?fu=1&ty=4&drt=1

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name?fu=1&ty=4&drt=1
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID?fu=1&ty=4&drt=1

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json
    Accept application/json
  • Response
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain">/antares-cse/antares-id/your-application-name/your-device-name/cin_893238184 
    /antares-cse/antares-id/your-application-name/your-device-name/cin_178578843</m2m:uril>
    {
        "m2m:uril": [
            "/antares-cse/antares-id/your-application-name/your-device-name/cin_893238184",
            "/antares-cse/antares-id/your-application-name/your-device-name/cin_178578843"
        ]
    }

Retrieve Particular Data of Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/data-of-device-ID
    or
    https://platform.antares.id:8443/~/antares-cse/data-of-device-ID

    Note: data-of-device-ID is the one you got while Retrieving All Data of Device ID.
    It must be starting with cin. e.g. cin-122882447
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/data-of-device-ID
    or
    https://platform.antares.id:8443/~/antares-cse/data-of-device-ID

    Note: data-of-device-ID is the one you got while Retrieving All Data of Device ID.
    It must be starting with cin. e.g. cin-122882447
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json
    Accept application/json
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="cin_893238184">
        <ty>4</ty>
        <ri>/antares-cse/cin-893238184</ri>
        <pi>/antares-cse/cnt-995741382</pi>
        <ct>20191119T180722</ct>
        <lt>20191119T180722</lt>
        <st>0</st>
        <cnf>text/plain:0</cnf>
        <cs>62</cs>
        <con>{"key1":integer-value, "key2":"string-value", "keyN":"valueN"}</con>
    </m2m:cin>
    Result
    {
        "m2m:cin": {
            "rn": "cin_893238184",
            "ty": 4,
            "ri": "/antares-cse/cin-893238184",
            "pi": "/antares-cse/cnt-995741382",
            "ct": "20191119T180722",
            "lt": "20191119T180722",
            "st": 0,
            "cnf": "text/plain:0",
            "cs": 62,
            "con": "{\"key1\":integer-value, \"key2\":\"string-value\", \"keyN\":\"valueN\"}"
        }
    }

Retrieve Latest Data

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/la
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=4
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/la
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=4
    Accept application/json
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="cin_893238184">
        <ty>4</ty>
        <ri>/antares-cse/cin-893238184</ri>
        <pi>/antares-cse/cnt-995741382</pi>
        <ct>20191119T180722</ct>
        <lt>20191119T180722</lt>
        <st>0</st>
        <cnf>text/plain:0</cnf>
        <cs>62</cs>
        <con>{"key1":integer-value, "key2":"string-value", "keyN":"valueN"}</con>
    </m2m:cin>
    Result
    {
        "m2m:cin": {
            "rn": "cin_893238184",
            "ty": 4,
            "ri": "/antares-cse/cin-893238184",
            "pi": "/antares-cse/cnt-995741382",
            "ct": "20191119T180722",
            "lt": "20191119T180722",
            "st": 0,
            "cnf": "text/plain:0",
            "cs": 62,
            "con": "{\"key1\":integer-value, \"key2\":\"string-value\", \"keyN\":\"valueN\"}"
        }
    }

Retrieve Oldest Data

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/ol
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=4
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/ol
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=4
    Accept application/json
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:cin xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="cin_178578843">
        <ty>4</ty>
        <ri>/antares-cse/cin-178578843</ri>
        <pi>/antares-cse/cnt-995741382</pi>
        <ct>20191119T171604</ct>
        <lt>20191119T171604</lt>
        <st>0</st>
        <cnf>text/plain:0</cnf>
        <cs>100</cs>
        <con><obj>
            <num key1="value1"/>
            <str key2="value2"/>
            <bool keyN="valueN"/>
    </obj></con>
    </m2m:cin>
    Result
    {
        "m2m:cin": {
            "rn": "cin_178578843",
            "ty": 4,
            "ri": "/antares-cse/cin-178578843",
            "pi": "/antares-cse/cnt-995741382",
            "ct": "20191119T171604",
            "lt": "20191119T171604",
            "st": 0,
            "cnf": "text/plain:0",
            "cs": 100,
            "con": "<obj>\n
                        <num key1=\"value1\"/>\n
                        <str key2=\"value2\"/>\n        
                        <bool keyN=\"valueN\"/>\n
                    </obj>"
        }
    }

Grouping

Create Group of Devices

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=9
    Accept application/xml
    Body
    <m2m:grp xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="group-name">
                <mt>3</mt>
                <mid>/antares-cse/your-device-id-1 /antares-cse/your-device-id-2</mid>
                <mnm>10</mnm>
            </m2m:grp>
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=9
    Accept application/json
    Body
    {
              "m2m:grp": {
                "rn": "group-name2",
                "mt": "3",
                "mid": ["/antares-cse/cnt-516560931","/antares-cse/cnt-639303104"],
                "mnm": "10"
              }
            }
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:ae xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="your-application-name">
        <ty>2</ty>
        <ri>/antares-cse/CAE492050112</ri>
        <pi>/antares-cse</pi>
        <ct>20191106T084841</ct>
        <lt>20191106T084841</lt>
        <lbl>User/demo@antares.id</lbl>
        <acpi>/antares-cse/acp-35730207</acpi>
        <acpi>/antares-cse/acp-891035820</acpi>
        <et>20201106T084841</et>
        <apn>your-application-name</apn>
        <api>1</api>
        <aei>CAE492050112</aei>
        <rr>false</rr>
    </m2m:ae>
    Result
    {
        "m2m:ae": {
            "rn": "your-application-name",
            "ty": 2,
            "ri": "/antares-cse/CAE492050112",
            "pi": "/antares-cse",
            "ct": "20191106T084841",
            "lt": "20191106T084841",
            "lbl": [
                "User/demo@antares.id"
            ],
            "acpi": [
                "/antares-cse/acp-35730207",
                "/antares-cse/acp-891035820"
            ],
            "et": "20201106T084841",
            "apn": "your-application-name",
            "api": "1",
            "aei": "CAE492050112",
            "rr": false
        }
    }

Retrieve Group Info

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-group-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-group-ID

    Note: your-project-ID must be starting with grp. e.g. grp-123456789
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=9
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-group-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-group-ID

    Note: your-project-ID must be starting with grp. e.g. grp-123456789
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=9
    Accept application/json
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:grp xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="group-name2">
        <pi>/antares-cse/CAE492050112</pi>
        <ct>20191120T095118</ct>
        <lt>20191120T095118</lt>
        <acpi>/antares-cse/acp-35730207</acpi>
        <acpi>/antares-cse/acp-891035820</acpi>
        <et>20201120T095118</et>
        <mt>3</mt>
        <cnm>2</cnm>
        <mnm>10</mnm>
        <mid>/antares-cse/cnt-995741382 /antares-cse/cnt-473390910</mid>
        <mtv>true</mtv>
        <csy>1</csy>
        <fopt>null/fopt</fopt>
    </m2m:grp>
    Result
    {
            "m2m:grp": {
                "rn": "group-name2",
                "pi": "/antares-cse/CAE492050112",
                "ct": "20191120T095118",
                "lt": "20191120T095118",
                "acpi": [
                    "/antares-cse/acp-35730207",
                    "/antares-cse/acp-891035820"
                ],
                "et": "20201120T095118",
                "mt": 3,
                "cnm": 2,
                "mnm": 10,
                "mid": [
                    "/antares-cse/cnt-995741382",
                    "/antares-cse/cnt-473390910"
                ],
                "mtv": true,
                "csy": 1,
                "fopt": "null/fopt"
            }
        }

Retrieve Devices Info of a Group

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-group-name/fopt
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=9
    Accept application/xml
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-group-name/fopt
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=9
    Accept application/json
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
            <m2m:agr xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
            xml/protocols/homedomain">
                <m2m:rsp>
                    <rsc>2000</rsc>
                    <pc>
                        <m2m:cnt rn="learnLora">
                            <ty>3</ty>
                            <ri>/antares-cse/cnt-995741382</ri>
                            <pi>/antares-cse/CAE492050112</pi>
                            <ct>20191119T170708</ct>
                            <lt>20191119T170708</lt>
                            <acpi>/antares-cse/acp-35730207</acpi>
                            <acpi>/antares-cse/acp-891035820</acpi>
                            <et>20201119T170708</et>
                            <st>0</st>
                            <mni>30000000</mni>
                            <mbs>10000</mbs>
                            <mia>0</mia>
                            <cni>0</cni>
                            <cbs>0</cbs>
                            <ol>/antares-cse/antares-id/your-application-name/learnLora/ol</ol>
                            <la>/antares-cse/antares-id/your-application-name/learnLora/la</la>
                        </m2m:cnt>
                    </pc>
                    <to>e7e349fc2216941a:9d0cf82c25277bdd</to>
                    <fr>/antares-cse</fr>
                </m2m:rsp>
                <m2m:rsp>
                    <rsc>2000</rsc>
                    <pc>
                        <m2m:cnt rn="learn_Lora">
                            <ty>3</ty>
                            <ri>/antares-cse/cnt-473390910</ri>
                            <pi>/antares-cse/CAE492050112</pi>
                            <ct>20191120T095033</ct>
                            <lt>20191120T095033</lt>
                            <acpi>/antares-cse/acp-35730207</acpi>
                            <acpi>/antares-cse/acp-891035820</acpi>
                            <et>20201120T095033</et>
                            <st>0</st>
                            <mni>30000000</mni>
                            <mbs>10000</mbs>
                            <mia>0</mia>
                            <cni>0</cni>
                            <cbs>0</cbs>
                            <ol>/antares-cse/antares-id/your-application-name/learn_Lora/ol</ol>
                            <la>/antares-cse/antares-id/your-application-name/learn_Lora/la</la>
                        </m2m:cnt>
                    </pc>
                    <to>e7e349fc2216941a:9d0cf82c25277bdd</to>
                    <fr>/antares-cse</fr>
                </m2m:rsp>
            </m2m:agr>
    Result
    {
            "m2m:agr": {
                "m2m:rsp": [
                    {
                        "m2m:rsc": 2000,
                        "m2m:pc": {
                        "m2m:cnt": {
                            "rn": "learnLora",
                            "ty": 3,
                            "ri": "/antares-cse/cnt-995741382",
                            "pi": "/antares-cse/CAE492050112",
                            "ct": "20191119T170708",
                            "lt": "20191119T170708",
                            "acpi": [
                                "/antares-cse/acp-35730207",
                                "/antares-cse/acp-891035820"
                            ],
                            "et": "20201119T170708",
                            "st": 0,
                            "mni": 30000000,
                            "mbs": 10000,
                            "mia": 0,
                            "cni": 0,
                            "cbs": 0,
                            "ol": "/antares-cse/antares-id/your-application-name/learnLora/ol",
                            "la": "/antares-cse/antares-id/your-application-name/learnLora/la"
                        }
                        },
                        "m2m:to": "e7e349fc2216941a:9d0cf82c25277bdd",
                        "m2m:fr": "/antares-cse"
                    },
                    {
                        "m2m:rsc": 2000,
                        "m2m:pc": {
                        "m2m:cnt": {
                            "rn": "learn_Lora",
                            "ty": 3,
                            "ri": "/antares-cse/cnt-473390910",
                            "pi": "/antares-cse/CAE492050112",
                            "ct": "20191120T095033",
                            "lt": "20191120T095033",
                            "acpi": [
                                "/antares-cse/acp-35730207",
                                "/antares-cse/acp-891035820"
                            ],
                            "et": "20201120T095033",
                            "st": 0,
                            "mni": 30000000,
                            "mbs": 10000,
                            "mia": 0,
                            "cni": 0,
                            "cbs": 0,
                            "ol": "/antares-cse/antares-id/your-application-name/learn_Lora/ol",
                            "la": "/antares-cse/antares-id/your-application-name/learn_Lora/la"
                        }
                        },
                        "m2m:to": "e7e349fc2216941a:9d0cf82c25277bdd",
                        "m2m:fr": "/antares-cse"
                    }
                ]
            }
        }

Delete Group of Devices

Field Value
URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-group-name
or
https://platform.antares.id:8443/~/antares-cse/your-group-ID

Note: your-project-ID must be starting with grp. e.g. grp-123456789
Method GET
Header Key Value
X-M2M-Origin access-id:access-password
Content-Type application/xml;ty=9
Accept application/xml
Field Value
URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-group-name
or
https://platform.antares.id:8443/~/antares-cse/your-group-ID

Note: your-project-ID must be starting with grp. e.g. grp-123456789
Method DELETE
Header Key Value
X-M2M-Origin access-id:access-password
Content-Type application/json;ty=9
Accept application/json

Subscriber

Create Subscriber of Project

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/application-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=23
    Accept application/xml
    Body
    <m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="your-subscriber-name">
                <nu>your-server-address</nu>
                <nct>2</nct>
            </m2m:sub>
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/application-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=23
    Accept application/json
    Body
    {
                "m2m:sub": {
                    "rn": "your-subscriber-name",
                    "nu": "your-server-hostname-or-ip",
                    "nct": 2
                }
            }
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="your-subscriber-name">
        <ty>23</ty>
        <ri>/antares-cse/sub-841863552</ri>
        <pi>/antares-cse/CAE492050112</pi>
        <ct>20191120T160045</ct>
        <lt>20191120T160045</lt>
        <acpi>/antares-cse/acp-35730207</acpi>
        <acpi>/antares-cse/acp-891035820</acpi>
        <nu>your-server-address</nu>
        <nct>2</nct>
    </m2m:sub>
    Result
    {
        "m2m:sub": {
            "rn": "your-subscriber-Name",
            "ty": 23,
            "ri": "/antares-cse/sub-542371250",
            "pi": "/antares-cse/CAE492050112",
            "ct": "20191120T160324",
            "lt": "20191120T160324",
            "acpi": [
                "/antares-cse/acp-35730207",
                "/antares-cse/acp-891035820"
            ],
            "nu": [
                "your-server-hostname-or-ip"
            ],
            "nct": 2
        }
    }

Create Subscriber of Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/application-name/device-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml;ty=23
    Accept application/xml
    Body
    <m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="your-subscriber-name">
                <nu>your-server-address</nu>
                <nct>2</nct>
            </m2m:sub>
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/application-name/device-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID

    Note: <your-device-ID> must be starting with CNT. e.g. CNT-842419289
    Method POST
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/json;ty=23
    Accept application/json
    Body
    {
                "m2m:sub": {
                    "rn": "your-subscriber-name",
                    "nu": "your-server-hostname-or-ip",
                    "nct": 2
                }
            }
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain" rn="your-subscriber-name">
        <ty>23</ty>
        <ri>/antares-cse/sub-631201523</ri>
        <pi>/antares-cse/cnt-681155603</pi>
        <ct>20191120T112528</ct>
        <lt>20191120T112528</lt>
        <acpi>/antares-cse/acp-35730207</acpi>
        <acpi>/antares-cse/acp-891035820</acpi>
        <nu>your-server-address</nu>
        <nct>2</nct>
    </m2m:sub>
    Result
    {
        "m2m:sub": {
            "rn": "your-subscriberName",
            "ty": 23,
            "ri": "/antares-cse/sub-422069048",
            "pi": "/antares-cse/cnt-869787388",
            "ct": "20191120T155438",
            "lt": "20191120T155438",
            "acpi": [
                "/antares-cse/acp-35730207",
                "/antares-cse/acp-891035820"
            ],
            "nu": [
                "your-server-hostname-or-ip"
            ],
            "nct": 2
        }
    }

Retrieve All Subscribers ID of a Project

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/application-name?fu=1&ty=23
    or
    https://platform.antares.id:8443/~/antares-cse/your-project-ID?fu=1&ty=23

    Note: your-project-ID must be starting with CAE. e.g. CAE760571675
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
    <m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
    xml/protocols/homedomain"></m2m:uril>

Retrieve Particular Subscriber of a Project

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/subscriber-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-subscriber-ID

    Note: your-subscriber-ID must be starting with sub. e.g. sub-123456789
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
        <m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
        xml/protocols/homedomain" rn="your-subscriber-Name">
            <ty>23</ty>
            <ri>/antares-cse/sub-542371250</ri>
            <pi>/antares-cse/CAE492050112</pi>
            <ct>20191120T160324</ct>
            <lt>20191120T160324</lt>
            <acpi>/antares-cse/acp-35730207</acpi>
            <acpi>/antares-cse/acp-891035820</acpi>
            <nu>your-server-hostname-or-ip</nu>
            <nct>2</nct>
        </m2m:sub>

Retrieve All Subscribers ID of a Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/application-name/device-name?fu=1&ty=23
    or
    https://platform.antares.id:8443/~/antares-cse/your-device-ID?fu=1&ty=23

    Note: your-device-ID must be starting with CNT. e.g. CNT-842419289
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
        <m2m:uril xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/xml/
        protocols/homedomain">/antares-cse/antares-id/your-application-name/learnLora/sub_AntaresWebMonitor 
        /antares-cse/antares-id/your-application-name/learnLora/your-subscriberName</m2m:uril>

Retrieve Particular Subscriber of a Device

  • Request
    Field Value
    URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/subscriber-name
    or
    https://platform.antares.id:8443/~/antares-cse/your-subscriber-ID

    Note: your-subscriber-ID must be starting with sub. e.g. sub-123456789
    Method GET
    Header Key Value
    X-M2M-Origin access-id:access-password
    Content-Type application/xml
    Accept application/xml
  • Response
    Result
    <?xml version="1.0" encoding="UTF-8"?>
        <m2m:sub xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:hd="http://www.onem2m.org/
        xml/protocols/homedomain" rn="your-subscriberName">
            <ty>23</ty>
            <ri>/antares-cse/sub-422069048</ri>
            <pi>/antares-cse/cnt-869787388</pi>
            <ct>20191120T155438</ct>
            <lt>20191120T155438</lt>
            <acpi>/antares-cse/acp-35730207</acpi>
            <acpi>/antares-cse/acp-891035820</acpi>
            <nu>your-server-hostname-or-ip</nu>
            <nct>2</nct>
        </m2m:sub>

Delete Subscriber of Project

Field Value
URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/subscriber-name
or
https://platform.antares.id:8443/~/antares-cse/your-subscriber-ID

Note: your-subscriber-ID must be starting with sub. e.g. sub-123456789
Method DELETE
Header Key Value
X-M2M-Origin access-id:access-password
Content-Type application/xml
Accept application/xml

Delete Subscriber of Device

Field Value
URL https://platform.antares.id:8443/~/antares-cse/antares-id/your-application-name/your-device-name/subscriber-name
or
https://platform.antares.id:8443/~/antares-cse/your-subscriber-ID

Note: your-subscriber-ID must be starting with sub. e.g. sub-123456789
Method DELETE
Header Key Value
X-M2M-Origin access-id:access-password
Content-Type application/xml
Accept application/xml

MQTT

MQTT[1] (MQ Telemetry Transport atau Message Queue Telemetry Transport) merupakan standar ISO (ISO/IEC PRF 20922)[2] berbasis publish-subscribe yang ringan dan dapat bekerja pada protokol TCP/IP. Ada 5 metode MQTT yaitu Connect, Disconnect, Subscribe, Unsubscribe, dan Publish.

  • Connect: Menunggu sampai koneksi dibangun dengan server .
  • Disconnect: Menunggu client MQTT untuk menyelesaikan tugasnya, dan juga menunggu pemutusan sesi TCP/IP.
  • Subscribe: Menunggu penyelesaian metode Subscribe atau Unsubscribe.
  • Unsubscribe Meminta server untuk unsubscribe pada satu atau banyak topik.
  • Publish: Kembali ke thread aplikasi setelah melempar request ke client MQTT.

mqtt-flow

Architecture of MQTT Communication

Topic

Komunikasi MQTT didasari oleh topik. Topik digunakan untuk memisahkan satu kanal komunikasi dengan kanal lainnya. Spesifikasi teknis oneM2M sudah menyediakan topik khusus yang harus digunakan untuk komunikasi MQTT. Publikasi harus dilakukan pada topik yang spesifik dan respons juga akan diberikan pada topik berbeda yang sudah disediakan sebelumnya.

Publish/Request topic

Bentuk topik request:

/oneM2M/req/your-access-key/antares-cse/choose-a-serialization-format

Subscribe/Response topic

Bentuk topik respons:

/oneM2M/resp/antares-cse/your-access-key/choose-a-serialization-format

LoRa Subscribe/Response topic

Bentuk topik request:

/oneM2M/resp/antares-cse/your-application-name/choose-a-serialization-format

Note

your-access-key adalah access key akun anda. your-application-name adalah nama aplikasi lora anda. choose-a-serialization-format dapat berisi 2 nilai:

  • xml untuk format XML
  • json untuk format JSON

MQTT Broker

Field Value
Host mqtt.antares.id
Port 1883

MQTT Payload

Payload yang dikirim ke topik MQTT adalah RequestPrimitive dan ResponsePrimitive yang telah dilakukan serialisasi. Data-data dikirimkan pada RequestPrimitive dan yang nantinya akan diterima oleh ResponsePrimitive.

Beberapa parameter utamanya adalah:

Singkatan Parameter Nama parameter Kegunaan
fr From Sumber request
to To Penerima request
op Operation Operasi untuk melakukan perintah (CREATE, RETRIEVE, ...)
rqi Request Identifier ID korelasi antara request dan response
pc Primitive Content Konten request (contoh: resource untuk dibuat)
ty Type Tipe resource untuk dibuat
rsc Response Status Code Kode status respons oneM2M

Berikut adalah beberapa operation value:

Operation Value
CREATE 1
RETRIEVE 2
UPDATE 3
DELETE 4
NOTIFY 5
CREATE 6

Device

Create

Request
Field Value
Topic /oneM2M/req/your-access-key/antares-cse/json
Payload
{
      "m2m:rqp" : {
        "fr" : "your-access-key",
        "to" : "/antares-cse/antares-id/your-application-name",
        "op" : 1,
        "rqi": 123456,
        "pc": {
          "m2m:cnt" : {
            "rn": "device-name"
          }
        },
        "ty": 3
      }
    }
    

Delete

Request
Field Value
Topic /oneM2M/req/your-access-key/antares-cse/json
Payload
{
      "m2m:rqp" : {
        "fr" : "your-access-key",
        "to" : "/antares-cse/antares-id/your-application-name/your-device-name",
        "op" : 4,
        "rqi": 123456
      }
    }

Data of Device

Request
Field Value
Topic /oneM2M/req/your-access-key/antares-cse/json
Payload
{
      "m2m:rqp": {
        "fr": "your-access-key",
        "to": "/antares-cse/antares-id/your-application-name/your-device-name",
        "op": 1,
        "rqi": 123456,
        "pc": {
          "m2m:cin": {
            "cnf": "message",
            "con": "{\"your-first-data\":the-integer-value,\"your-second-data\":\"the-string-data\"}"
          }
        },
        "ty": 4
      }
    }
    

Retrieve Latest Data

Request
Field Value
Topic /oneM2M/req/your-access-key/antares-cse/json
Payload
{
      "m2m:rqp": {
        "fr": "your-access-key",
        "to": "/antares-cse/antares-id/your-application-name/your-device-name/la",
        "op": 2,
        "rqi": 123456,
        "ty": 4
        }
    }

List of Acronyms


Acronym Stands for Acronym Stands for
ty Resource Type rr Resource Reachability
rn Resource Name sub Subscriber
ri Resource ID pi Parent ID
ct Created Time lt Last Modified Time
con Content cin contentInstance/Data of Device
op Operation Code fr From

Software Relevan

Berikut adalah beberapa software yang dapat anda gunakan untuk mengembangkan dan melakukan debug pada aplikasi anda.

Postman

logo-glyph

Postman adalah software untuk melakukan simulasi HTTP Request. Sebelum melakukan request pada sebuah API untuk aplikasi yang anda buat, anda dapat melakukan simulasi request dengan Postman telebih dahulu.

Website Postman

MQTT fx

mqttfc-icon

Website MQTT fx

Ngrok

ngrok

Website Ngrok


Referensi

  1. "MQTT 3.1.1 specification". OASIS. December 10, 2015. Retrieved April 25, 2017.
  2. "ISO/IEC 20922:2016 Information technology -- Message Queuing Telemetry Transport (MQTT) v3.1.1".iso.org.International Organization for Standardization. June 15, 2016.