I would like to see sensor data using Node-red and a local MQTT (mosquito) server. I installed everything and could connect mosquito to node-red, publish and receive data.
When I use 127.0.01 and port 1883 to connect ESP32 to my local mosquito, I receive the below error:
Attempting MQTT connection...failed, rc=-2 try again in 5 seconds
I read about 20 threads on the net about the error and did every solution people suggests. However, no success up to now.
...........................................................................
Help us help you.
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.
Please post a schematic.
Please post an image of your project.
Please describe the problem better then you just did.
...............................................................................................................................................
Serial Input basics.
The events portrayed in this post are not all true. The names are not real names of real people and real organizations.
..............................................................................
I think I did not cross any rules in Arduino Forum. The error I inserted in my first message is copied from my "serial monitor". Please let me know if I did something wrong.
Thanks
By default Mosquitto will listen on all active wired and wireless interfaces, so try one of those. A valid IP address will probably start with the numbers 192, 10, or 172 depending on how your network has been setup.
If that doesn't work then look in the mosquitto.conf file to see how the # Listeners
section has been configured.
If it has been set to use a particular address, then use that.