Hi everyone. I am writing a program for ESP-01 which needs to establish SSL connection to a MQTT server. I follow the tutorial: https://flespi.com/blog/how-to-connect-esp8266-to-secure-mqtt-broker-know-it-all-and-get-it-done-approach which uses adafruit mqtt library, but I am getting an error on Serial Monitor after flashing:
https://imgur.com/LX6QC8z
Public Token I use: https://flespi.com/mqtt-broker#client

Sketch file: https://drive.google.com/file/d/1wAm-A-s7_1ccmGkxkJxgfXQvrx_VsPM8/view?usp=sharing

Running all over again and again but I can't find the problem. Hope to hear solution from you. Thank you!

    ntd252 Have you succeeded with plain TCP connection first?
    You can also check logs from broker side via toolbox, it is located under MQTT block in flespi.io

      shal Yes, my program works well with plain TCP, but I use cloudmqtt. Then I decided to improve it by using SSL. I just use the project file from tutorial and replace with my token to test first, but it's not running.
      When I try to connect, I get no log for connection, just toolbox log. The thing is I use to public token, which doesn't require account (Yes, I do have an account)

      ntd252 I think the first step will be to connect your ESP with plain TCP to flespi MQTT Broker, try these settings and it is better to use your token, so that you may check broker logs from your account. If it works for you then changing to SSL will be and easy step.

        ntd252 Can you please clarify what do you mean by "but I use cloudmqtt"?
        Basically such an error occurs when client fails to establish TCP connection to host:port. Can you verify that you can reach mqtt.flespi.io port 8883 from inside your WiFi network?

          3 years later
          Write a Reply...