[SOLVED] Mosquitto Node-Red mqtt connecting

I follow the procedure
-Raspberry Pi using Peter Scargill’s script

In Node-Red I try a flow that uses mqtt in / out the state of is connecting and connected !!


nmbd : active | Affinity 0-0
smbd : active | Affinity 0-0
apache2 : active | Affinity 0-0
mosquitto : active | Affinity 0-
node-red : active | Affinity 0-0
cron : active | Affinity 0-0
ssh : active | Affinity 0-0
vncserver : active | Affinity 0-0

root@Natacha:~# service mosquitto status
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
   Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)
   Active: active (running) since Sat 2019-11-30 17:03:59 CET; 8min a
     Docs: man:systemd-sysv-generator(8)
  Process: 967 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCC
   CGroup: /system.slice/mosquitto.service
           └─972 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

nov 30 17:03:58 Natacha systemd[1]: Starting LSB: mosquitto MQTT v3.1 message br
nov 30 17:03:59 Natacha mosquitto[967]: Starting network daemon:: mosquitto.
nov 30 17:03:59 Natacha systemd[1]: Started LSB: mosquitto MQTT v3.1 message bro

root@Natacha:~# netstat -tlnp | grep mosq
tcp        0      0  *               LISTEN      972/mosquitto
tcp        0      0  *               LISTEN      972/mosquitto
tcp6       0      0 :::1883                 :::*                    LISTEN      972/mosquitto

if I kill the kill (by htop) and

root@Natacha:~# mosquitto -v
1575131094: mosquitto version 1.4.10 (build date Wed, 13 Feb 2019 00:45:38 +0000) starting
1575131094: Using default config.
1575131094: Opening ipv4 listen socket on port 1883.
1575131094: Opening ipv6 listen socket on port 1883.
1575131097: New connection from on port 1883.
1575131097: New client connected from as Test (c1, k60).
1575131097: Sending CONNACK to Test (0, 0)
1575131097: Received SUBSCRIBE from Test
1575131097:     sensors/# (QoS 0)
1575131097: Test 0 sensors/#
1575131097: Sending SUBACK to Test

when the process is finished the state connecting

Why when the boot is done node-red mqtt in / out the state of is connecting

Hello @ Stroked_Papy
I am also try to configure HomeAssistant, Mosquitto broker & zigbee2mqtt on my raspberry, its looks like you are advance stages then me, so i think to talk with you for my configuration settings. when i give Mosquitto command in my device it shows me error, i am not able to understand what that error mean, i am attaching screenshot of that error with this post, if you have any idea please inform me in simple language , is this error belongs to HomeAssistant, Mosquitto, pihole or zigbee2mqtt. if somebody have little idea & remedy for that please guide me. thanks


sudo nano /etc/mosquitto/mosquitto.conf
allow_anonymous true
Restart Mosquitto

Many thanks for sharing your solution. I’m not sure if I understand the underlying issue, is it a problem that the Mosquitto service runs as root user (probably something we should change)? Or is it the other way round that it usually requires some authentication, which Node-RED does not do by default? Probably there is some way choose a certain Mosquitto authentication method and configure this with Node-RED as well :thinking:.