Arduino Due+W5100 Connection fail

my device no longer connects, randomly manages to connect. why? what can i check?

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

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

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

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

in serial monitor i see :
[2] MAC: FE-32-85-FF-9C-81
[4668] IP: 192.168.0.7
[4668] Connecting to mqtt.mydevices.com:1883
[34923] MQTT connect failed, error -1
[66212] MQTT connect failed, error -1
[97404] MQTT connect failed, error -1
[128652] MQTT connect failed, error -1

the possibility is some network firewall is blocking traffic to mqtt.mydevices.com or port 1883.

in my router

Cattura

can you try adding a new device on your dashboard and get the new MQTT credentials.

done, seme result:
[2] MAC: FE-35-B9-20-5D-51
[6618] IP: 192.168.0.6
[6618] Connecting to mqtt.mydevices.com:1883
[36863] MQTT connect failed, error -1
[68109] MQTT connect failed, error -1
[99358] MQTT connect failed, error -1
[130566] MQTT connect failed, error -1
[161809] MQTT connect failed, error -1
[193016] MQTT connect failed, error -1

are there any other ways to connect?
how can I test if my ISP is blocking the connection to mqtt.mydevices.com:1883

via hyperterminal can I test the connection in any way?

you can try using MQTT.fx Cayenne Docs

also check that Preferred DNS server is set to 8.8.8.8

try changing the primary DNS to 8.8.8.8 or interchange both.

as soon as I reset the primary DNS to 8.8.8.8 the new device connected.

then either reprogrammed the arduino with the old program and I lost the connection again.

I reprogrammed the arduino with the new one that first communicated and now no longer connects

did you save the DNS setting? can you check again?

yes the settings are saved, i checked

is the issue same in the serial monitor?

[2] MAC: FE-33-D2-DB-C2-E4
[4655] IP: 192.168.0.10
[4655] Connecting to mqtt.mydevices.com:1883
[36904] Network connect failed
[68162] MQTT connect failed, error -1
[99439] MQTT connect failed, error -1
[130685] MQTT connect failed, error -1
[161933] MQTT connect failed, error -1
[193230] MQTT connect failed, error -1
[224478] MQTT connect failed, error -1
[255676] MQTT connect failed, error -1
[286928] MQTT connect failed, error -1
[318205] MQTT connect failed, error -1
[349462] MQTT connect failed, error -1
[380737] MQTT connect failed, error -1
[411988] MQTT connect failed, error -1
[443248] MQTT connect failed, error -1

can help you… log of mqtt.fx

are you using same client_id for same both arduino and MQTT fx

yes,
I created new devices and I replaced the access data on MQTT.fx

identical client ID, username and password

hold on. First of all terminate and close the MQTT.fx. next check whether the DNS server is 8.8.8.8. delete both device from dashboard. Now add new device on your dashboard and add this client id to the code and upload it to arduino.

Try installing telnet on one of your devices on the same LAN and see if you can connect with that.

telnet mqtt.mydevices.com 1883

You should see output like this if it worked:

pi@raspberrypi:~ $ telnet mqtt.mydevices.com 1883
Trying 52.203.155.126...
Connected to mqtt.mydevices.com.
Escape character is '^]'.
1 Like

no connection

You have a network issue somewhere. Could be your router, modem, ISP, or Cayenne. @shramik_salgaonkar are there any outages for mqtt right now?