Help Please, i cannt connect my esp32 to blynk - Invalid auth token

Hey guys, im new here and i really need your help in my college project. for now i just try to learn how to work with blynk and light up a led.
im trying to connect esp32 to blynk app and i get “Invalid auth token” in the Monitor.

this is what i get in the monitor:

Connecting to Dvir
....E (4582) wifi:Association refused temporarily, comeback time 649 mSec
......WiFi connected
[5157] Connecting to Dvir
[7670] Connected to WiFi
[7670] IP:
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP32

[7680] Connecting to
[8542] Invalid auth token

and this is my code:

#define BLYNK_PRINT Serial

int pin        = 21;

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "FE__ssOnWS84G2keAUvqSfTBAa5yEp7O";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Dvir";
char pass[] = "dvir5558";

void setup() {  
pinMode(pin, OUTPUT); 
pinMode(pin, HIGH);

Serial.print("Connecting to ");

WiFi.begin(ssid, pass);
int wifi_ctr = 0;
while (WiFi.status() != WL_CONNECTED) {

Serial.println("WiFi connected");  

Blynk.begin(auth, ssid, pass, "", 80);


void loop(){;

@vatavo please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:

It’s also good practice to use triple backticks around your serial monitor output - it makes it much easier to read.


thanks, i edit my post. it is really better this way.

Are you using Blynk Legacy or the new Blynk IoT?


all of the tutorials are for the old one. so im using the old app.

The server address for Legacy Blynk is not blynk-cloud

Legacy Blynk is no longer supported and not being developed, and will be retired at some point.


also, you should use library version 0.6.1 instead of 1.0.1

1 Like

thank you all really thank you, i was troubled for days.
now that everything in order can you please direct me for a good library codes for esp32 and servo motors please.
also does esp32-cam work with blynk??

i tried to download the new blynk app. and the first thing is - add new device(wifi), and then it say power on you device and make sure that indicator is blinking.
how i connect the esp32 to the new app?? how can i make it “blinking”?

If you’re using the Edgent example sketch, then I’d suggest that you read this…

and this…

I’d suggest that you search the forum for those sort of answers.


thank you very much guys everything working properly!!!

1 Like