This is the documentation for Antares ESP8266 library.
This library is meant to simplify the process of retrieving and deploying data to Antares IoT Platform's REST API using ESP8266 with Arduino framework.
This library has been tested with Arduino ESP8266 version 2.5.0.
For dependencies, this library uses bblanchon's ArduinoJson v5 and is already included in the bundle.
For more information regarding the platform itself, please visit Antares' official website.
Arduino IDE
Please note that AntaresStoreSecure
and AntaresGetLatestSecure
are preferred than AntaresStoreData
and AntaresGetLatestSecure
because they use HTTPS (port 8443) rather than HTTP (port 8080).
Class
AntaresESP8266HTTP
All methods and properties need to be insantiated in order to use them.
AntaresESP8266HTTP(String ACCESSKEY)
The constructor of class AntaresESP8266HTTP
. Put your Antares account access key as the parameter. The access key should be an Arduino String
datatype.void wifiConnection(String projectName, String deviceName)
void wifiConnectionNonSecure(String projectName, String deviceName)
void getNonSecure(String projectName, String deviceName)
(Not recommended) Fetch the latest data from your Antares project device through HTTP port 8080 (non-secure).
The data will be stored in the jsonGetString
property of class AntaresESP8266HTTP
void get(String projectName, String deviceName)
(Recommended) Fetch the latest data from your Antares project device through HTTPS port 8443 (secure).
The data will be stored in the jsonGetString
property of class AntaresESP8266HTTP
void getSuccess()
Check if the latest data is successfully received.
String getString(String key)
or String getString(String key, String key2)
Get String
data by accessing the JSON key
from jsonGetString
.
int getInt(String key)
or int getInt(String key, String key2)
Get int
data by accessing the JSON key
from jsonGetString
.
float getFloat(String key)
or float getFloat(String key, String key2)
Get float
data by accessing the JSON key
from jsonGetString
.
double getDouble(String key)
or double getDouble(String key, String key2)
Get double
data by accessing the JSON key
from jsonGetString
.
void add(String key, value)
or void add(String key, String key2, value)
Insert a JSON key-value data to the property jsonString
of class AntaresESP8266HTTP
. The value
parameter is overloaded. The supported data types for the value parameter are:
String
int
float
double
void sendNonSecure(String projectName, String deviceName)
(Not recommended) Send the data stored in jsonString
property of class AntaresESP8266HTTP
through HTTP port 8080 (non-secure).
void send(String projectName, String deviceName)
(Recommended) Send the data stored in jsonString
property of class AntaresESP8266HTTP
through HTTPS port 8443 (secure).
String createDevice(String projectName, String deviceName)
String retrieveAllData(String projectName, String deviceName, int limit=0)
limit
parameter if you want to limit the amount of data ID. String retrieveAllDevice(String projectName, int limit=0)
limit
parameter if you want to limit the amount of device ID. Powered by Telkom Indonesia