31 lines
472 B
C++
31 lines
472 B
C++
#
|
|
|
|
#include <WiFi.h>
|
|
#include <AsyncMqttClient.h>
|
|
#include <ArduinoJson.h>
|
|
|
|
#include "config.h" // Sustituir con datos de vuestra red
|
|
#include "JSON_functions.hpp"
|
|
#include "MQTT.hpp"
|
|
#include "ESP32_Utils.hpp"
|
|
#include "ESP32_Utils_MQTT_Async.hpp"
|
|
|
|
|
|
void setup()
|
|
{
|
|
Serial.begin(115200);
|
|
|
|
delay(500);
|
|
|
|
WiFi.onEvent(WiFiEvent);
|
|
InitMqtt();
|
|
|
|
ConnectWiFi_STA();
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
// EXAMPLE PUBLISH. CHANGE THIS, IF NEEDED.
|
|
//delay(1000);
|
|
//PublishMqtt(millis());
|
|
} |