Stalls at client.wifiConnection(“TP-LINK_D22080”, “1234567”);


Code stalls at client.wifiConnection(“TP-LINK_D22080”, “1234567”);
using nodemcu v3 esp8266 lolin
code listed below

#include <UbidotsESPMQTT.h>
#include <PubSubClient.h>
#define TOKEN "A1E-xxxxxxxxxxxxxxxx" // Your Ubidots TOKEN
Ubidots client(TOKEN);
void setup() {
  // put your setup code here, to run once:
  pinMode(sensor, INPUT);   // Analog pin setup for read
  pinMode(LED, OUTPUT);     // LED pin as output.
  client.setDebug(true);    // Pass a true or false bool value to activate debug messages
  client.wifiConnection("TP-LINK_D22080", "1234567");
  //client.wifiConnection(WIFINAME, WIFIPASS);
  digitalWrite(LED, HIGH);           // turn the LED off.

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print("] ");
  for (int i = 0; i < length; i++) {


Dear @blueminerals,

As first to discard hardware issues, I recommend you make a test with the WebClient example provided in the ESP8266WiFi Library. Then, if you are able to establish the connection and handle the request, refer to followings codes based on your Ubidots License and take them as an example for your test. Don’t forget to replace the parameters where is indicated.

All the best,
Maria C.


The code you referred me to is practically identical to my code. Your code doesb’t work either. I can get the Led to blink if I comment the client.wifiConnection line out. So the esp8266 executes code. Any other way to test the wifi?


state: 2 -> 0 (0)
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
…state: 5 -> 2 (2c0)
rm 0


Did you already try the WebClient example from ESP8266WiFi library?