removed unnecessary mqtt topic,

added help for mqtt publish
main
Jonas Arnold 4 years ago
parent 77b3fd7ae6
commit 82c449ba29
  1. 5
      ADIS_ESP32_Eclipse/main/challenge_app.c
  2. 1
      ADIS_ESP32_Eclipse/main/myMqtt.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

@ -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 <ipv4>", (unsigned char*)"Sets the IP address of the MQTT broker\r\n", io->stdOut);
McuShell_SendHelpStr((unsigned char*)" publish <topic> <msg>", (unsigned char*)"Publishes a message to the given topic.\r\n", io->stdOut);
return ERR_OK;
}

Loading…
Cancel
Save