forked from ClemensElflein/OpenMowerOS
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
614de6d
commit f4a2661
Showing
5 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/modules/openmower/filesystem/root/boot/openmower/mqtt/_configuration.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
##################################################### | ||
### example config to forward mqtt to another broker | ||
##################################################### | ||
### | ||
### copy this file to another one ending with .conf | ||
### | ||
### to enable/disable the service execute: | ||
### sudo systemctl enable --now openmower-mqtt-bridge | ||
### sudo systemctl disable --now openmower-mqtt-bridge | ||
### | ||
|
||
connection bridge-to-external-broker | ||
|
||
try_private true | ||
cleansession true | ||
topic # out 0 "" openmower/ | ||
topic openmower/# in 0 | ||
|
||
address 192.168.XXX.XXX | ||
|
||
#remote_username user | ||
#remote_password pass |
11 changes: 11 additions & 0 deletions
11
src/modules/openmower/filesystem/root/boot/openmower/mqtt/mqtt-bridge.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
connection bridge-to-external-broker | ||
|
||
try_private true | ||
cleansession true | ||
topic # out 0 "" openmower/ | ||
topic # in 0 "" openmower/ | ||
|
||
address 192.168.XXX.XXX | ||
|
||
#remote_username user | ||
#remote_password pass |
21 changes: 21 additions & 0 deletions
21
src/modules/openmower/filesystem/root/etc/mosquitto/mosquitto-openmower.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# A full description of the configuration file is at | ||
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example | ||
|
||
pid_file /run/mosquitto/openmower-mqtt-bridge.pid | ||
log_type notice | ||
|
||
#some random port | ||
listener 18838 | ||
|
||
|
||
#the bridge to the openmower container | ||
connection bridge-to-openmower | ||
|
||
try_private true | ||
cleansession true | ||
topic # out 0 | ||
topic # in 0 | ||
address localhost | ||
|
||
#include the config for the external bridge | ||
include_dir /boot/openmower/mqtt |
21 changes: 21 additions & 0 deletions
21
src/modules/openmower/filesystem/root/etc/systemd/system/openmower-mqtt-bridge.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[Unit] | ||
Description=OpenMower MQTT Bridge | ||
Documentation=man:mosquitto.conf(5) man:mosquitto(8) | ||
After=network.target openmower.service openmower-debug.service | ||
Wants=network.target | ||
StartLimitBurst=0 | ||
|
||
[Service] | ||
Type=notify | ||
NotifyAccess=main | ||
ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto-openmower.conf | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
Restart=on-failure | ||
RestartSec=10s | ||
ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto | ||
ExecStartPre=/bin/chown mosquitto /var/log/mosquitto | ||
ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto | ||
ExecStartPre=/bin/chown mosquitto /run/mosquitto | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters