Arduino Stays Offline

I am using an Arduino Genuino Uno and the Ethernet Shield for Arduino - W5500 Chipset. I have everything set up correctly, but the Cayenne dashboard keeps saying “Last known status: 13 minutes ago ago (Jan 23, 2017, 9:26 am)”. I have notice that my last known status is when I refresh the page, which makes me think that either it connects when I refresh the page but never again or the dashboard is wrong. I can sometimes hook up sensors, but they won’t show any input, even after I confirmed that the coding and wiring is correct… I have been looking through the forums but none of them help.

My serial moniter shows the same thing over and over.
[0] MAC: FE-9A-A1-9E-9D-96
[0] Getting IP…
[2264] My IP: [instert my ip here]
[5001] Connecting to arduino.mydevices.com:8442
[5309] Ready (ping: 233ms).
[41318] Heartbeat timeout
[46317] Connecting to arduino.mydevices.com:8442
[46681] Ready (ping: 288ms).
[72689] Heartbeat timeout
(and then it repeats saying connecting to arduino, ready, and then heartbeat timeout)

Hi @bpelson, welcome to the Cayenne Community.

Can you share the sketch you’re using to connect so we can see if there are any hints there? Feel free to x out your Cayenne token.

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

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token = “______”;

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

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

Thanks, not sure if this was lost in the pasting of the sketch or if it could be the issue, but I’d expect

#include <CayenneEthernetW5500.h>

to be present at the top of the sketch if you’re connecting with the W5500 shield.

Yeah it just got lost in the copy and paste. Sorry.
Here’s the code

//#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneEthernetW5500.h< (in the code its pointing the correct way but this website doesn’t let me)

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token = “____________”;

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

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

No worries. If you want to paste code without losing formatting on this forum, you can highlight it and click the ‘preformatted text’ option in the toolbar. It’s the one that looks like this: </>

Anyway, as for the heartbeat timeout, in the past we’ve seen this resolved by generating a new auth token for the device. To do this:

  1. Delete the device from your account by selecting it from the left sidebar, then the Settings Gear > Configure > Remove Device > Confirm

  2. Re-add the Arduino device from Add New > Device/Widget > Microcontrollers, and make sure to use the new auth token you get from this page in the sketch that you upload to your Uno.

The sketch you shared looks otherwise fine, so you can just swap out the auth token for it.

I removed my arduino like you said, and re-added it. Now, when I open my serial moniter in the code, it acts like it is working,
[0] MAC: FE-61-DE-DC-64-AC
[0] Getting IP…
[2264] My IP: _____________
[5001] Connecting to arduino.mydevices.com:8442
[10078] Connecting to arduino.mydevices.com:8442
[10172] Ready (ping: 21ms).
However, when I go to the Cayenne dashboard, I still get the offline error message at the top of the page “Last known status: 3 minutes ago (Jan 26, 2017, 9:48 am)”.

Can I ask, now that some hours have passed, is this intermittent or has it still been offline since 9:48 AM? It may also be worth clearing the cache in your web browser or trying a different browser to see if you get the same messaging.

Beyond that, it sounds like a network issue. I’d ask you to check that port 8442 is open on your network but if it made a connection even occasionally, it sounds like it is.

Thank you so much for your help! It’s working now.

2 Likes

Glad to hear it! I was starting to run out of ideas :slight_smile: