Help Arduino Uno + W5100 Ethernet Shield Not connect

I’m using an 8-relay card. I can not use the Cayenne with the Arduino UNO and the w5100 Ethernet card.
during installation, the following errors are returned.

I n file included from C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src/CayenneMQTTEthernetClient I’m sorry.h:21:0,

 from C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src/CayenneMQTTEthernet.h:25,

 from C:\Users\YEE\Documents\Arduino\sketch_mar07c\sketch_mar07c.ino:14:

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src/CayenneArduinoMQTTClient I'm sorry.h: in member function 'void Cayenneardinomqtclient::connect()':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src/CayenneArduinoMQTTClient I'm sorry.h:58:63: warning: earthquake conversion from string constant to 'char' [-Wwrite-strings]

 if (!Networkconnect(&_network, CAYENNE_DOMAIN, CAYENNE_PORT))) {

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.C: in function 'Cayennemqtpublishdatainint':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.c:135:2: warning: implicit declaration of function 'itoa' [- Wimplicit-function-declaration]

 itoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.C: in function 'Cayennemqtpublishdatauint':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.C:158:2: warning: implicit declaration of function 'utoa' [- Wimplicit-function-declaration]

 utoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.C: in function 'Cayennemqtpublishdatalong':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.c:181:2: warning: implicit declaration of function 'ltoa' [- Wimplicit-function-declaration]

 ltoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.C: in function 'Cayennemqtpublishdataulong':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.c:204:2: warning: implicit declaration of function 'ultoa' [- Wimplicit-function-declaration]

 ultoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.C: in function'Cayennemqtpublishdatadouble':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneMQTTClient\CayenneMQTTClient I'm sorry.c:227:2: warning: implicit declaration of function 'dtostrf' [-Wimplicit-function-declaration]

 dtostrf(value, 5, 3, str);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.a: In function 'Cayennedataarrayaddin':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.c:87:2: warning: implicit declaration of function 'itoa' [- Wimplicit-function-declaration]

 itoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.C: in function 'Cayennedataarrayaddint':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.c:105:2: warning: implicit declaration of function 'utoa' [- Wimplicit-function-declaration]

 utoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.a: In function 'CayenneDataArrayAddLong':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.c:123:2: warning: implicit declaration of function 'ltoa' [- Wimplicit-function-declaration]

 ltoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.a: In function 'CayenneDataArrayAddULong':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.c:141:2: warning: implicit declaration of function 'ultoa' [- Wimplicit-function-declaration]

 ultoa(value, str, 10);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.a: In function 'CayenneDataArrayAddDouble':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneDataArray I'm sorry.c:159:2: warning: implicit declaration of function 'dtostrf' [-Wimplicit-function-declaration]

 dtostrf(value, 5, 3, str);

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.C: in function 'buildSuffix':

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.C:88:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = COMMAND_STRING;

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.c:91:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = DATA_STRING;

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.c:94:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = RESPONSE_STRING;

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.c:97:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = SYS_MODEL_STRING;

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.C:100:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = SYS_VERSION_STRING;

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.c:103:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = SYS_CPU_MODEL_STRING;

 ^

C:\Users\YEE\Documents\Arduino\libraries\CayenneMQTT\src\CayenneUtils\CayenneUtils I'm sorry.c:106:15: warning: assignment discs 'const' qualifier from pointer target type

 topicString = SYS_CPU_SPEED_STRING;

 ^

can you post the code you are using.

1 Like

#define CAYENNE_PRINT Serial
#include <CayenneMQTTEthernet.h>

char username = “-----------------------------------”;
char password = “----------------------------”;
char clientID = “------------------”;

#define VIRTUAL_CHANNEL 8
#define ACTUATOR_PIN 4
#define VIRTUAL_CHANNEL_1 9
#define ACTUATOR_PIN_1 5

void setup()
{
Serial.begin(9600);
pinMode(ACTUATOR_PIN , OUTPUT);
pinMode(ACTUATOR_PIN_1 , OUTPUT);
Cayenne.begin(username, password, clientID);

}

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

CAYENNE_IN(VIRTUAL_CHANNEL)
{
int value = getValue.asInt();
digitalWrite(ACTUATOR_PIN , value);
}
CAYENNE_IN(VIRTUAL_CHANNEL_1)
{
int value_1 = getValue.asInt();
digitalWrite(ACTUATOR_PIN_1 , value_1);
}

I’ve solved the mistake. Thank you

1 Like

Hi @adem_yildiz,
Glad to hear you solved it.

Can you let us know what you did to solve it? It’ll be helpful for other who might get into the same situation.

Thanks.
-Jesse

/*
Cayenne Relay Switch Example

YILDIZ ELEKTRİK RÖLE OTOMASYON KODU
*/

#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneMQTTEthernet.h>

// Cayenne authentication info. BAĞLANTI AYARLARI

char username[] = "------------------------------------";
char password[] = "------------------------------";
char clientID[] = "----------------------";

#define VIRTUAL_CHANNEL1 1
#define ACTUATOR_PIN2 2  // 0 ve 1. pinleri kullanma

#define VIRTUAL_CHANNEL2 2
#define ACTUATOR_PIN3 3

#define VIRTUAL_CHANNEL3 3
#define ACTUATOR_PIN4 4

// DİGİTAL PİN TANIMLAMA İÇİN SIRASIYLA ACTUATOR PİN YAZ.
void setup()
{
  Serial.begin(9600);
  pinMode(ACTUATOR_PIN2, OUTPUT);
  pinMode(ACTUATOR_PIN3, OUTPUT);
  pinMode(ACTUATOR_PIN4, OUTPUT);
  Cayenne.begin(username, password, clientID);
}

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

// BİRİNCİ SANAL KANAL + DİGİTAL BAĞLANTISI
CAYENNE_IN(VIRTUAL_CHANNEL1)
{
	// RÖLE ANAHTARINI AÇMAK KAPATMAK İÇİN. BU KOD RÖLEYİ AÇIK OLARAK KABUL EDER.
	if (getValue.asInt() == 0) {
		digitalWrite(ACTUATOR_PIN2, HIGH);
	}
	else {
		digitalWrite(ACTUATOR_PIN2, LOW);
}
}

// İKİNCİ SANAL KANAL + DİGİTAL BAĞLANTISI
CAYENNE_IN(VIRTUAL_CHANNEL2)
{
  // RÖLE ANAHTARINI AÇMAK KAPATMAK İÇİN. BU KOD RÖLEYİ AÇIK OLARAK KABUL EDER.
  if (getValue.asInt() == 0) {
    digitalWrite(ACTUATOR_PIN3, HIGH);
  }
  else {
    digitalWrite(ACTUATOR_PIN3, LOW);

	}
}

// ÜÇÜNCÜ SANAL KANAL + DİGİTAL BAĞLANTISI
CAYENNE_IN(VIRTUAL_CHANNEL3)
{
  // RÖLE ANAHTARINI AÇMAK KAPATMAK İÇİN. BU KOD RÖLEYİ AÇIK OLARAK KABUL EDER.
  if (getValue.asInt() == 0) {
    digitalWrite(ACTUATOR_PIN4, HIGH);
  }
  else {
    digitalWrite(ACTUATOR_PIN4, LOW);

  }
}
2 Likes

I couldn’t get the relay switched off. it stays open every time it opens.

example

CAYENNE_IN(VIRTUAL_CHANNEL3)
{
int value = getValue.asInt(0);
CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL3, ACTUATOR_PIN4, value);
// Write the value received to the digital pin.
digitalWrite(ACTUATOR_PIN4, value);
}