Buongiorno blink

Buongiorno a casa ho fatto un server casalingo per connettere Blink durante la connessione la scheda esp 8266 si connette alla wifi di casa ma quando.arriva a connettersi all ip del server mi dice invalid auth token da cosa può dipendere?grazie mille

Hello,

Maybe wrong auth token in sketch

Please post you sketch and logs in serial monitor of Arduino IDE

You use in sketch AuthToken from your device info tab?

authtoken

If you’re using Legacy local server then you need to create an account on your local server and log in to that account via the Legacy app.
You then need to create a project and choose a board type, and that will give you an Auth token which relates to your local server.
Once you’ve done this you can use that Auth token in your sketch, along with the IP address and port being used by your local server.

Pete.


Questo è lo sketch

Please don’t post screenshots of code or serial output.

Copy the text and paste it into your post with triple backticks at the beginning and end.

Triple backticks look like this:
```

Pete.

Praticamente nel monitor seriale viene scritto che l esp 8266 si connette alla wifi di casa ma quando deve connettersi all ip del server locale viene scritto:
Connecting to…
Invalid auth token
E questo viene scritto continuamente ogni volta che la scheda prova a connettersi al server

Can’t help if you won’t share your sketch and actual serial output.

Sharing info about your project setup in the legacy app and in the admin screen of your local server would also help. Screenshots (but not photographs of your monitor) are fine for this.

Pete.

Screenshot fatto direttamente dal PC?

For the server admin screen then yes.

Pete.

Anche per lo sketch e il monitor seriale?

If you want to post serial data then copy the text and paste it between triple backticks.

Pete.

[Sketch screenshot removed by moderator]

[Serial monitor screenshot removed by moderator]

You should post a text not a picture.
Post your sketch and don’t forget to add a triple backticks ``` before and after your whole sketch.


#define BLYNK_PRINT Serial
#include <BlynkSimpleEsp8266.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";                    //nome rete wifi
char pass[] = "";                    //password rete wifi

int led = 1;

BLYNK_WRITE(V0)
{
  led  = param.asInt(); // assigning incoming value from pin V0 to a variable
  if (led == 0) {
    digitalWrite(LED_BUILTIN,HIGH );//  spegne il LED
  }
  else if (led == 1) {
    digitalWrite(LED_BUILTIN, LOW); // accende il LED

  }
}

void setup()
{
  // Debug console
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass, IPAddress(xxx,xxx,x,xx), 8080);     //inserite l'ip pubblico del vostro server
  pinMode(LED_BUILTIN, OUTPUT);
}

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

@Cristiano 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:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

You should add the

#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
#define BLYNK_DEVICE_NAME           "Device"
#define BLYNK_AUTH_TOKEN            "YourAuthToken"

At the top of your sketch. Go to the console/devices/device info tab to get your template ID, device name, and auth token.

The data type of the variable should be specified.

int led  = param.asInt();

There’s no need to specify a server, you can simply use

Blynk.begin(auth, ssid, pass);

Instead.

BLYNK_TEMPLATE_ID “TMPLxxxxxx”
#define BLYNK_DEVICE_NAME “Device”
#define BLYNK_AUTH_TOKEN "YourAuthToken

Ma questa dichiarazione devo farla con la nuova blynk.iot o devo farla anche con la vecchia versione?

The old Blynk (legacy) has been retired. It’s not available anymore.