• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP8266 not connecting with (MQTT broker – raspberry pi)

Q&A Forum › Category: Home Automation › ESP8266 not connecting with (MQTT broker – raspberry pi)
0 Vote Up Vote Down
Ramitha Goonewardena asked 3 years ago

Hi Rui,
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

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
Can you test your MQTT broker installation? https://randomnerdtutorials.com/testing-mosquitto-broker-and-client-on-raspbbery-pi/
Regards,
Sara

0 Vote Up Vote Down
Ramitha Goonewardena answered 3 years ago

Hi Sara,
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. 
https://drive.google.com/file/d/1id7rZAiYyer60BZ6FiXZapFxlK1grfTx/view?usp=sharing

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
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.

Install Mosquitto MQTT Broker on Raspberry Pi


Regards,
Sara

0 Vote Up Vote Down
Ramitha Goonewardena answered 3 years ago

Hi Sara,
Thanks so much, it worked.
 

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Great!
I’ll close this issue.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.