Arduino UNO with WiFi shield shows up in dashboard for a bit then disappears and never returns

I have an Arduino UNO with a WiFi shield that I can ping perfectly across my network.

It appears in my dashboard at first but then after a period or a reset of the UNO it is not reachable. Never seems to make contact again - been troubleshooting for ages and getting more and more frustrated.

This looks so cool - just want it to work!

Any ideas?

Using the basic uploaded sketch with a line graph and a button. Nothing fancy.

Thanks folks!

MJ

Tried everything I could think of again over the weekend.

If I totally start afresh by removing my board and re adding it with a new auth token then it appears again until a reset after which it never reconnects. Very odd!

Any clues?

Thanks all.

I have what appears to be a stable Uno + Internet Shield (5100) running a temp sensor for a few weeks - it has never disconnected and and it always reconnects after a reboot. But, I am experiencing exactly the behaviour you describe with an Arduino Yun. It connects maybe for 20 minutes and then disconnects. I have to remove device and re-add but it never remains connected for long and re-booting does not re-connect it.

That’s odd. I wonder if this is a bug related to the Android Ardruino beta relase?

Yes - as you say … exactly the same experience. Thanks for sharing your experience - at least I know it’s not just me!

I’ll try with a nano and a WiFi shield I guess - hope this one gets resolved though. Would be great to put some older hardware to use in a static place etc.

Not sure - nothing to do with Android for me though. This is on a PC running chrome. Or do you mean something in the Android beta may be having an impact on the dashboard etc.?

Actually, the common component between your experience and mine is the 5100 ethernet shield (although mine is Hanran clones). It’s worked perfectly prior to this though so I don’t believe it’s the shield.

Hi @mikejunor_cayenne

Would you mind posting the code you used? (probably negate the auth token). And also what does the serial monitor say? It’s the little magnifying glass icon thing in the top right corner of your Arduino IDE, in case you weren’t sure.

-B

Are you using the WiFi on the Arduino Yun?

No, just ethernet.

The ethernet shield which is working for me is also a generic model (not sure of the make - it says HanSun on the ethernet socket but I read that that is the brand of the socket, not the board!)

Think you could post what the serial monitor displays when Yun goes offline? It would be really helpful :slight_smile:

-B

Hi @bestes - no problem at all… I’m not phased with the auth token being there - there’s nothing private etc.

This is my current state - no apparent connection form Arduino to the dashboard…

I’ll go from the top again and see if I get the same behaviour again. One thing I did notice is that after I reset the Uno, the top message in amber in the dashboard (“Last known status: x days ago …”) disappears and then a few seconds later reappears - this seems to correlate with the serial monitor output going Connecting … Ready and then connecting again.

Current dashboard message

Current serial monitor output

[0] MAC: FE-D4-D9-6E-AE-DB
[0] Getting IP...
[2114] My IP: 192.168.0.100
[5001] Connecting to arduino.mydevices.com:8442
[6220] Ready (ping: 487ms).
[11694] Connecting to arduino.mydevices.com:8442

I’m getting a DNS resolution for arduino.mydevices.com of 54.86.250.218

Current code:
I think the only thing I added was to set pin 8 as an output - I was trying to get an LED connected to D8 to turn on and off with the button.

I have nothing connected to A0 - it’s just floating values that come through when it connects initially (before disconnecting and never reconnecting again)

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

void setup()
{
	Serial.begin(9600);
	Cayenne.begin(token);
	pinMode(8, OUTPUT);
}

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

Current Ping results:

Hi @mikejunor_cayenne,

This is great thank you. Can you please try to re-generate an auth token (as in create a new device and use that auth token), and then upload a new sketch file using the new token?

-B

1 Like

I’ll do that now…

1 Like

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

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

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

Received email to say install is complete

Dashboard with basic widget line graph on A0 (floating).

Should I leave it in that state?

Yep, hopefully should be good to go now.

In short, there is a bug where a ‘bad’ auth token causes the periodic disconnect. Work around is to use a newly generated auth token. We will be fixing this bug.

-B

Excellent - thanks for the assistance on this.

If you need any more troubleshooting/scenario testing please let me know.

Will do!

If you have an Android device, we’re looking for feedback :slight_smile:

1 Like

Grabbing the apk now … thanks!