Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
Bug in subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
nidayand committed Mar 9, 2018
1 parent f663335 commit 2aae0f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 2 additions & 1 deletion NidayandHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ void NidayandHelper::mqtt_reconnect(PubSubClient& psclient, String uid, String p
this->mqtt_publish(psclient, "/raw/esp8266/register", "{ \"id\": \"" + String(ESP.getChipId()) + "\", \"ip\":\"" + WiFi.localIP().toString() +"\"}");

//Setup subscription
if (topics.empty()){
if (!topics.empty()){
for (const char* t : topics){
psclient.subscribe(t);
Serial.println("Subscribed to "+String(t));
}
}

Expand Down
10 changes: 0 additions & 10 deletions motor_on_a_roller_blind-ws.ino
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,7 @@ void sendmsg(String topic, String payload) {

helper.mqtt_publish(psclient, topic, payload);
}
/*
Connect the MQTT client to the
MQTT server
*/
void reconnect() {
if (!mqttActive)
return;

helper.mqtt_reconnect(psclient, mqtt_uid, mqtt_pwd, { inputTopic.c_str() });

}

/****************************************************************************************
*/
Expand Down

0 comments on commit 2aae0f4

Please sign in to comment.