Mattzobricks / MattzoControllers

MattzoController firmware
20 stars 10 forks source link

Credentials for MQTT #64

Closed Mattzobricks closed 4 months ago

Mattzobricks commented 10 months ago

Some users have demanded optional credentials for MQTT. Example: https://mattzobricks.com/forums/topic/mqtt-credentials-in-network_config#post-6559

Hilbert70 commented 10 months ago

Just change the occurrence of:

boolean connect(const char* id, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage);

To:

boolean connect(const char* id, const char* user, const char* pass, const char* willTopic, uint8_t willQos, boolean willRetain, const char* willMessage);

MTC4BT: change MCNetwork/MattzoMQTTSubscriber.cpp:

 log4MC::info("MQTT: Subscriber attempting to connect...")
 if (mqttSubscriberClient.connect(_subscriberName, _config->Topic, 0, false, lastWillMessage_char)) {
            log4MC::info("MQTT: Subscriber connected");

Add username and password to the configuration and handle it.

Mattzobricks commented 4 months ago

Thought about this feature request again... I believe the number of users who would like to have this feature is small. Very small. It might be easy to implement, but it complicates the setup for beginners even more and potentially leads to errors.

Closing issue.