Cayenne Librady Compile Problem [solved: update Ethernet library]

Hello

I am trying to install Cayenne on my arduino with my w5100 Ethernet Shield
The problem is that i can’t compile the code from the example
Can anybody help me?

The Error is:

Arduino: 1.6.9 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp: In member function ‘void EthernetClass::begin(uint8_t*, IPAddress, IPAddress, IPAddress, IPAddress)’:

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:65:39: error: no matching function for call to ‘W5100Class::setIPAddress(IPAddress::&)’

W5100.setIPAddress(local_ip._address);

                                   ^

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:65:39: note: candidate is:

In file included from C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:1:0:

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\utility/w5100.h:392:6: note: void W5100Class::setIPAddress(uint8_t*)

void W5100Class::setIPAddress(uint8_t *_addr) {

  ^

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\utility/w5100.h:392:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:66:38: error: no matching function for call to ‘W5100Class::setGatewayIp(IPAddress::&)’

W5100.setGatewayIp(gateway._address);

                                  ^

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:66:38: note: candidate is:

In file included from C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:1:0:

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\utility/w5100.h:368:6: note: void W5100Class::setGatewayIp(uint8_t*)

void W5100Class::setGatewayIp(uint8_t *_addr) {

  ^

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\utility/w5100.h:368:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:67:38: error: no matching function for call to ‘W5100Class::setSubnetMask(IPAddress::&)’

W5100.setSubnetMask(subnet._address);

                                  ^

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:67:38: note: candidate is:

In file included from C:\Users\Dell\Documents\Arduino\libraries\Ethernet\Ethernet.cpp:1:0:

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\utility/w5100.h:376:6: note: void W5100Class::setSubnetMask(uint8_t*)

void W5100Class::setSubnetMask(uint8_t *_addr) {

  ^

C:\Users\Dell\Documents\Arduino\libraries\Ethernet\utility/w5100.h:376:6: note: no known conversion for argument 1 from ‘IPAddress::’ to ‘uint8_t* {aka unsigned char*}’

Multiple libraries were found for “Ethernet.h”
Used: C:\Users\Dell\Documents\Arduino\libraries\Ethernet
Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Hey @bill.lask,

Welcome to the Cayenne community! Would you mind post the code that you used?

-B

Yes i forgot
I use this code with AuthenticationToken

/*
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[] = "AuthenticationToken";

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

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

There might be some issues with your ethernet library. Looks like you have an error with this line: W5100.setIPAddress(local_ip._address); In my library that line looks like this: W5100.setIPAddress(local_ip.raw_address());

I’m using the Ethernet Library 1.1.2. Is your ethernet library up to date?

-B

I download the cyaenne library today :confused:

The ethernet library is inside the cayenne library correct?

It’s a separate library that is specific to the shield you are using. Although actually now that I think about it Arduino IDE might come with the Ethernet library already installed. Anyway, you can check if it’s installed, see image below:

1 Like

You are correct finnaly it works
thanksss

Great to hear!

-B

amigos me pueden ayudar tengo estos errores al cargar un ejemplo: