Failed with state -2Connecting to MQTT

Hi everyone can you help me with this error

failed with state -2Connecting to MQTT...

failed with state -2Connecting to MQTT...

failed with state -2Connecting to MQTT...

failed with state -2Connecting to MQTT...

my serial monitor kept showing this even after the code i run have been verified, and the wifi hotspot username and password is the same as in the code. Thank you

Post the full sketch that you are using and details of your hardware

the hardware used is esp32 wroom 32D
the intention of this mqtt is to send data that have been coded in the esp that is connected with hcsr04 ultrasonic sensor then transfering it to the mqtt as a broker before being displayed using node red as the iot dashboard

Why did you open a new topic?
Opening more than one thread regarding the same problem is a violation of the forum rules.

oh i have no idea sorry i will delete the other one

This topic has been closed

Please continue in the original topic