Hi, i am mahdi.
I use ESP 32 “Dotit ESP32 DEVkitv1”
I run local server on windows 10 “server-0.41.12-java8.jar”
my app version " 2.27.12
I get tokan and put it on the Sketch.
My app connect to local server with ip and port.
in the srial monitor
[15209] Connecting to 192.168.1.5:8080
[15383] Invalid auth token
what can i do…!
this is my sketch:
#define BLYNK_PRINT Serial
int pin = 21;
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = "RJU6Lbmtpj7tTMHBXm1xDJyu480-_pt9";
char ssid[] = "HIRAD";
char pass[] = "%Hiradth&";
char server[] = "192.168.1.5";
void setup() {
pinMode(pin, OUTPUT);
pinMode(pin, HIGH);
Serial.begin(115200);
delay(10);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
int wifi_ctr = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected");
Blynk.begin("Your auth token key", ssid, pass,server,8080);
}
void loop(){
Blynk.run();
}
In seial monitor
Connecting to HIRAD
…WiFi connected
[5197] Connecting to HIRAD
[5200] Connected to WiFi
[5200] IP: 192.168.1.6
[5200]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ v0.6.1 on ESP32
[5207] Connecting to 192.168.1.5:8080
[10208] Connecting to 192.168.1.5:8080
[15209] Connecting to 192.168.1.5:8080
[15383] Invalid auth token
Server in Windows PowerShell
D:\Blynk> java -jar server-0.41.12-java8.jar -dataFolder D:\Blynk
Blynk Server 0.41.13-SNAPSHOT successfully started.
All server output is stored in folder ‘D:\Blynk.\logs’ file.
@mahdi please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Pete.
Grazie
Was your Auth token generated through the app when it was logged-in to your local server, and did you copy/paste it directly from the email into your sketch?
Pete.
Auth token generated through the app when it was logged-in to my local server.
copy it and paste to sketch
You appear to be defining a variable called auth
to hold your Auth token, but then not using that in your Blynk.begin command. Why?
I’m also not sure why yoiu are doing all of this stuff:
WiFi.begin(ssid, pass);
int wifi_ctr = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected");
when Blynk.begin does if for you.
Pete.
OHHHHH…My GOD
Thank you so much Pete…
I’ve been working out for two days
Grazie mille…