Down to the fact I had an IP clash (using fixed IP’s) I had a problem with Publish-Subscribe.
(P 231 MicroPython_Programming…)
Messages were only passing one way and only for a short period of time.
I am using eclipse-mosquitto in a Docker container on a RaspPi.
Before I spotted the clash on my router I tried to look at the log(s) in eclipse-mosquitto. (Through the quick link in Portainer)
“No logs available”
Sorted the IP issue. Publish-Subscribe worked. But still no logs.
Can you tell me how I turn logging on?
(If this is covered in one of the other ebooks I have purchased, please tell me where)
We never used that exact same setup before. So, I’m not sure how Portainer works.
But what type of information are you looking for in the logs?
If you’re interested in monitoring a specific MQTT topic, you can subscribe to it, and then publish messages will be printed in the terminal window.
I’m sorry that I can’t help much.
It has been many years since I played with Mosquitto so some of this may be out of date. At any rate I don’t believe logging is turned on by default. You have to enable logging in the mosquito.conf file. You can also set where the log files are in this file. Also check the /var/log directory for anything named mosquitto.
Initially I was looking for info to tell me which IP was getting through and which was not. Thanks to discord.com I discovered that the log is to be found in: /IOTstack/volumes/mosquitto/log/mosquitto.log and from what I can make out it has been running all the time, I just did not know where to look.
There’s also a log_dest stdout “switch” (for want of a better expression) in mosquitto.conf although I haven’t fully got my head around exactly what that changes.
One important thing I did learn, which you may have come across already, is that Eclipse have made changes to the ‘listening’ set-up in the latest version of Mosquitto (2.07). I discovered this at https://youtu.be/KKw3tUrX3d8
Learning more all the time.
Thanks for your help
You would need to understand a little bit of *nix to get an idea what that line means (log_dest stdout “switch”). “log_dest” is from mosquitto itself and an educated guess would say its “log destination”. ie. Where should the log go? stdout is *nix for “Standard Output” and is generally set to the terminal but can be changed to almost anywhere (/dev/null is popular if you don’t care) including a file. Unfortunately I have no idea what “switch” means.