# New to Mosquitto

**URL:** <https://forum.cedalo.com/t/new-to-mosquitto/1242>\
**Category:** Mosquitto MQTT Broker\
**Created:** [April 12, 2026, 3:01pm UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242 "2026-04-12T15:01:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericg2026](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@ericg2026](https://forum.cedalo.com/u/ericg2026)\
**Post date:** [April 12, 2026, 3:01pm UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242/1 "2026-04-12T15:01:10Z")

</div>

Hello- Setting up Mosquitto on raspberrypi 5 for localhost only. Getting “connection refused” and “permission denied” errors. Please advise where would be the right place for me to seek assistance. Thank you-

---

<div class="post-metadata">

**Author:** ![Tizian](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.cedalo.com/tizian/32/33_2.png) [@Tizian](https://forum.cedalo.com/u/Tizian)\
**Post date:** [April 13, 2026, 8:41am UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242/2 "2026-04-13T08:41:01Z")

</div>

This usually comes down to the stricter defaults in Mosquitto v2.0+ and directory ownership in Bookworm. Try these steps:

### 1. Check File Permissions

The service needs read access to the config and write access to its storage. Run:

- **Config:** `sudo chown root:root /etc/mosquitto/mosquitto.conf && sudo chmod 644 /etc/mosquitto/mosquitto.conf`

- **Storage:** `sudo chown -R mosquitto:mosquitto /var/lib/mosquitto/`

### 2. Update the Config (Localhost Only)

Mosquitto now refuses all connections by default. Edit your config (`sudo nano /etc/mosquitto/mosquitto.conf`) and ensure these lines exist:

Plaintext

```auto
listener 1883 127.0.0.1
allow_anonymous true

```

### 3. Restart and Verify

Bash

```auto
sudo systemctl restart mosquitto
sudo systemctl status mosquitto

```

If it still fails, run `sudo journalctl -u mosquitto -n 20` to see the specific line causing the “Permission Denied” error. Often it’s a log file or persistence file path that wasn’t created with the right user.

---

<div class="post-metadata">

**Author:** ![ericg2026](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@ericg2026](https://forum.cedalo.com/u/ericg2026)\
**Post date:** [April 13, 2026, 11:59am UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242/3 "2026-04-13T11:59:41Z")

</div>

Very good- Thank you for your assistance. I issued the commands you gave me, and added the lines to mosquitto.conf- then ran sub pub test: NO JOY.  
I attached a TXT file of all the screen shots of my situation- for your review.

I intend to use Mosquitto for sub/pub function on the Rpi: ie: it is running on the very same box as is the weather (weewx) application.

[mosquitto\_2.txt](https://forum.cedalo.com/uploads/short-url/awlcdvwHEgEOeWZa3Ao9YVe3SPF.txt) (3.7 KB)

---

<div class="post-metadata">

**Author:** ![Tizian](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.cedalo.com/tizian/32/33_2.png) [@Tizian](https://forum.cedalo.com/u/Tizian)\
**Post date:** [April 21, 2026, 7:53am UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242/4 "2026-04-21T07:53:22Z")

</div>

Hello Eric,

From what I see right now, the logs look good. You have a running system with clients connecting.  
I think the clientids with “auto-…” are your clients.  
If you do not receive any messages, this is probably because of access rights.  
How have you configured your configuration file?

---

<div class="post-metadata">

**Author:** ![ericg2026](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@ericg2026](https://forum.cedalo.com/u/ericg2026)\
**Post date:** [April 22, 2026, 2:44pm UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242/5 "2026-04-22T14:44:51Z")

</div>

Here is my current config information. Attached file mosquitto.inf text  
file.

My goal is to have mosquitto handle weather loop packet data from my  
weather station and then upload that data to my weather web site.

/Eric

(Attachment mosquitto.info is missing)

---

<div class="post-metadata">

**Author:** ![davidmoore](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@davidmoore](https://forum.cedalo.com/u/davidmoore)\
**Post date:** [November 12, 2026, 7:36pm UTC](https://forum.cedalo.com/t/new-to-mosquitto/1242/7 "2026-11-12T19:36:23Z")

</div>

Since the config attachment didn’t come through, the quickest check is to isolate broker vs. client: subscribe to the wildcard topic on the same Pi with verbose output, then trigger a weewx publish and see whether anything arrives and on which topic. If nothing appears, recheck the listener/bind setting and whether anonymous access is actually enabled; if something appears under a different topic, adjust the subscriber/publisher topic prefix. Also confirm weewx is pointed at the local broker port and not a separate instance.
