Cant connect arduino to cayenne newbi

hello

first of all i have to apologize for my bad english.i am from germany but i will do my best.
I have problems to connect my arduino uno board with a ethernet shield w5100 connected to my fritzbox.
i am getting the error “view does not name a type” i have already connected my raspberry to cyenne with no problems.
maby someone can help me.

greetings

udo

Can you post your sketch for us to review?

Agreed that the sketch will help a lot to confirm this, but it’s likely an issue with the directory structure of a non-Cayenne library being included somewhere. See this post from StackOverflow: Arduino error: does not name a type? - Stack Overflow

helle adam thanks for the fast answer. after several trials i have now a different error i will try to copy my sketch.

/*
Cayenne Ethernet Example

This sketch connects to the Cayenne server using an Arduino Ethernet Shield W5100
and runs the main communication loop.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

Steps:
1. Set the token variable to match the Arduino token from the Dashboard.
2. Compile and upload this sketch.

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.
*/

//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneEthernet.h>

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

void setup()
{
  Serial.begin(9600);
  Cayenne.begin(token);
}

void loop()
{
  Cayenne.run();
}void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

i hope thats what you need,
the error reads as followd:
exit status 1
redefinition of void setup

greetings
udo

This is because you have two setup() and loop() functions in your sketch, and there should only be one of each.

If you eliminate the bottom set the sketch should compile. Please note I’ve hidden your Cayenne token so no one reading the forum tries to add a device to your account:

/*
Cayenne Ethernet Example
This sketch connects to the Cayenne server using an Arduino Ethernet Shield W5100
and runs the main communication loop.
The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.
Steps:
1. Set the token variable to match the Arduino token from the Dashboard.
2. Compile and upload this sketch.
For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.
*/
//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneEthernet.h>
// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "yourtoken";
void setup()
{
  Serial.begin(9600);
  Cayenne.begin(token);
}
void loop()
{
  Cayenne.run();
}

Hello Adam

thank you very much. Now it is running perfekt. and thanks for hiding my cayenne token. I did not think of that.

you are the best!!

greetings

udo

2 Likes