Mqtt connecting

Hello i have a problem with Mosquitto or Mqtt it isnt conecting what can i do

You can tell us what mosquitto is running on, which version of mosquitto, which device you are trying to connect to mosquitto on (possibly the same device) and how you have configured the MQTT server node.

Also stop node red and start it in a terminal and paste the full startup log here (not screen shot). When pasting it use the </> button at the top of the forum entry window.

27 Nov 14:20:28 - [info] 

Welcome to Node-RED
===================

27 Nov 14:20:28 - [info] Node-RED version: v2.1.3
27 Nov 14:20:28 - [info] Node.js  version: v12.22.5
27 Nov 14:20:28 - [info] Linux 5.10.63-v7l+ arm LE
27 Nov 14:20:29 - [info] Loading palette nodes
27 Nov 14:20:31 - [info] Dashboard version 3.1.2 started at /ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named rpi_ws281x
27 Nov 14:20:31 - [warn] rpi-neopixels : rpi-gpio.errors.ignorenode
27 Nov 14:20:31 - [info] Settings file  : /home/pi/.node-red/settings.js
27 Nov 14:20:31 - [info] Context store  : 'default' [module=memory]
27 Nov 14:20:31 - [info] User directory : /home/pi/.node-red
27 Nov 14:20:31 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Nov 14:20:31 - [warn] Flows file name not set. Generating name using hostname.
27 Nov 14:20:31 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
27 Nov 14:20:31 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

27 Nov 14:20:31 - [info] Server now running at http://127.0.0.1:1880/
27 Nov 14:20:31 - [info] Starting flows
27 Nov 14:20:32 - [error] [LCD-I2C:805b1717.a05c98] Error: ENOENT: no such file or directory, open '/dev/i2c-1'
27 Nov 14:20:32 - [info] Started flows
27 Nov 14:20:32 - [info] [mqtt-broker:c4abe326.138ce] Connection failed to broker: mqtt://192.168.178.33:1883
27 Nov 14:20:32 - [info] [mqtt-broker:Raspberry pi 1] Connection failed to broker: mqtt://192.168.178.33:1883
27 Nov 14:20:32 - [info] [mqtt-broker:Server 1] Connected to broker: mqtt://192.168.178.45:1883
27 Nov 14:20:47 - [info] [mqtt-broker:c4abe326.138ce] Connection failed to broker: mqtt://192.168.178.33:1883
27 Nov 14:20:47 - [info] [mqtt-broker:Raspberry pi 1] Connection failed to broker: mqtt://192.168.178.33:1883


type or paste code here
```mosquitto
1638022940: mosquitto version 2.0.11 starting
1638022940: Using default config.
1638022940: Starting in local only mode. Connections will only be possible from clients running on this machine.
1638022940: Create a configuration file which defines a listener to allow remote access.
1638022940: For more details see https://mosquitto.org/documentation/authentication-methods/
1638022940: Opening ipv4 listen socket on port 1883.
1638022940: Opening ipv6 listen socket on port 1883.
1638022940: mosquitto version 2.0.11 running

Do you have two brokers on different IP addresses?

Did you see that? The text is not strictly true. In fact it should say that you cannot connect to it using anything other than localhost (or 127.0.0.1) unless you allow it to do so. To allow that create a file /etc/mosquitto/conf.d/mossy.conf and in there put

# Since mosquitto 2.0 have to provide listener and allow anonymous
listener 1883
allow_anonymous true    # this may be overwridden below

then restart mosquitto.

o jea now ith working i think that this was a update . i had to reinstall it because my rpi was on buster and not on the newest so i got errors . Thanks

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