Commit 53aed121 authored by Rostislav Spinar's avatar Rostislav Spinar

MQTT broker configuration

parent f33e8896
......@@ -11,7 +11,7 @@
## IoT Starter Kit - Part 2: IQRF Gateway
### Option 1 - Step by Step Installation
### Step by Step Installation
* [IQRF Gateway UP board](https://github.com/iqrfsdk/iot-starter-kit/tree/master/install/up-board/GW-SbS-INSTALL.md)
* [IQRF Gateway RPI board](https://github.com/iqrfsdk/iot-starter-kit/tree/master/install/rpi-board/GW-SbS-INSTALL.md)
......
user ubilinux
topic write Iqrf/DpaRequest
topic write Iqrf/DpaResponse
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
# Adding support for websockets
listener 1883
listener 9001
protocol websockets
# Adding support for authorization
password_file /etc/mosquitto/passwd
acl_file /etc/mosquitto/acls
allow_anonymous false
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
......@@ -75,6 +75,46 @@ Dec 12 23:37:19 raspberrypi mosquitto[15260]: Starting network daemon:: mosquitt
Dec 12 23:37:19 raspberrypi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.
```
### Step 4C (optional) - Static password and ACL file
These steps describe how to setup Mosquitto with a static password and ACL file.
Using the mosquitto_passwd command, it is possible to create a password file for authentication.
#### Create password for <user_name> ubilinux
Example to create a password file and add add an username (use the -c only the first time as it will create a new file):
```bash
sudo mosquitto_passwd -c /etc/mosquitto/passwd <user_name>
```
#### Create ACL file
* Add [ACL file](https://github.com/iqrfsdk/iot-starter-kit/blob/master/install/mosquitto/acls)
#### Modify mosquitto configuration
* Include lines to enable authorization in [configuration file](https://github.com/iqrfsdk/iot-starter-kit/blob/master/install/mosquitto/mosquitto.conf)
* Restart MQTT broker
```bash
sudo systemctl restart mosquitto.service
```
### Step 4D (optional) - Enable websockets
#### Modify mosquitto configuration
* Include lines to enable websocket in [configuration file](https://github.com/iqrfsdk/iot-starter-kit/blob/master/install/mosquitto/mosquitto.conf)
* Restart MQTT broker
```bash
sudo systemctl restart mosquitto.service
```
## Step 5A - Install IQRF Gateway Daemon
```bash
......
......@@ -40,6 +40,46 @@ ubilinux@ubilinux:~$ systemctl status mosquitto.service
ââ14253 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
```
### Step 4C (optional) - Static password and ACL file
These steps describe how to setup Mosquitto with a static password and ACL file.
Using the mosquitto_passwd command, it is possible to create a password file for authentication.
#### Create password for <user_name> ubilinux
Example to create a password file and add add an username (use the -c only the first time as it will create a new file):
```bash
sudo mosquitto_passwd -c /etc/mosquitto/passwd <user_name>
```
#### Create ACL file
* Add [ACL file](https://github.com/iqrfsdk/iot-starter-kit/blob/master/install/mosquitto/acls)
#### Modify mosquitto configuration
* Include lines to enable authorization in [configuration file](https://github.com/iqrfsdk/iot-starter-kit/blob/master/install/mosquitto/mosquitto.conf)
* Restart MQTT broker
```bash
sudo systemctl restart mosquitto.service
```
### Step 4D (optional) - Enable websockets
#### Modify mosquitto configuration
* Include lines to enable websocket in [configuration file](https://github.com/iqrfsdk/iot-starter-kit/blob/master/install/mosquitto/mosquitto.conf)
* Restart MQTT broker
```bash
sudo systemctl restart mosquitto.service
```
## Step 5A - Install IQRF Gateway Daemon
```bash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment