[SOLVED] Can I use ESP8266 using MQTT without connection manager

On mi EPS8266 I want to use the WiFiManager to connect with a WiFi and the subscribe to a variable via MQTT. I
Is this possible? Because I saw that most of the Ubidots APIs need to handle the connection in order to work.
Is any example if it’s possible?

I already connect with Ubidots using REST client and API client.

Link: https://github.com/tzapu/WiFiManager

You can use the Ubidots ESP library for MQTT:

You should pass the SSID and PASSWORD using Wifi Manager instead of define them as we made for the examples.

Regards

1 Like

Thanks, it works perfect!

How did you code it ?
this is how i did it ,

  char WIFINAME[40];
  char WIFIPASS[40];
  wifiManager.getSSID().toCharArray(WIFINAME, 40);
  wifiManager.getPassword().toCharArray(WIFIPASS, 40);
  
  client.wifiConnection(WIFINAME, WIFIPASS);
  client.setDebug(true); // Pass a true or false bool value to activate debug messages
  client.ubidotsSubscribe("zafiro", "GeoPosition"); //Insert the dataSource and Variable's Labels
  client.begin(callback);

i have not wifi response.