Skip to content

Commit

Permalink
fix: correct variable MQTT publish function call
Browse files Browse the repository at this point in the history
The project documentation contained a typo in the line where the `mqtt_client.publish()` function is called. The variable `mqtt_topic` was incorrectly written as `topic`. This fix adjusts the `mqtt_client.publish()` call to use the correct variable, ensuring the accuracy of the documentation and the proper functionality of the code.
  • Loading branch information
imrob-s authored and zibuyu1995 committed Feb 28, 2024
1 parent ccf475e commit 0d20309
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mqtt-client-ESP8266/esp8266_connect_mqtt_via_tls.ino
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void connectToMQTT() {
Serial.println("Connected to MQTT broker");
mqtt_client.subscribe(mqtt_topic);
// Publish message upon successful connection
mqtt_client.publish(topic, "Hi EMQX I'm ESP8266 ^^");
mqtt_client.publish(mqtt_topic, "Hi EMQX I'm ESP8266 ^^");
} else {
char err_buf[128];
espClient.getLastSSLError(err_buf, sizeof(err_buf));
Expand Down

0 comments on commit 0d20309

Please sign in to comment.