Arduino Due+W5100 Connection fail

@adam everything is working fine. the one issue i see is the DNS address which was solved in first case. now it seems to be some other issue.

1 Like

I contacted my ISP and now the 1883 communication port is open and some packets are also passing but the arduino still does not connect.
on my router I opened port 1883 in UDP and in TCP

try this code, setting the DNS to 8.8.8.8 and also to 192.168.1.1

I tried, but still does not connect

can you share the code with exact address values added?

no, I deleted everything to start over, I think it’s a problem with libraries

can you try again and send the code you are using? as it is not an issue with the library.

#define CAYENNE_DEBUG // Uncomment to show debug messages
#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();
}

CAYENNE_OUT_DEFAULT()
{
Cayenne.virtualWrite(0, millis());
}

CAYENNE_IN_DEFAULT()
{
CAYENNE_LOG(“Channel %u, value %s”, request.channel, getValue.asString());
}

but the library in the link in the picture is incorrect!


i have this error:
sketch_mar21a.ino:3:33: fatal error: CayenneMQTTEthernet.h: No such file or directory
compilation terminated.
Error during compilation

in the link library:

is loss Ethernet.h

i have this error:
In file included from sketch_mar21a.ino:3:0:
C:\Users\Lab\Documents\Arduino\libraries\Cayenne-MQTT-Arduino-master\src/CayenneMQTTEthernet.h:24:22: fatal error: Ethernet.h: No such file or directory
#include <Ethernet.h>
^
compilation terminated.

to make it work I have to copy the files of the castella / etherneth / SRC in the Cayenne-MQTT-Arduino-master folder
and add: #include <SPI.h>
but in the programming I have a warning:
CayenneMQTT\CayenneUtils\CayenneUtils.c.o: In function CayenneParseTopic': C:\Users\Lab\Documents\Arduino\libraries\Cayenne-MQTT-Arduino-master\src\CayenneUtils/CayenneUtils.c:429: warning: undefined reference to strncmp_P’

Lo sketch usa 48.960 byte (9%) dello spazio disponibile per i programmi. Il massimo è 524.288 byte.
Erase flash
Write 51328 bytes to flash

[ ] 0% (0/201 pages)
[= ] 4% (10/201 pages)
[== ] 9% (20/201 pages)
[==== ] 14% (30/201 pages)
[===== ] 19% (40/201 pages)
[======= ] 24% (50/201 pages)
[======== ] 29% (60/201 pages)
[========== ] 34% (70/201 pages)
[=========== ] 39% (80/201 pages)
[============= ] 44% (90/201 pages)
[============== ] 49% (100/201 pages)
[================ ] 54% (110/201 pages)
[================= ] 59% (120/201 pages)
[=================== ] 64% (130/201 pages)
[==================== ] 69% (140/201 pages)
[====================== ] 74% (150/201 pages)
[======================= ] 79% (160/201 pages)
[========================= ] 84% (170/201 pages)
[========================== ] 89% (180/201 pages)
[============================ ] 94% (190/201 pages)
[============================= ] 99% (200/201 pages)
[==============================] 100% (201/201 pages)
Verify 51328 bytes of flash

[ ] 0% (0/201 pages)
[= ] 4% (10/201 pages)
[== ] 9% (20/201 pages)
[==== ] 14% (30/201 pages)
[===== ] 19% (40/201 pages)
[======= ] 24% (50/201 pages)
[======== ] 29% (60/201 pages)
[========== ] 34% (70/201 pages)
[=========== ] 39% (80/201 pages)
[============= ] 44% (90/201 pages)
[============== ] 49% (100/201 pages)
[================ ] 54% (110/201 pages)
[================= ] 59% (120/201 pages)
[=================== ] 64% (130/201 pages)
[==================== ] 69% (140/201 pages)
[====================== ] 74% (150/201 pages)
[======================= ] 79% (160/201 pages)
[========================= ] 84% (170/201 pages)
[========================== ] 89% (180/201 pages)
[============================ ] 94% (190/201 pages)
[============================= ] 99% (200/201 pages)
[==============================] 100% (201/201 pages)
Verify successful
Set boot flash true
CPU reset.

but in the file: src CayenneUtils / CayenneUtils.c: 429: warning: undefined reference tostrncmp_P '

on line 429 I wouldn’t know what to correct

i’m waithing the W5200 shield.
I think it works differently, the libraries seem complete for the W5200

it is not about the ethernet shield. there are two points to be considered in you case:

  1. issue with your router i.e DNS server
  2. maybe be arduino Due. as you have to use the SPI library.

Did you try the manual code which i suggested above?

I did several tests with manual connection and various DNS, same result

can you share the manual code used with the address added.

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

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

// Mac address should be different for each device in your LAN
byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip(192, 168, 0, 20);
IPAddress dns_ip(8, 8, 8, 8);
IPAddress gateway_ip(192, 168, 1, 1);
IPAddress subnet_mask(255, 255, 255, 0);

void setup() {
  Serial.begin(9600);
  Cayenne.begin(username, password, clientID, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
}

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

CAYENNE_OUT_DEFAULT()
{
    Cayenne.virtualWrite(0, millis());
  }

CAYENNE_IN_DEFAULT()
{
  CAYENNE_LOG("Channel %u, value %s", request.channel, getValue.asString());
  
}

is your DHCP server enabled?
From the above image looks like no IP is address to the arduino.

Your gateway is in the 192.168.1.x network (looks correct from the screen shots) but you have your Arduino in the 192.168.0.x network which is most likely your problem. Also make sure if you have multiple Arduinos that they all have unique MAC addresses and IP addresses.

1 Like

the DHCP is active

did you changed what @adam suggested?