This program is able to automatically publish its measurements to a MQTT broker/server.
This is done on a fixed interval.
This project does not currently support encrypted MQTT, but it does support MQTT authentication.
These setup instructions require an already setup MQTT broker/server(for example mosquitto).
- Make sure
ENABLE_MQTT_PUBLISH
is set to 1 in config.h. - Write your MQTT username to mqttuser.txt and your MQTT password to mqttpass.txt.
- Set
MQTT_BROKER_ADDR
in config.h to the address of your MQTT broker/server.
Also setMQTT_BROKER_PORT
to the port your MQTT broker/server if you are using a non standard port.(The default port is 1883) - Set
MQTT_PUBLISH_ANONYMOUS
in config.h to 1 if you wish to disable MQTT authentication. - Set
MQTT_TOPIC_NAMESPACE
in config.h if you wish to use something other then your ESP hostname as the first part of the MQTT topic. - If you want to change how often the measurements are published change
MQTT_PUBLISH_INTERVAL
in config.h.(default interval is 15 seconds) - Build this project and flash it to your ESP.