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.
- Install ESP8266 Core for Arduino. For more information please refer to the ESP8266 Core for Arduino's installation manual
- Download the latest release and add this library into Arduino IDE (Sketch > Include Library > Add .ZIP Library...)
Please note that AntaresStoreSecure
and AntaresGetLatestSecure
are preferred than AntaresStoreData
and AntaresGetLatestSecure
because they use HTTPS (port 8443) rather than HTTP (port 8080).
- AntaresCreateDevice - Deploy a device into a project
- AntaresGetAllData - Fetch all data stored in a project device
- AntaresGetAllDevice - Fetch all devices recorded in a project
- AntaresGetLatestData - Fetch the latest data stored in a project device
- AntaresGetLatestSecure - Fetch the latest data stored in a project device through HTTPS
- AntaresStoreData - Deploy data into a project device
- AntaresStoreSecure - Deploy data into a project device through HTTPS
Class
AntaresESP8266HTTP
All methods and properties need to be insantiated in order to use them.
AntaresESP8266HTTP(String ACCESSKEY)
The constructor of classAntaresESP8266HTTP
. Put your Antares account access key as the parameter. The access key should be an ArduinoString
datatype.
void wifiConnection(String projectName, String deviceName)
Connect to WiFi with SNTP matching in order to match with antares' CA Certificate for HTTPS connection (port 8443 in Antares).
void wifiConnectionNonSecure(String projectName, String deviceName)
Connect to WiFi without SNTP matching. Use this if you don't want to use HTTP (port 8080 in Antares) instead of HTTPS.
-
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 thejsonGetString
property of classAntaresESP8266HTTP
-
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 thejsonGetString
property of classAntaresESP8266HTTP
-
void getSuccess()
Check if the latest data is successfully received. -
String getString(String key)
orString getString(String key, String key2)
GetString
data by accessing the JSONkey
fromjsonGetString
. -
int getInt(String key)
orint getInt(String key, String key2)
Getint
data by accessing the JSONkey
fromjsonGetString
. -
float getFloat(String key)
orfloat getFloat(String key, String key2)
Getfloat
data by accessing the JSONkey
fromjsonGetString
. -
double getDouble(String key)
ordouble getDouble(String key, String key2)
Getdouble
data by accessing the JSONkey
fromjsonGetString
.
-
void add(String key, value)
orvoid add(String key, String key2, value)
Insert a JSON key-value data to the propertyjsonString
of classAntaresESP8266HTTP
. Thevalue
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 injsonString
property of classAntaresESP8266HTTP
through HTTP port 8080 (non-secure). -
void send(String projectName, String deviceName)
(Recommended) Send the data stored injsonString
property of classAntaresESP8266HTTP
through HTTPS port 8443 (secure).
String createDevice(String projectName, String deviceName)
(Non-secure) Create a device in your Antares project.
String retrieveAllData(String projectName, String deviceName, int limit=0)
(Non-secure) Get all data ID in your Antares project. Specify thelimit
parameter if you want to limit the amount of data ID.
String retrieveAllDevice(String projectName, int limit=0)
(Non-secure) Get all device ID in your Antares project. Specify thelimit
parameter if you want to limit the amount of device ID.
Powered by Telkom Indonesia