Mosquitto.conf won't save edits

Trying to edit the Listener and allow_anonymous but the file won't let me save the changes. All the tutorials I've read and watched don't have this problem. What am I missing? Thanks.

FB_IMG_1673175339373

3 things...

  1. Never use wordpad to edit config files (use notepad or vscode)
  2. You need to open the editor as an administrator because the file is in a protected area (program files)
  3. This is not really a node-red question (but we will forgive you :wink: )
1 Like

As Steve says - access to the program files area requires administrator access. You can start notepad rather than wordpad in administrator mode. If you do use notepad, make sure that it is saving with UNIX style line endings (LF) and not windows-style (CRLF). If it isn't, you will need to install an alternative. Notepad++ is good for quick things but VSCode is much better if you want to do any coding.

image

Sorry I know it's not directly related to NR but I've been trying to get NR and an ESP8266 to converse for a week without any luck and don't know where to ask Mosquitto questions. I got the Notepad file to save now so I can set allow_anonymous to true. Thanks.

NR says it's connected to the broker
Screenshot 2023-01-08 073250

I did get the firewall to pass on port 1883

I have the ESP programmed correctly for the wifi to connect
Screenshot 2023-01-08 073217

But still can't connect to the broker.
Screenshot 2023-01-08 073142

I can ping the broker machine's IP just fine. My router has the broker on a static IP and sees all devices. What else am I missing?

Are the broker and Node-RED running on the same device? Also, have you tried the MQTT Explorer app which is really helpful when working on MQTT? Will it connect?

Yes, NR and the broker are on the same computer.

I downloaded MQTT Explorer and see that the outTopic seems to be publishing.

I tried using a ClickPLC the other day but I couldn't get that to connect either.

Just a sec, it just started working after I decided to reboot the broker's computer. lol. Thanks all

Doh!

Well, I decided a while ago to ditch having to write lots of C++ code on my ESP's. I now use ESPhome on all of them. I've found it to be reliable and is mostly config-driven so I just have a bunch of standard configs that I pull together as needed for different devices, sensors, switches, displays, etc. It still lets me write C++ code if I need something custom and lets me control MQTT output. I've found it to be rock-solid in operation unlike some of the other ESP firmwares. You do still have to compile after a change but after the first time, everything can be done wirelessly.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.