[SOLVED] Mosquitto Node-Red mqtt connecting

I follow the procedure
-dietpi
-Raspberry Pi using Peter Scargill’s script
Mosquitto
Node-Red

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

but

dietpi-launcher
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
go
     Docs: man:systemd-sysv-generator(8)
  Process: 967 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCC
ESS)
   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
oker...
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
ker.



root@Natacha:~# netstat -tlnp | grep mosq
tcp        0      0 0.0.0.0:9001            0.0.0.0:*               LISTEN      972/mosquitto
tcp        0      0 0.0.0.0:1883            0.0.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 192.168.1.101 on port 1883.
1575131097: New client connected from 192.168.1.101 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
Capture.JPG

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

hy

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

Stroked_Papy
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:.