From 82c449ba29523d7d60735f07196e46744401ec02 Mon Sep 17 00:00:00 2001 From: Jonas Arnold Date: Thu, 22 Dec 2022 12:43:38 +0100 Subject: [PATCH] removed unnecessary mqtt topic, added help for mqtt publish --- ADIS_ESP32_Eclipse/main/challenge_app.c | 5 ----- ADIS_ESP32_Eclipse/main/myMqtt.c | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ADIS_ESP32_Eclipse/main/challenge_app.c b/ADIS_ESP32_Eclipse/main/challenge_app.c index a0455bb..860aa03 100644 --- a/ADIS_ESP32_Eclipse/main/challenge_app.c +++ b/ADIS_ESP32_Eclipse/main/challenge_app.c @@ -54,17 +54,12 @@ static void appTask(void *pv){ Challenge_Com_SubscribeToAllTopics(); - MyMqtt_Subscribe("scada/status"); - // endless loop for(;;){ - //MyMqtt_Publish("scada/status", "Testmessage from ESP"); - vTaskDelay(pdMS_TO_TICKS(10000)); } } - ESP_LOGE(TAG, "Challenge Mainloop failure: %s", myMqttInitSuccess==true?"Something in challenge app failed. Re-initializing MQTT in 5s.":"Init of MyMqtt failed! Retrying in 5s."); MyMqtt_Deinit(); if(myMqttInitSuccess == false) { vTaskDelay(5000); } // only wait if the init is the issue diff --git a/ADIS_ESP32_Eclipse/main/myMqtt.c b/ADIS_ESP32_Eclipse/main/myMqtt.c index 2fcfeae..840ddf9 100644 --- a/ADIS_ESP32_Eclipse/main/myMqtt.c +++ b/ADIS_ESP32_Eclipse/main/myMqtt.c @@ -159,6 +159,7 @@ static uint8_t PrintHelp(const McuShell_StdIOType *io) { McuShell_SendHelpStr((unsigned char*)"mqtt", (unsigned char*)"Group of ESP32 MQTT commands\r\n", io->stdOut); McuShell_SendHelpStr((unsigned char*)" help|status", (unsigned char*)"Shows MQTT help or status\r\n", io->stdOut); McuShell_SendHelpStr((unsigned char*)" setIp ", (unsigned char*)"Sets the IP address of the MQTT broker\r\n", io->stdOut); + McuShell_SendHelpStr((unsigned char*)" publish ", (unsigned char*)"Publishes a message to the given topic.\r\n", io->stdOut); return ERR_OK; }