connected to mqtt server. modified config

This commit is contained in:
jptrsn 2018-10-12 22:39:31 -04:00
parent c1ec26b9de
commit f0a15b632d
3 changed files with 4 additions and 3 deletions

View File

@ -315,6 +315,7 @@ void setup() {
mqttClient.onDisconnect(onMqttDisconnect); mqttClient.onDisconnect(onMqttDisconnect);
mqttClient.onPublish(onMqttPublish); mqttClient.onPublish(onMqttPublish);
mqttClient.setServer(mqttHost, mqttPort);
connectToWifi(); connectToWifi();

View File

@ -7,8 +7,8 @@
//Replace with a human-friendly host name. //Replace with a human-friendly host name.
#define hostname "esp32_room_presence" #define hostname "esp32_room_presence"
//Replace with your MQTT Broker address; example: #define mqttServer "192.168.0.112" //Replace with your MQTT Broker address; example: #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttServer "$MQTT_BROKER_ADDRESS$" #define mqttHost IPAddress(192, 168, 1, 195)
//Replace with your MQTT Broker port; example: #define mqttPort 1883 //Replace with your MQTT Broker port; example: #define mqttPort 1883
#define mqttPort $MQTT_PORT$ #define mqttPort $MQTT_PORT$

View File

@ -1,7 +1,7 @@
#define ssid "Travis" #define ssid "Travis"
#define password "123456789" #define password "123456789"
#define hostname "esp32_room_presence" #define hostname "esp32_room_presence"
#define mqttServer "192.168.1.1" #define mqttHost IPAddress(192, 168, 1, 195)
#define mqttPort 1883 #define mqttPort 1883
#define mqttUser "homeassistant" #define mqttUser "homeassistant"
#define mqttPassword "123456789" #define mqttPassword "123456789"