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

Local server invalid token

I use Google Cloud to build my local server.
I can login the app by ip address.
The data about my acount are able to be seem at the admin in server.
But my hardware cant connect to my server …

MY CODE

#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>


char auth[] = "55c22c7fb49c4855abc86ccd4a245d2e";


char ssid[] = "cht3584";
char pass[] = "75713952";

#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 4); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);

  delay(10);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass, "35.185.133.203:8080");
}

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

if I use" Blynk.begin(auth, wifi, ssid, pass);"

it comes

[19] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.2 on Arduino Uno

[603] Connecting to cht3584
[3683] 0018000902
[8844] 192.168.1.116
[8844] Connected to WiFi
[10183] Invalid auth token

if I use" Blynk.begin(auth, wifi, ssid, pass, “35.185.133.203:8080”);"

It comes

[19] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.2 on Arduino Uno

[603] Connecting to cht3584
[3683] 0018000902
[8844] 192.168.1.116
[8844] Connected to WiFi`

and it stock…broken

pls help me THX

PS
MY ENGLISH IS NOT GOOD…

Should be more like…

Blynk.begin(auth, wifi, ssid, pass, “35.185.133.203", 8080);

Note the comma seperated IP and port.

Or, if you are using a starter template for all your sketches, I use something like this

ESP8266 wifi(&EspSerial);

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
char blynkserver[] = "xxx.xxx.xxx.xxx";  // IP for your Local Server
int port = 8080;


void setup() {
  Blynk.begin(auth, wifi, ssid, pass, blynkserver, port);
}

PS, when posting code here, please properly format it as required…

Blynk - FTFC

it works!!!

Thank you so much!!

2 Likes