LinkNode D1 Setup

I am trying to setup another LinkNode D1 but am unable to find where the authorization token is hiding on my dashboard when I attempt to add a new microcontroller.

This is the code I am using with my existing, working controller:

#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
#define R1 D5
#define R2 D2

// Your network name and password.
char ssid[] = "xxx";
char password[] = "xxx";

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "xxxxxxxxxx";

void setup()
{
  pinMode(R1, OUTPUT);
  pinMode(R2, OUTPUT);
  digitalWrite(R1, HIGH);
  digitalWrite(R2, HIGH);
    
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
}

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

CAYENNE_IN(V1)
{
  CAYENNE_LOG("Got a value: %s", getValue.asStr());
  int i = getValue.asInt();
  
  if (i == 0)
  {
    digitalWrite(R1, HIGH);
  }
  else
  {
    digitalWrite(R1, LOW);
  }  
}  
CAYENNE_IN(V2)
{
  CAYENNE_LOG("Got a value: %s", getValue.asStr());
  int i = getValue.asInt();
  
  if (i == 0)
  {
    digitalWrite(R2, HIGH);
  }
  else
  {
    digitalWrite(R2, LOW);
  }  
}

you are using old cayenne library. Follow this tutorial Adding a New Device using MQTT

1 Like