Can't connect NodeMCU with MQTT
-
@salmanfaris Yes, I had tried that before and it was working fine. Infact, everything works perfectly when I connect with the online mqtt server,
test.mosquitto.org
. So, there's some problem with the local installation, while using my local IP. But I can't find that problem. I had also re-installed the mqtt, but still the same issue. -
@sivanath Does the local pub and sub is working over CLI?
-
@salmanfaris It was working in CLI, but now it's showing multiple usages at the port
-
It looks like
mosquitto
is trying to register bothIPv4
andIPv6
on the same port.If
IPv6
is not required for the application your use case, try changing themosquitto.conf
file as below for limiting it toipv4
:# Set to `ipv4` to force the listener to only use IPv4, or set to `ipv6` to # force the listener to only use IPv6. If you want support for both IPv4 and # IPv6, then do not use the socket_domain option. socket_domain ipv4
Please please make sure the default
port 1883
is not already in use by any other programs. If yes, you can either kill those programs (not recommended) or change the port inmosquitto.conf
file: -
@swalahamani @salmanfaris
I changed my conf file and specified ipv4
And this is the status of the port (from resource monitor):Image: mosquitto.exe PID: 3732 Address: IPv6 loopback Protocol: TCP Port: 1883 Firewall Status: Allowed, not restricted
It is listening to mosquito..
-
Is it working now?
-
@swalahamani No
-
@sivanath
Did you follow the steps which I mentioned previously? -
@swalahamani Yeah!!
-
Oh okay.
Please bring your device if you're coming for the upcoming MakerChat 0x13 tomorrow (IST). Either I and @salmanfaris or both of us will be there.
Or else we can set up a call sometime this weekend or the next week and sort it out.
Let me know.