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:
Serial.begin(115200);
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);
client.begin(callback);
digitalWrite(LED, HIGH); // turn the LED off.
delay(10000);
}
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
for (int i = 0; i < length; i++) {
Serial.print((char)payload[i]);
}
Serial.println();
}