I really enjoy your book on building an automation system under $100, but currently stuck with the MQTT broker failing to connect to my esp8266 (going through modules 6&7). Attempting MQTT connection…failed, rc=-2 try again in 5 seconds. I have double-checked the IP address,node-red settings for setting up the MQTT broker, and any changes that need to be made to the mosquitto config file. I also have the raspberry pi Model B. Your help would be appreciated
Can you test your MQTT broker installation? https://randomnerdtutorials.com/testing-mosquitto-broker-and-client-on-raspbbery-pi/
Thanks for getting back to me, I worked with the tutorial and it works fine as it is intended to, but when I start communicating with my esp8266. I get the same problem, I have attached a link with a snapshot of the issue I have. My Arduino serial output and node-red and code are taken from the book for your reference.
Which instructions did you follow to install Mosquitto broker?
There is a new version that needs some additional steps for configuring.
See steps 7, 8, 9, and 10.