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: docs/Containers/Mosquitto.md
+34-34Lines changed: 34 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ When you select Mosquitto in the IOTstack menu, the *template service definition
77
77
78
78
On a first install of IOTstack, you run the menu, choose Mosquitto as one of your containers, and are told to do this:
79
79
80
-
```bash
80
+
```console
81
81
$ cd~/IOTstack
82
82
$ docker-compose up -d
83
83
```
@@ -145,7 +145,7 @@ The *local image* is instantiated to become your running container.
145
145
146
146
When you run the `docker images` command after Mosquitto has been built, you *may* see two rows for Mosquitto:
147
147
148
-
```bash
148
+
```console
149
149
$ docker images
150
150
REPOSITORY TAG IMAGE ID CREATED SIZE
151
151
iotstack_mosquitto latest cf0bfe1a34d6 4 weeks ago 11.6MB
@@ -181,7 +181,7 @@ The default versions of each configuration file are the **same**. Only the **loc
181
181
182
182
However, if you did alter either or both configuration files, then you should compare the old and new versions and decide whether you wish to retain your old settings. For example:
@@ -201,19 +201,19 @@ Using `mosquitto.conf` as the example, assume you wish to use your existing file
201
201
202
202
2. Mosquitto will always enforce correct ownership (1883:1883) on any restart but it will not overwrite permissions. If in doubt, use mode 644 as your default for permissions:
The path `/mosquitto/log/mosquitto.log` is an **internal** path. When this style of logging is active, you inspect Mosquitto's logs using the **external** path like this:
Replace «username» and «password» with appropriate values, then execute the command. For example, to create the username "hello" with password "world":
314
314
315
-
```bash
315
+
```console
316
316
$ docker exec mosquitto mosquitto_passwd -b /mosquitto/pwfile/pwfile hello world
317
317
```
318
318
@@ -326,15 +326,15 @@ There are two ways to verify that the password file exists and has the expected
@@ -421,7 +421,7 @@ There are several ways to reset the password file. Your options are:
421
421
422
422
4. Save the modified configuration file and restart Mosquitto:
423
423
424
-
```bash
424
+
```console
425
425
$ cd ~/IOTstack
426
426
$ docker-compose restart mosquitto
427
427
```
@@ -438,15 +438,15 @@ There are several ways to reset the password file. Your options are:
438
438
439
439
If you do not have the Mosquitto clients installed on your Raspberry Pi (ie `$ which mosquitto_pub` does not return a path), install them using:
440
440
441
-
```bash
441
+
```console
442
442
$ sudo apt install -y mosquitto-clients
443
443
```
444
444
445
445
#### test: *anonymous access is prohibited*
446
446
447
447
Test **without** providing credentials:
448
448
449
-
```bash
449
+
```console
450
450
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "/password/test" -m "up up and away"
451
451
Connection Refused: not authorised.
452
452
Error: The connection was refused.
@@ -460,7 +460,7 @@ Note:
460
460
461
461
Test with credentials
462
462
463
-
```bash
463
+
```console
464
464
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "/password/test" -m "up up and away" -u hello -P world
465
465
$
466
466
```
@@ -473,14 +473,14 @@ Note:
473
473
474
474
Prove round-trip connectivity will succeed when credentials are provided. First, set up a subscriber as a background process. This mimics the role of a process like Node-Red:
0 commit comments