ESP32 not connecting to Wifi /

I try to connect my ESP32 to wifi / But my ESP32 seem to stay offline.

Using a standard Wifi code the ESP32 is connecting


But with the standard code for ESP32 / it fails.


What can be the issue?

One step further, but still some issues

I’m now connected with wifi.
Is this because I add disanle TLS?


But now I have Auth Failed!
What can cause this?


Write again the device credentials, if it’s neccesary delete it and create again, this not seems to be an issue with the platform.

And don’t post a printscreen of your code, post it as preformated text, the forum’s posting window has the option to do it, this makes easier for us to read the code, and maybe easy for you to post it.

Hope this helps

Deleting the device and re-create it did the trick.
Now the next step in learning IoT


Hello, I have the same problem and I have tried your advice hundreds of times and it connects when it wants.
The worst is when it connects, if I make a small modification, it stops working.

Hello @Detector_incendio,

You should have something wrong in your source code, that is sending a lot of endpoint calls to the server. If this happens there is a protection mechanism that locks the device, so take care with that.

If need help do not hesitate on posting here your source code.


HI, @JorgeTrincado, this is my code:

#define _DEBUG_
#define _DISABLE_TLS_
#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>
#include "DHT.h"

//Web parameters
#define W_SSID "my wifi ssid"
#define SSID_PASSWORD "my wifi password"

// pareters
#define USERNAME "my user name"
#define DEVICE_ID "my device"
#define DEVICE_CREDENTIAL "my credentials"

//DHT parameters
#define DHTPIN 4 // GPIO04 (D2)
#define DHTTYPE DHT22  //sensor model

//Port configuration
#define flame 5 //Flame sensor -- GPIO05 (D1)
#define rele 14 //Rele -- GPIO14 (D5)

//rele activator
bool fire = true;

void setup() {
 //port setup
 pinMode(flame, INPUT); //flame sensor
 pinMode(2, OUTPUT); //internal led
 pinMode(rele, OUTPUT); //rele
 Serial.begin (115200);

 thing.add_wifi(W_SSID, SSID_PASSWORD);

 // remote control
 thing["button"] << [](pson & in) {
   digitalWrite(rele, !in);
   digitalWrite(2, in);

 // data transmission
 thing["dht"] >> [](pson & out) {

   //calibration factors
   float cal_temp = 0;
   float cal_hum = 0;

   //data sending
   out["Temperature"] = dht.readTemperature() + cal_temp;
   out["Humidity"] = dht.readHumidity() + cal_hum;
   out["fire"] = fire;


void loop() {
 fire = digitalRead(flame);
 if (!fire) {

I hope this will be useful for you

Hola @Detector_incendio,

there are two problems on this code:
1- digitalWrite is waiting for an integer or bool but you are placing a PSON, that may be empty, it is better if you make a casting or similar, and also could be interesting to protect your code of empty psons that will appear when the API is refreshed. Place this resource instead of your “button” one:

thing["button"] << [](pson & in) {
      in=digitalRead(rele); //if it is empty we can retrieve current status from the pin port
   digitalWrite(rele, in?LOW:HIGH);
   digitalWrite(2, in?HIGH:LOW);

2-Big mistake in the loop! as I was assuming in my previous message, your code is calling “warning” endpoint recurrently, always that fire==0. that is why the server is locking your device. You have to include here a mechanism that calls the endpoint only one time, or one time each X seconds

int last_fire_value=0;

  fire = digitalRead(flame);
  if (!fire && !last_fire_value) {

Hope this helps you