You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/mosquitto/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
# ESP32 Mosquitto Port
2
2
3
-
This is a lightweight port of the Mosquitto broker designed to run on the ESP32. It currently supports a single listener and TCP transport only.
3
+
This is a lightweight port of the Mosquitto broker designed to run on the ESP32. It currently supports a single listener with TCP transport or TLS transport based on ESP-TLS library.
4
4
5
5
## Supported Options
6
6
7
-
The Espressif port supports a limited set of options (with plans to add more in future releases). These options can be configured through a structure passed to the `mosq_broker_start()` function. For detailed information on available configuration options, refer to the [API documentation](api.md).
7
+
The Espressif port supports a limited set of options (with plans to add more in future releases). These options can be configured through a structure passed to the `mosq_broker_run()` function. For detailed information on available configuration options, refer to the [API documentation](api.md).
8
8
9
9
## API
10
10
11
11
### Starting the Broker
12
12
13
-
To start the broker, call the `mosq_broker_start()` function with a properly configured settings structure. The broker operates in the context of the calling task and does not create a separate task.
13
+
To start the broker, call the `mosq_broker_run()` function with a properly configured settings structure. The broker operates in the context of the calling task and does not create a separate task.
14
14
15
15
It's recommended to analyze the stack size needed for the task, but in general, the broker requires at least 4 kB of stack size.
- int port <br>Port number of the broker to listen to
39
40
41
+
- esp\_tls\_cfg\_server\_t \* tls_cfg <br>ESP-TLS configuration (if TLS transport used) Please refer to the ESP-TLS official documentation for more details on configuring the TLS options. You can open the respective docs with this idf.py command: `idf.py docs -sp api-reference/protocols/esp_tls.html`
42
+
40
43
41
44
## Functions Documentation
42
45
43
-
### function `mosq_broker_start`
46
+
### function `mosq_broker_run`
44
47
45
48
_Start mosquitto broker._
46
49
```c
47
-
intmosq_broker_start (
50
+
intmosq_broker_run (
48
51
struct mosq_broker_config *config
49
52
)
50
53
```
@@ -63,3 +66,16 @@ This API runs the broker in the calling thread and blocks until the mosquitto ex
63
66
**Returns:**
64
67
65
68
int Exit code (0 on success)
69
+
### function `mosq_broker_stop`
70
+
71
+
_Stops running broker._
72
+
```c
73
+
voidmosq_broker_stop (
74
+
void
75
+
)
76
+
```
77
+
78
+
79
+
**Note:**
80
+
81
+
After calling this API, function mosq\_broker\_run() unblocks and returns.
Copy file name to clipboardExpand all lines: components/mosquitto/examples/broker/README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Overview
4
4
5
-
This example runs a TCP broker on a specified host and port.
5
+
This example runs a broker on TLS or TCP transport, specified host and port.
6
6
7
7
### How to use this example
8
8
@@ -13,6 +13,19 @@ If you enabled also the mqtt client, this example will connect to the local brok
13
13
14
14
You can connect to the ESP32 mosquitto broker using some other client using the ESP32 IPv4 address and the port specified in the project configuration menu.
15
15
16
+
> [!IMPORTANT]
17
+
> The certificates and keys provided in this example are intended for testing purposes only. They are self-signed, single-use, and configured with a common name of "127.0.0.1". Do not reuse these credentials in any production or real-world applications, as they are not secure for such environments.
18
+
19
+
For more information on setting up TLS configuration (including certificates and keys), please refer to the ESP-TLS documentation:
Configuring the TLS option for the broker is quite similar to setting it up for an HTTPS server, as both involve server-side security configuration. Refer to the HTTPS server documentation for details:
This example is also used for testing on loopback interface only, disabling any actual connection, just using the local mqtt client to the loopback interface.
0 commit comments