MQTT CONFIG_BROKER_URL_FROM_STDIN

carlos789
Posts: 4
Joined: Sat Aug 30, 2025 6:11 pm

MQTT CONFIG_BROKER_URL_FROM_STDIN

Postby carlos789 » Sun Sep 14, 2025 11:54 pm

Hi, I am using the MQTT with ESP-IDF example.
I have the following question, where is the CONFIG_BROKER_URL_FROM_STDIN compilation option configured?
It is in the file mqtt.c

#if CONFIG_BROKER_URL_FROM_STDIN
char line[128];
if (strcmp(mqtt5_cfg.uri, "FROM_STDIN") == 0) {
int count = 0;
printf("Please enter url of mqtt broker\n");
while (count < 128) {
int c = fgetc(stdin);
if (c == '\n') {
line[count] = '\0';
break;
} else if (c > 0 && c < 127) {
line[count] = c;
++count;
}
vTaskDelay(10 / portTICK_PERIOD_MS);
}
mqtt5_cfg.broker.address.uri = line;
printf("Broker url: %s\n", line);
} else {
ESP_LOGE(TAG, "Configuration mismatch: wrong broker url");
abort();
}
#endif /* CONFIG_BROKER_URL_FROM_STDIN */

Thank you

Sprite
Espressif staff
Espressif staff
Posts: 10612
Joined: Thu Nov 26, 2015 4:08 am

Re: MQTT CONFIG_BROKER_URL_FROM_STDIN

Postby Sprite » Mon Sep 15, 2025 12:56 am

Defines starting with CONFIG_ are usually from menuconfig (or whatever your IDE calls it).

carlos789
Posts: 4
Joined: Sat Aug 30, 2025 6:11 pm

Re: MQTT CONFIG_BROKER_URL_FROM_STDIN

Postby carlos789 » Fri Sep 19, 2025 8:29 pm

Hi Sprite
Thank you very much for your answer. I didn't find the option to do this in menuconfig.
I directly used a define in mqtt.h
#define CONFIG_BROKER_URL_FROM_STDIN FALSE
Best regards,
Carlos

Who is online

Users browsing this forum: Applebot, ChatGPT-User, Qwantbot and 3 guests