Skip to content

Commit

Permalink
mosquitto.conf: Set autosave_interval to 1 day
Browse files Browse the repository at this point in the history
Closes #37
  • Loading branch information
christianTF committed Jan 7, 2020
1 parent f9a4275 commit 948eca4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion bin/sudo/mosq_readconfig.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

ln -f -s /var/log/mosquitto/mosquitto.log REPLACELBPLOGDIR/
pgrep mosquitto
if [ $? -ne 0 ]; then
echo "Restarting Mosquitto"
Expand Down
1 change: 1 addition & 0 deletions bin/sudo/mosq_restart.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
ln -f -s /var/log/mosquitto/mosquitto.log REPLACELBPLOGDIR/
systemctl restart mosquitto
15 changes: 14 additions & 1 deletion config/mqtt.json.example
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{"Main":{"brokeraddress":"localhost","msno":"1","udpport":"11883","convert_booleans":true,"use_udp":true,"use_http":false,"udpinport":"11883"},"subscriptions":["shellies/#"]}
{
"Main": {
"brokeraddress": "localhost",
"msno": "1",
"udpport": "11883",
"convert_booleans": true,
"use_udp": true,
"use_http": false,
"udpinport": "11883"
},
"subscriptions": [
"shellies/#"
]
}
24 changes: 0 additions & 24 deletions postupgrade.sh

This file was deleted.

8 changes: 7 additions & 1 deletion webfrontend/htmlauth/ajax_brokercred.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ sub setcred
$mosq_config = "# This file is directly managed by the MQTT-Gateway plugin.\n";
$mosq_config .= "# Do not change this file, as your changes will be lost on saving in the MQTT-Gateway webinterface.\n\n";

$mosq_config .= "port 1883\n";
$mosq_config .= "port 1883\n\n";
$mosq_config .= "# To reduce SD writes, save Mosquitto DB only once a day\n";
$mosq_config .= "autosave_interval 86400\n\n";

## Not working because of permissions (user mosquitto has no access)
# $mosq_config .= "# Use LoxBerry's Plugin logging directory for Mosquitto logfile\n";
# $mosq_config .= "log_dest file $lbplogdir/mosquitto.log\n\n";

# User and pass, or anonymous
if(!$brokeruser and !$brokerpass) {
Expand Down

0 comments on commit 948eca4

Please sign in to comment.