mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-30 22:11:06 +00:00
.
This commit is contained in:
@@ -49,9 +49,16 @@ persistence_location /srv/dev-disk-by-label/docker/columes/mosquitto/data/
|
|||||||
|
|
||||||
## ESP32 MQTT Client
|
## ESP32 MQTT Client
|
||||||
|
|
||||||
<p>The two lines of code shown below are most crucial as they are responsible for connecting ESP32 to the MQTT broker.</p>
|
<p>The two lines of code shown below are the most crucial as they are responsible for connecting ESP32 to the MQTT broker.</p>
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> A set of SSL certificates and key used by ESP32 MQTT client must correspond to ones used by MQTT brocker. Otherwise, secure connection won't be established.
|
||||||
|
|
||||||
```C
|
```C
|
||||||
espClientSSL.setCACert(NODE_CERT_CA);
|
espClientSSL.setCACert(NODE_CERT_CA);
|
||||||
connection.setServer(mqtt_server, 8883);
|
connection.setServer(mqtt_server, 8883);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<p><i>secrets.h</i></p>
|
||||||
|
> [!NOTE]
|
||||||
|
> Create file called secrets.h to store configuration information about Wi-Fi, and encryption keys, but exclude it from being pushed to GitHub
|
Reference in New Issue
Block a user