mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 00:16:42 +02:00
add mClient->setServer as suggested in #120
This commit is contained in:
parent
f657ace328
commit
966a25bcd0
1 changed files with 4 additions and 0 deletions
|
@ -106,6 +106,10 @@ class mqtt {
|
|||
DPRINTLN(DBG_DEBUG, F("WIFI mEspClient.status ") + String(mEspClient.status()) );
|
||||
if(!mClient->connected()) {
|
||||
if(strlen(mDevName) > 0) {
|
||||
// der Server und der Port müssen neu gesetzt werden,
|
||||
// da ein MQTT_CONNECTION_LOST -3 die Werte zerstört hat.
|
||||
mClient->setServer(mBroker, mPort);
|
||||
mClient->setBufferSize(MQTT_MAX_PACKET_SIZE);
|
||||
if((strlen(mUser) > 0) && (strlen(mPwd) > 0))
|
||||
mClient->connect(mDevName, mUser, mPwd);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue