EFWob / ESPPubSubClientWrapper

MIT License
3 stars 0 forks source link

ClientID #3

Open Roemke opened 1 year ago

Roemke commented 1 year ago

Hello, thanks for your work. I have two topics.

The ClientID ist generated allways as Random-Value. I need a fixed value and solved as follows: In the Header-File: ESPPubSubClientWrapper(uint8_t *ipaddr, const char * clientID, uint16_t port = 1883); and in cpp: ESPPubSubClientWrapper::ESPPubSubClientWrapper(uint8_t* ipaddr, const char * clientID, uint16_t port) :PubSubClient(ipaddr, port, _wiFiClient) { _clientID = (char *) clientID; }; This works in my case, I connect only without authentification.

Furthermore I found a method doSetConnect(). In this method there is used the member _connect_id. It seems to me, that this member is never used again.

Greetings Karsten

EFWob commented 1 year ago

Hi Karsten,

thank you for finding the bug. I would like to keep the API as is and therefore apply the following fix:

I have done the fix and put it under the branch "ConnectFix". I still need to update Readme and examples later (before merging into main), but may be you can give it a try already. Works for me...

Best

Erik