ESP8266 auth token

Hi Guys.

Its probably a silly question, but where do you find the token for ESP8266 boards?

I keep getting this on the serial…

[184069] Connecting to arduino.mydevices.com:8442
[189566] Connecting to arduino.mydevices.com:8442
[190085] Invalid auth token

Here is my code if that is of any use…

#define CAYENNE_PRINT Serial
#include “CayenneDefines.h”
#include “CayenneWiFiClient.h”

char token = “38240c77190d2079525f072ae52f3d9f3f2c17f1”;
char ssid = “”;
char password = “”;

void setup()
{
Serial.begin(115200);
Cayenne.begin(token, ssid, password);
}

void loop()
{
Cayenne.run();
}
Thanks for any help in advance.

Benny

Hi @bennyrut,

You are sort of combining two different sketches. The string in the auth token is an auth token for MQTT sketch file, but it doesn’t look like your using MQTT.

I actually just created a video that explains how to use the new ESP8266 integration and MQTT, check it out.

Let me know if I can clarify anything for you.

~B

1 Like

nice work, thanks Benny. Its nice to be back, awesome to see the list of devices expanding!

Cheers

Benny

Another question mate…Where do you get a token from when a sketch asks for it?

When you go in and add a new device or bring your own thing, it supplies you with one on the dashboard.

Hi Vapor.

I must be doing something dumb…LOL. I’m always given the MQTT details, no token…

Hi @bennyrut, if you want to connect your ESP8266 via MQTT (“Bring Your Own Thing”), you don’t need an auth token, you just need to fill in the MQTT Username/Password/Client ID into this sketch code: Cayenne-MQTT-ESP/ESP8266.ino at master · myDevicesIoT/Cayenne-MQTT-ESP · GitHub

(For the sake of security, I would click ‘Remove’ on the pending device in your screenshot and generate a new one via Add New > Device/Widget > MicroControllers > Generic ESP8266 since this is a public forum and someone could use those credentials now that they’ve been posted online)