I'm on a beginners level using Node RED to monitor and control Shelly devices.
My setup at the moment is a Shelly Plus 1 which is connected to my network and I was setting up Node RED on my MacBook.
Now I'm a bit overwhelmed with all steps to do in order to control the Shelly (switching on and off)
Here's what I can say for sure.
Mosquitto v2.0.20 is installed with homebrew and the broker is running.
The IP's of MacBook ({MacBook-IP}.9) and Shelly device ({ShellyDevice-IP}.9) indicate that it's connected to the same network.
Seems your not able to connect to the mqtt broker
mqtt2 has some security settings that are enabled by default, or your user and password are incorrect
have a look here for settings for mqtt config file.
Is this your Mac?
Does it have a static / reserved IP address? What address?
What is it's hostname and can you specify a hostname in the Shelly?
What is the IP address of the Shelly (which doesn't have to be static)?
According to your shelly setting the server is 192.168.10.13
but your notebook is 172.20.10.9
The IP of the notebook(where mosquitto is installed) should match the IP of the server in the shelly settings. Which should be a local lan IP not your internet wan IP
You should be able to set static IP's in your router using the mac address of the device. The broker will need a static IP.
A computer can be referred to on a network using either it's IP address or a hostname.
I don't know Macs but on my Linux computers the hostname is specified in /etc/hostname and can be shown with the hostname command.
For example:
pi@GlassPi:~ $ hostname
GlassPi
While the IP address may be set by the network DHCP server and might vary, the hostname is specified by the comouter itself and is thus fixed.
I asked about this because you may be able to specify the hostname rather than the IP address as the MQTT server (I have no idea if this will work for your Shelly).
It's more usual though for the MQTT broker to have a static IP address, or at least a reserved address in the router.
Screenshots can sometimes help us understand how a system is set up.
Not if they are a random photo from the internet though.
I understand your confusion about the content I provided as it always seems to be hard to think into an issue.
Thanks for your inputs. I went back to the beginning and started off new.
I made it work and can state the following:
there's no need to fix the IP
something like hostname is not needed
Here's what does the trick.
In the MacBook's Terminal:
Properly setting up Mosquitto via brew on the Mac.
Starting Mosquitto, listening to port 1883 (default)
In Shelly settings page
Finding the Mac's IP address which (for now) is my (testing) server. Mine is 192.168.0.56
Navigating to Shelly setup via browser: My Shelly IP is 192.168.0.31, so http://192.168.0.31/#/settings/mqtt will bring me to the settings page for MQTT.
Tick the box for "Enable" at the top to start MQTT
Tick the box for "Enable 'MQTT Control'
Tick the box for "RPC over MQTT"
Tick the box for "RPC status notifications over MQTT"
Tick the box for "Generic status update over MQTT"
Without the fixed IP of the mqtt broker or hostname, if the IP of the Mac Book changes (as router may give the Mac Book a new IP in the near future) Then node-red and the Shelly devices will not know what the new IP may be. So again i would advise to fix the IP or set a Hostname.
Your issue was you were using an incorrect IP (172.20.10.9) for the broker settings, if you had fixed the IP you would of been sure you where using the correct one.