JXCT Soil Sensor 7-in-1 v3.4.9 (June 2025)
Professional IoT soil monitoring system with ESP32, Modbus RTU, MQTT, and advanced compensation algorithms
|
#include <Arduino.h>
#include <PubSubClient.h>
#include <ArduinoJson.h>
Функции | |
const char * | getMqttLastError () |
void | setupMQTT () |
bool | connectMQTT () |
void | handleMQTT () |
void | publishSensorData () |
void | publishHomeAssistantConfig () |
void | publishAvailability (bool online) |
void | removeHomeAssistantConfig () |
void | invalidateHAConfigCache () |
void | handleMqttCommand (const String &cmd) |
void | mqttCallback (char *topic, byte *payload, unsigned int length) |
Переменные | |
WiFiClient | espClient |
PubSubClient | mqttClient |
bool | mqttConnected |
bool connectMQTT | ( | ) |
См. определение в файле mqtt_client.cpp строка 191
Перекрестные ссылки config, DEBUG_PRINTF, DEBUG_PRINTLN, ERROR_PRINTLN, getCommandTopic(), getMqttClientName(), getOtaCommandTopic(), getStatusTopic(), INFO_PRINTLN, mqttClient, mqttLastErrorBuffer, publishAvailability() и publishHomeAssistantConfig().
Используется в handleMQTT().
const char * getMqttLastError | ( | ) |
См. определение в файле mqtt_client.cpp строка 28
Перекрестные ссылки mqttLastErrorBuffer.
Используется в sendHealthJson() и sendServiceStatusJson().
void handleMQTT | ( | ) |
См. определение в файле mqtt_client.cpp строка 311
void handleMqttCommand | ( | const String & | cmd | ) |
См. определение в файле mqtt_client.cpp строка 674
Перекрестные ссылки config, DEBUG_PRINT, DEBUG_PRINTLN, handleOTA(), publishAvailability(), publishHomeAssistantConfig(), publishSensorData(), removeHomeAssistantConfig(), resetConfig(), saveConfig() и triggerOtaCheck().
Используется в mqttCallback().
void invalidateHAConfigCache | ( | ) |
См. определение в файле mqtt_client.cpp строка 734
Перекрестные ссылки haConfigCache, INFO_PRINTLN и mqttLastErrorBuffer.
Используется в saveConfig().
void mqttCallback | ( | char * | topic, |
byte * | payload, | ||
unsigned int | length ) |
См. определение в файле mqtt_client.cpp строка 722
Перекрестные ссылки DEBUG_PRINTF, getCommandTopic(), getOtaCommandTopic() и handleMqttCommand().
Используется в setupMQTT().
void publishAvailability | ( | bool | online | ) |
См. определение в файле mqtt_client.cpp строка 141
Перекрестные ссылки DEBUG_PRINTF, getStatusTopic() и mqttClient.
Используется в connectMQTT() и handleMqttCommand().
void publishHomeAssistantConfig | ( | ) |
См. определение в файле mqtt_client.cpp строка 521
Перекрестные ссылки config, DEBUG_PRINTLN, DEVICE_MANUFACTURER, DEVICE_MODEL, DEVICE_SW_VERSION, getDeviceId(), haConfigCache, INFO_PRINTLN, mqttClient, mqttLastErrorBuffer, pubTopicCache и pubTopicCacheValid.
Используется в connectMQTT() и handleMqttCommand().
void publishSensorData | ( | ) |
См. определение в файле mqtt_client.cpp строка 440
Перекрестные ссылки cachedSensorJson, config, DEBUG_PRINTLN, lastCachedSensorTime, mqttClient, mqttLastErrorBuffer, sensorData, sensorJsonCacheValid, shouldPublishMqtt() и timeClient.
Используется в handleMqttCommand() и loop().
void removeHomeAssistantConfig | ( | ) |
См. определение в файле mqtt_client.cpp строка 658
Перекрестные ссылки getDeviceId(), INFO_PRINTLN, mqttClient и mqttLastErrorBuffer.
Используется в handleMqttCommand().
void setupMQTT | ( | ) |
См. определение в файле mqtt_client.cpp строка 149
Перекрестные ссылки config, DEBUG_PRINTF, DEBUG_PRINTLN, ERROR_PRINTF, ERROR_PRINTLN, getCachedIP(), INFO_PRINTLN, mqttCallback(), mqttClient и mqttLastErrorBuffer.
Используется в setup().
|
extern |
См. определение в файле mqtt_client.cpp строка 22
|
extern |
|
extern |
См. определение в файле mqtt_client.cpp строка 24