# Mosquitto.conf won't save edits

**URL:** <https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364>\
**Category:** General\
**Created:** [8 January 2023 11:05 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364 "2023-01-08T11:05:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbmgf7](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rbmgf7](https://discourse.nodered.org/u/rbmgf7)\
**Post date:** [8 January 2023 11:05 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/1 "2023-01-08T11:05:27Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/4/046520ac739034dadbce3432b5f01e1ddbb4c3cf.jpeg)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 January 2023 11:13 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/2 "2023-01-08T11:13:12Z")

</div>

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 😉 )

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 January 2023 11:42 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/3 "2023-01-08T11:42:10Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9906ee15c79c7d72bbefb289fb6e0922f5204a9.jpeg)

---

<div class="post-metadata">

**Author:** ![rbmgf7](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rbmgf7](https://discourse.nodered.org/u/rbmgf7)\
**Post date:** [8 January 2023 13:41 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/4 "2023-01-08T13:41:01Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/775e066ef2abd7c7cd05fcf64446c0cad0e31d52.png)

**I did get the firewall to pass on port 1883**

 ![Screenshot 2023-01-08 073412](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc7daf161518bdfeb1b8d3abb5c318589a6f26d2.png)

**I have the ESP programmed correctly for the wifi to connect**  
 ![Screenshot 2023-01-08 073217](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/72c472e9fc3d207be0d98607c346cd1037fa96e3.png)

**But still can't connect to the broker.**  
 ![Screenshot 2023-01-08 073142](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0f737b87a89774446c39d215d3eeb91cb427b16c.png)

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?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 January 2023 13:43 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/5 "2023-01-08T13:43:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rbmgf7](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rbmgf7](https://discourse.nodered.org/u/rbmgf7)\
**Post date:** [8 January 2023 13:51 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/6 "2023-01-08T13:51:57Z")

</div>

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

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

 ![Screenshot 2023-01-08 074959](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a89dbf8970abcd092a1b146b776a9e52e5990c8e.png)

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

---

<div class="post-metadata">

**Author:** ![rbmgf7](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rbmgf7](https://discourse.nodered.org/u/rbmgf7)\
**Post date:** [8 January 2023 13:53 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/7 "2023-01-08T13:53:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 January 2023 17:18 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/8 "2023-01-08T17:18:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 March 2023 17:18 UTC](https://discourse.nodered.org/t/mosquitto-conf-wont-save-edits/73364/9 "2023-03-09T17:18:51Z")

</div>

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