hsaturn / TinyMqtt

ESP 8266 / 32 / WROOM Small footprint Mqtt Broker and Client
GNU General Public License v3.0
183 stars 40 forks source link

std::string #63

Closed hsaturn closed 1 year ago

hsaturn commented 1 year ago

I'm opening an issue about Bazmundi comment on https://github.com/hsaturn/TinyMqtt/issues/47 and will take care about this this evening.

(copy of Bazmundi comment:)

I would LUV an example of how to set the client ID on the remote client.

On the remote client I am using:

const char* BROKER = "192.168.4.1";
const uint16_t BROKER_PORT = 1883;

static MqttClient pump_client;

...

pump_client.connect(BROKER, BROKER_PORT,60);

What's the trick please? The std::string & is driving me batty :bat:

hsaturn commented 1 year ago

Ok, thanks for the report Bazmundi. The thing is that there is no constructor with an IP address. Nor with a name in order to precisely avoid this kind of confusion.

Use MqttClient::connect("...") instead.