浏览代码

Init GPIO handler before MQTT init (#1663)

Slider0007 3 年之前
父节点
当前提交
35a6d5a063
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      code/components/jomjol_tfliteclass/server_tflite.cpp

+ 3 - 1
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()) {