1

I installed an updated eclipse mosquitto broker on a Windows host for my home alarm and control MQTT network. Had a bit of trouble getting it to listen for remote clients, but got everything working with the existing clients.

The trouble is I can't get the service to log no matter what I put in mosquitto.conf. If I run it directly from a command prompt (mosquitto -v) it logs to the console, and always says 'Using default config'. Does this mean it can't locate the CONF file? I've tried several versions of mosquitto going back to my original 1.6 and they all do the same thing.

This setting:

log_dest file c:\projects#lab\mosquitto.log

is the problem. I see where it says that a Windows service defaults to 'log_dest none', but I assumed I could overwrite that.

buzzard51
  • 1,372
  • 2
  • 23
  • 40

1 Answers1

1

I doubt # is valid in a path name.

Also mosquitto doesn't have a default config file name, you must pass it on the command line with -c option.

The service picks up mosquitto.conf from the install dir, but only when running as the service

Also just to be clear, -v overrides all logging options (including writing to a file). From the man page:

-v, --verbose

Use verbose logging. This is equivalent to setting log_type to all in the configuration file. This overrides and logging options given in the configuration file.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • Tried all different files names, no log. Not really a big deal, it just stuck to me. What I did have to do is go back to version 1.6 so I could easily connect to my Raspberry Pi network. – buzzard51 Oct 23 '22 at 21:37
  • 1
    You really shouldn't be running 1.6.x anymore, Mosquitto v2.x will only allow connections from localhost with the default baked in configuration, for detail on how to configure it to allow external connection see https://stackoverflow.com/questions/65278648/mosquitto-starting-in-local-only-mode/65278769#65278769 – hardillb Oct 23 '22 at 22:11
  • The latest would not allow my Raspberry Pis to connect out of the box. I went through lots if iterations and pushups before going back to the 1.6 original, which worked fine. I will probably try to update when the dust settles. – buzzard51 Oct 25 '22 at 00:38