Arduino due & w5100 shield

#1

Hi all,
I just installed the CayenneMQTTEthernet.h library and added ethernet.h which was missing inside.
I copied this on arduino:

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

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "xxx";
char password[] = "xxx";
char clientID[] = "xxx";

void setup() {
  Serial.begin(9600);
  Cayenne.begin(username, password, clientID);
}

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

// Default function for sending sensor data at intervals to Cayenne.
// You can also use functions for specific channels, e.g CAYENNE_OUT(1) for sending channel 1 data.
CAYENNE_OUT_DEFAULT()
{
  // Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
  Cayenne.virtualWrite(0, millis());
  // Some examples of other functions you can use to send data.
  //Cayenne.celsiusWrite(1, 22.0);
  //Cayenne.luxWrite(2, 700);
  //Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);
}

// Default function for processing actuator commands from the Cayenne Dashboard.
// You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_IN_DEFAULT()
{
  CAYENNE_LOG("Channel %u, value %s", request.channel, getValue.asString());
  //Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");
}

but can’t connect.
on serial monitor I display: [2

what am I doing wrong ?

0 Likes

#2

add #define CAYENNE_DEBUG in your code and share the output here.

0 Likes

#3

added #define CAYENNE_DEBUG
in serial monitor i can see only : [

0 Likes

#4

I added print serials like this:

void setup() {
Serial.begin(9600);
Serial.print(“1”);
Cayenne.begin(username, password, clientID);
Serial.print(“2”);
}

void loop() {
Serial.print(“3”);
Cayenne.loop();
Serial.print(“4”);
}

I only see: 1

Cayenne.begin(username, password, clientID); is blocked

0 Likes

#5

i’m using Arduino 1.6.5
Arduino AVR Board by Arduino version1.6.22
Arduino SAM Boards(32-bits ARM Cortex-M3) verision 1.6.4

0 Likes

#6

RESOLVED
I updated the ethernrt.h library to version 1.1.1 and moved all the libreia files into the CayenneMQTT / scr folder
and added #include <SPI.h>

2 Likes

#7

awesome work and thanks for finding the solution. it will help users with the same issue in future.

0 Likes