Persistence DB file not created with mosquitto mqqt broker
-
@DocHardinger I tested on a stock OpenWrt 22 build, I also had an issue with the persistence. There was nothing in the logs but it was having an issue creating the database. If you run it in the console instead of as a service then you can see the error. This is mosquitto nossl version 2.0.18
Stop and disable the service:
service mosquitto stop
service mosquitto disableNow run mosquitto in the console:
mosquitto -c /etc/mosquitto/mosquitto.conf
In my case I set the database to be stored in my data directory /etc/data
mkdir /etc/data
chown mosquitto /etc/dataThis is the error I was receiving:
-
i did exact the same but not even getting an error. Same configuration as in my previous post and getting:
root@E1NS-d7d3:~# service mosquitto stop root@E1NS-d7d3:~# service mosquitto disable root@E1NS-d7d3:~# mosquitto -c /etc/mosquitto/mosquitto.conf ^Croot@E1NS-d7d3:~# mkdir /etc/data root@E1NS-d7d3:~# chown mosquitto /etc/data root@E1NS-d7d3:~# mosquitto -c /etc/mosquitto/mosquitto.conf root@E1NS-d7d3:~# mosquitto -c /etc/mosquitto/mosquitto.conf root@ABCD-d7d3:~# mosquitto -c /etc/mosquitto/mosquitto.conf 1718314307: mosquitto version 2.0.18 starting 1718314307: Config loaded from /etc/mosquitto/mosquitto.conf. 1718314307: Opening ipv4 listen socket on port 1883. 1718314307: Opening websockets listen socket on port 9001. 1718314307: mosquitto version 2.0.18 running 1718314307: New connection from 192.168.1.175:50934 on port 1883.
NO database created, also tried your folder.
Can you post your config?
-
You can download my ipk and config here:
https://drive.proton.me/urls/R5XPJM90XG#LIJ04l5vml8RThis was a build from openwrt git main with only the minimum required changes to the config
I uploaded both the ssl and nonssl ipk's, I ran my tests on the ssl version.
-
@crispyoz Tried this but no success because of different architecture. But what i now find out is that version 2.0.15-1 and 2.0.17 of mosquitto is working as expected. Downloaded it from original openwrt packages ( https://archive.openwrt.org/releases/packages-22.03/mipsel_24kc/packages/ ). Version 2.0.18 from same source isnt. So there seems to be a bug inside the mosquitto package.
root@E1NS-d7d3:~# mosquitto -c /etc/mosquitto/mosquitto.conf 1718349698: mosquitto version 2.0.15 starting 1718349698: Config loaded from /etc/mosquitto/mosquitto.conf. 1718349698: Opening ipv4 listen socket on port 1883. 1718349698: Opening websockets listen socket on port 9001. 1718349698: mosquitto version 2.0.15 running 1718349699: New connection from 192.168.1.175:53421 on port 1883. 1718349699: New client connected from 192.168.1.175:53421 as mqtt-explorer (p2, c1, k60, u'pc'). 1718349713: Saving in-memory database to /etc/data//mosquitto.db. 1718349817: New connection from 192.168.1.1:57055 on port 1883. 1718349817: New connection from 192.168.1.1:34947 on port 1883. 1718349817: New connection from 192.168.1.1:49321 on port 1883. 1718349817: New client connected from 192.168.1.1:34947 as e1ns_bridge2 (p2, c1, k60). 1718349817: New client connected from 192.168.1.1:57055 as e1ns_automation (p2, c1, k60). 1718349817: New client connected from 192.168.1.1:49321 as e1ns_hardware (p2, c1, k60). 1718349817: Saving in-memory database to /etc/data//mosquitto.db. 1718349818: Saving in-memory database to /etc/data//mosquitto.db. 1718349818: Saving in-memory database to /etc/data//mosquitto.db. 1718349818: Saving in-memory database to /etc/data//mosquitto.db.
-
@DocHardinger What different architecture are you referring to? The ipk I shared was for Omega2+.
-
@crispyoz yeah its strange i tried your ipk but gets an error because of architecture. When im using the ipk from the source of my last post its working fine. Were using an Omega2+ with custom build firmware.
root@E1NS-d7d3:/tmp# opkg remove mosquitto-ssl Removing package mosquitto-ssl from root... Command failed: Not found Not deleting modified conffile /etc/mosquitto/mosquitto.conf. Not deleting modified conffile /etc/config/mosquitto. root@E1NS-d7d3:/tmp# opkg install mosquitto-ssl_2.0.18-r3_mipsel_24kc.ipk Collected errors: * pkg_hash_check_unresolved: cannot find dependency libopenssl3 for mosquitto-ssl * pkg_hash_fetch_best_installation_candidate: Packages for mosquitto-ssl found, but incompatible with the architectures configured * opkg_install_cmd: Cannot install package mosquitto-ssl. root@E1NS-d7d3:/tmp#
-
@DocHardinger it just wants libopenssl3 installed, I assumed you had it installed on you.r system already. You should just be able to install libopenssl3 using opkg install libopenssl3.
I also shared the non-ssl version since you don't seems to be using ssl.
-
@crispyoz Yes and and some other libraries. Problem is that i need internet connection to install this or all the single packages.
Anyway we will use mosquitto 2.0.17, but im not sure how to integrate this when building the firmware. normally we use the profile file for this but then it takes 2.0.18. So how can we achieve to use 2.0.17 when building the firmware?
-
In your feeds.conf, you can specify the source repository and branch, here is an example of the feed I use for plan44 repo just fine the branch for the version you want and add it like so:
src-git plan44 https://github.com/plan44/plan44-feed.git;main
Then run:
scripts/feeds update -a
scripts/feeds install -aThis should add the feed for the branch you want to your make menuconfig
Another option is to make your own source feed locally, you can see the details how to do this in the developer docs here
-
@DocHardinger Third option is basically the same as the second option but instead of placing any source there just duplicate the existing mosquitto package directory in your local directory and modify the Makefile to change the version you want. Make will then pull down the source for the version you specify:
PKG_NAME:=mosquitto
PKG_VERSION:=2.0.18
PKG_RELEASE:=3You'll also need to amend the hash.
You probably need to amend the name also so you can distinguish the two versions in the make menuconfig menus.
The existing package will be in <build directory>/feeds/packages/net/mosquitto
-
I now just integrated the the mosquitto 2.0.17 package inside the firmware and removed the Mosquitto 2.0.18 package from the profile file. The i install the package after booting with the new firmware. So i just hope mosquitto will be fixed in the feature and i just can use the standard package again. If they didnt fix it i will go your way.
Thx for your help, its a nice experience to get answers really soon in the onion community!