From 35a6d5a06373682d6eac4789cba56b7b5df721df Mon Sep 17 00:00:00 2001 From: Slider0007 <115730895+Slider0007@users.noreply.github.com> Date: Thu, 22 Dec 2022 08:10:20 +0100 Subject: [PATCH] Init GPIO handler before MQTT init (#1663) --- code/components/jomjol_tfliteclass/server_tflite.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/components/jomjol_tfliteclass/server_tflite.cpp b/code/components/jomjol_tfliteclass/server_tflite.cpp index 08f67f4d..bc5e9766 100644 --- a/code/components/jomjol_tfliteclass/server_tflite.cpp +++ b/code/components/jomjol_tfliteclass/server_tflite.cpp @@ -90,6 +90,9 @@ void doInit(void) ESP_LOGD(TAG, "Finished tfliteflow.InitFlow(config);"); #endif + /* GPIO handler has to be initialized before MQTT init to ensure proper topic subscription */ + gpio_handler_init(); + #ifdef ENABLE_MQTT tfliteflow.StartMQTTService(); #endif //ENABLE_MQTT @@ -780,7 +783,6 @@ void task_autodoFlow(void *pvParameter) ESP_LOGD(TAG, "task_autodoFlow: start"); doInit(); - gpio_handler_init(); auto_isrunning = tfliteflow.isAutoStart(auto_intervall); if (isSetupModusActive()) {