# MQTT

## Configure message broker that will be used to send and receive messages over the network.

Broker
Enabled
Address
Port
User
Leave blank when broker allows anonymous connections. You can also use the following placeholders: {hostname}, {mac}
Password
Client ID When left blank, the firmware will generate a Client ID based on the MAC address of the chip. The following placeholders are also supported: {hostname}, {mac}
Keep Alive (seconds)
Use secure connection (SSL)
SSL Fingerprint This is the fingerprint for the SSL certificate of the server.
You can get it using https://www.grc.com/fingerprints.htm (if it is publically available)
or, using openssl. For example, on a Linux / macOS machine:
`$ echo -n | openssl s_client -connect <host>:<port> 2>∧1 | openssl x509 -noout -fingerprint -sha1 | cut -d\= -f2`
Device settings
Root Topic This is the root topic for this device. The following placeholders can be used: {hostname} and {mac} to dynamically set the value to the device hostname and MAC address respectively. Subscribe to `<root>/#` to see all published topics.
Default QoS
Level of assurance for delivery of the outgoing messages. Notice that messages are not (currently) cached on the device, QoS levels >0 only guarantee delivery after the broker receives the message.
Default retain flag Store the last published message (including the device status) on the server, so it can be delivered to any future subscribers that match the message topic.
Status & Will
Topic Status payload will be sent to this topic. When empty, defaults to <root>/<status>
Retain flag
QoS
Online payload
Offline payload
JSON
Enabled Causes all single <topic> messages published by the device, except the device status, to be sent in a JSON payload. For example:
`{"relay/0": 1, "hostname": "ESPURNA-123456", "timestamp": "..."}`
All messages will be queued and sent with a delay (100ms by default). Notice that all nested <topic>: <message> are published as-is, only the heartbeat payload will include all of topics at once.
Topic JSON message will be sent to this topic. When empty, defaults to <root>/<data>