mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-10-19 07:29:07 +00:00
mqtt
This commit is contained in:
@@ -13,7 +13,9 @@
|
||||
#include "mqtt_client.h"
|
||||
#include "mqttronix.h"
|
||||
|
||||
//static const char* MQTT_TAG = "MQTTronix";
|
||||
static float temp_value = 0.0f;
|
||||
static float battery_voltage = 0.0f;
|
||||
static float sys_current = 0.0f;
|
||||
|
||||
static void mqtt_publish_task(void *arg) {
|
||||
esp_mqtt_client_handle_t client = (esp_mqtt_client_handle_t)arg;
|
||||
@@ -75,4 +77,6 @@ void mqttronix_start(void) {
|
||||
esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg);
|
||||
esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, NULL);
|
||||
esp_mqtt_client_start(client);
|
||||
}
|
||||
}
|
||||
|
||||
void mqttronix_update_temp (float temp) { temp_value = temp; }
|
@@ -10,7 +10,8 @@ static const char* MQTT_TAG = "MQTTronix";
|
||||
static const char* MQTT_BROKER_URI;
|
||||
//static const char* MQTT_TAG;
|
||||
static esp_mqtt_client_handle_t mqtt_client = NULL;
|
||||
//static esp_mqtt_client_handle_t mqtt_client = NULL;
|
||||
|
||||
void mqttronix_update_temp (float temp);
|
||||
|
||||
/*static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data);
|
||||
static void mqtt_publish_task(void *arg);
|
||||
|
Reference in New Issue
Block a user