• 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

Attempting MQTT connection…failed,

Q&A Forum › Category: ESP8266 › Attempting MQTT connection…failed,
0 Vote Up Vote Down
Mohammed Azeez asked 10 months ago

Hi Rui   I Have a problem  during learning  ESP8266-12E and Mqtt  I use one of your code (https://randomnerdtutorials.com/esp8266-and-node-red-with-mqtt/) and change SSID, password and RPi IP address   but always get this error 

Attempting MQTT connection…failed, rc=-2 try again in 5 seconds
Attempting MQTT connection…failed, rc=-2 try again in 5 seconds
Attempting MQTT connection…failed, rc=-2 try again in 5 seconds
Attempting MQTT connection…failed, rc=-2 try again in 5 seconds

Question Tags: Raspberry Pi+esp8266-12E
4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 10 months ago

Hi.
That means that your ESP8266 is not able to connect to your broker.
Do you have your Raspberry Pi running the broker?
You can test the broker connection with this tutorial: https://randomnerdtutorials.com/testing-mosquitto-broker-and-client-on-raspbbery-pi/
Regards,
Sara
 

0 Vote Up Vote Down
Mohammed Azeez answered 10 months ago

Hi Sara,
thanks for your Replay
it wok     thank you very much    you save me:)

0 Vote Up Vote Down
Sara Santos Staff answered 10 months ago

Great!
I’ll mark this question as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

0 Vote Up Vote Down
Mohammed Azeez answered 10 months ago

yes  thank you very much for your help

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

  • [eBook Updated] Download Build Web Servers with ESP32 and ESP8266 (2nd Edition) February 8, 2021
  • [eBook Released] Build Web Servers with ESP32 and ESP8266 (version 1.0) October 27, 2020

You must be logged in to view this content.

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

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