BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

NodeMcu-Invalid auth token

hi friend i am using this sketch.but unale to conect blynk server.please help

`#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “SENEM”;
char pass[] = “0506355107”;

void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}

void loop()
{
Blynk.run();
} `

Try refreshing the token in the project and add the new token to your sketch.

If this fails it could be a geo-dns issue. Are you using a fixed line internet connection or a GSM network?
Are you moving from location to location?

If it is a geo-dns issue you will have to ping blynk-cloud.com and use the IP address in the Blynk app rather than the url.

i several times refreshed token,but it not working.i am using line internet connection

With your latest token what do you get in a web broswer with:

http://blynk-cloud.com/enter_token_here/project

Edit: where in the world are you (some parts of the Middle East and China sometimes have problems)?

{“id”:2019822597,“name”:“nodemcu”,“createdAt”:1481367679164,“updatedAt”:1481644766821,“widgets”:[{“type”:“BUTTON”,“id”:1,“x”:0,“y”:0,“color”:600084223,“width”:2,“height”:2,“tabId”:0,“deviceId”:0,“pinType”:“DIGITAL”,“pin”:16,“pwmMode”:true,“rangeMappingOn”:false,“min”:0,“max”:1,“value”:“0”,“pushMode”:false}],“devices”:[{“id”:0,“name”:“New Device”,“boardType”:“NodeMCU”,“token”:“3c4a4b1dabf94fceb19b695c2f8d6ec2”,“connectionType”:“WI_FI”}],“theme”:“Blynk”,“keepScreenOn”:false,“isShared”:false,“isActive”:true}

I am middle east-Azerbaijan

Project token looks ok then. What IP does a ping give you?

how to check my ping ip?

from your pc go to a command prompt / dos prompt or terminal window (whatever you call it with your operating system) and then enter:

ping blynk-cloud.com

In the project app settings can you try changing blynk-cloud.com to 45.55.96.146

Let us know if you don’t know where the settings are to make this change.

Have you ever managed to connect to the Blynk server?

no i dont know how to chang ip. several manth ago i tried it it workded well.

Logout of the app by pressing top left button in the app a couple of times.

Click Log In link, then click the “traffic light image” (it’s actually a router), move the slider from BLYNK to CUSTOM and enter the IP in the box (don’t change the port). Then log back into Blynk.

When you were successful several months ago were you in the exact same location with the same hardware and the same ISP etc?

my app side is working well but hardware is unable to connect server.[roblem is this

my nodemcu arduino+ethernet arduinousb doesnt work

Same problem for me. NodeMCU is not connection invalid auth token.
Replaced DNS name with ip returned by ping cloud
log of an on again
create a new projekt with new device and auth token multiple times.

noting is working.

Hills8

@hills8 have you used the IP address in the NodeMCU sketch? If you haven’t it will not match your app and give you a token mismatch.

How can i add the ip adress in the sketch?

char server[] = "xxx.xxx.xxx.xxx"


Blynk.begin(auth, server);

and where i have to add my WLan Settings?

actually i use
Blynk.begin(auth, ssid, pass);