#include <AntaresESPHTTP.h>
#define ACCESSKEY "YOUR-ACCESS-KEY" // Replace with your Antares account access key
#define WIFISSID "Wokwi-GUEST" // Replace with your Wi-Fi SSID
#define PASSWORD "" // Replace with your Wi-Fi password
#define projectName "TestHTTP" // Replace with the Antares application name that was created
#define deviceName "" // Replace with the Antares device name that was created
AntaresESPHTTP antares(ACCESSKEY);
void setup() {
Serial.begin(115200);
antares.setDebug(true);
antares.wifiConnection(WIFISSID, PASSWORD);
}
void loop() {
// Variables
int temp = random(25,30) ;
int hum = random(75,90);
float windsp = float(random(20, 30))/3.33;
float rainlv = float(random(0, 20))/6.99;
String lat = "-6.8718189";
String lon = "107.5872477";
// Add variable data to storage buffer
antares.add("temperature", temp);
antares.add("humidity", hum);
antares.add("wind_speed", windsp);
antares.add("rain_level", rainlv);
antares.add("location", "latitude", lat);
antares.add("location", "longitude", lon);
// Send from buffer to Antares
antares.send(projectName, deviceName);
delay(10000);
}