Arduino Due+W5100 Connection fail

i use this :
byte arduino_mac = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip(192, 168, 1, 8);
IPAddress dns_ip(8, 8, 8, 8);
IPAddress gateway_ip(192, 168, 1, 1);
IPAddress subnet_mask(255, 255, 255, 0);

same result.

i try this:
byte arduino_mac = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress arduino_ip(192, 168, 1, 8);
IPAddress dns_ip(8, 8, 8, 8);
IPAddress gateway_ip(192, 168, 1, 1);
IPAddress subnet_mask(255, 255, 255, 0);
same result

i don’t see any difference in the two

tagging @jburhenn here.

can you run this code https://www.arduino.cc/en/Tutorial/DhcpAddressPrinter and see if your arduino is addressed an IP.

now i use W5500

i try this :
/*
Web client

This sketch connects to a website (http://www.google.com)
using an Arduino Wiznet Ethernet shield.

Circuit:

  • Ethernet shield attached to pins 10, 11, 12, 13

created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe, based on work by Adrian McEwen

*/

#include <SPI.h>
#include <Ethernet2.h>

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don’t want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
char server = “www.google.com”; // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println(“Failed to configure Ethernet using DHCP”);
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println(“connecting…”);

// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println(“connected”);
// Make a HTTP request:
client.println(“GET /search?q=arduino HTTP/1.1”);
client.println(“Host: www.google.com”);
client.println(“Connection: close”);
client.println();
}
else {
// kf you didn’t get a connection to the server:
Serial.println(“connection failed”);
}
}

void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}

// if the server’s disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println(“disconnecting.”);
client.stop();

// do nothing forevermore:
while (true);

}
}

and the pcs …

the arduino ip is :192.168.0.6 de:ad:be:ef:fe:ed

can you use the same IP address in the manual code and give it a try.

done, arduino is visible to router


but is not connected

You may need to change gateway_ip to 192.168.0.1. At least that’s what it looks like your router is using.

this is my router status

and new test with gateway 192.168.0.1

Well your WAN IP address on your modem is a class C network, which means you’re double NATed, which isn’t helping anything. Who is your ISP? Will they give you anything other than a class C IP?

Regardless of your WAN connection, I’d say forget the static IP address in your code and just go with DHCP. There’s really no reason for the static IP address.

I did not understand.
I have a wifi connection, I’m connected to the router (192.168.0.1) which is connected to the roof antenna that has ip: 192.168.1.1 but I don’t have access to it

I agree with Adam that switching back to the DHCP sketch instead of using a static IP makes sense if other computers connected to the router are able to connect to the internet.

Telnet failed from these other computers? If you run ping mqtt.mydevices.com does it show an IP address?


connection failed

How can I solve the problem? how could my ISP help me?

Did you run ping mqtt.mydevices.com? I don’t see it in the screenshot.

sorry

connection failed

There’s not much that we can do to help with a network configuration error like this. I would recommend reading about NAT and how routers/firewalls work and start there. Somewhere along the way your network traffic is getting dropped.

Yeah, seems like some network related issue. I just tried with Microsoft Telnet myself and it had no connection errors.

You could try telnet with a public broker, e.g. test.mosquitto.org 1883 just to see if that also fails, though my guess is it will. And I’d suggest disabling any firewall, including Windows Firewall, you are running on the telnet machine while testing just in case that is interfering.

no connection with test.mosquito.org

this is correct?

did you try connecting to mosquito broker using telnet?

telnet test.mosquitto.org 1883