Argons go online offline online the whole day

Goodday

I have 3 Argons each with 2 Xenons installed on 3 different WiFi routers in 3 different locations. They seem to be going online and offline every few minutes. I only see it in the events tab. On the Argons themself the Cyan LED is breathing, so no indication that it’s offline

running v1.4.2
Is this normal?

This is not normal but there are plenty of possible reasons for this that are not related to the Argon as such

just to name a few

  • your code might be blocking
  • your WiFi APs may have a too short lease period
  • your WiFi APs may not have enough free DHCP IP Addresses
  • radio noise

If all three devices are running the same code, my top candidate would be the first

1 Like

I have seen this happening with a Xenon in an ethernet featherwing - so maybe we could rule out all but the first.

It is strange that with different code the offline to online time is always 30 seconds exactly!

I saw this once earlier this afternoon and not since - I have seen it before.

By blocking I guess you mean the loop() cadence is effectively 0 and Particle.process() has not been called? Is it possible that the better connectivity symbol update is a contributor?

They are all running the same code. Its not complicated code, simple BLE client. I do have the Ubidot and Blynk Libs installed. I think I will uninstall those first and see what happens.

I have done the following to try and get to the bottom of this. I changed all my delays to soft delays where Particle.process() is called. I genuinely thought that would resolve this and yet again this morning all of them are doing the same thing.

I then took a brand new Argon (out the box) upgraded it to 1.4.2 and loaded tinker via CLI.

This argon is running no code and it seems to be doing the same thing. Any ideas?

I have also observed the xenons loose connectivity to the Argons, should I fall back to 1.4.1 (or earlier)

thanks in advance

My Argon also does this all the time. It runs DeviceOS 1.4.2 and nothing but the default blink-sketch form the web-IDE (because it only has to act as a gateway).
But I didn’t have any issues reaching the connected devices, so I don’t know if it’s really offline or just timing out something :thinking:.

If the network has a UDP timeout is at 30 seconds it would be closing the connection.

Try adding Particle.keepAlive(20); to your setup.

Thanks! Adding this statement to setup() solved my Argon (1.4.2) offline/online issue I was having every 10 minutes. At first, I tried 9 minutes. But, found the device went offline after about 1.25 minutes following reset. Next, tried Particle.keepAlive(1 * 60) but then found device would go offline every 30 seconds. So, in the end, Particle.keepAlive(20) solved it.

Using SYSTEM_MODE(AUTOMATIC) & no system thread.

Thanks Amillen

Solved my problem as well

Hello All,

I am having the same issue as described above. I wanted some clarification on how this issue was solved. My device shows offline every 1min 20 seconds despite the light on the argon indicating online.

Do I add the line Particle.keepAlive() to any code I have that has a setup function on it? I tried that but my particle goes offline before the flash finishes.

I did a local flash with the Particle.keepAlive() in some simple code but my device continues to go offline after a min and 20 seconds.

Am I placing this line in the wrong spot? Or is my issue possibly different?

SYSTEM_MODE(AUTOMATIC);

int led2 = D7; 
//SerialLogHandler logHandler;

void setup() {
  Serial.begin(9600);
  Particle.keepAlive(20);
  pinMode(led2, OUTPUT);
}

void loop() {
  digitalWrite(led2, HIGH);
  delay(1000);
  digitalWrite(led2, LOW);
  delay(1000);
}

Hi There

Have you added

SYSTEM_MODE(AUTOMATIC)

void setup() {
  
  SYSTEM_MODE(AUTOMATIC);
  Particle.keepAlive(20);
  Serial.begin(115200);

SYSTEM_MODE() has no business inside setup().
In OP’s code it’s the first line - that’s where it should be.
However, as it is the default mode it’s not required anyhow.

But we are missing the info which device OS version is running on the device.
It would also be good to re-incorporate the (commented) SerialLogHandler and provide the resulting log :wink:

Hello @melt777

I have SYSTEM_MODE(AUTOMATIC) outside of the setup() call. I have placed it immediately before as I was informed that is okay by my peers.

I attempted to run the code with SYSTEM_MODE(AUTOMATIC) inside the loop to no effect. Do I need to be able to cloud compile and cloud flash this code? Or do I only need to local compile and flash via USB?

Hello @ScruffR

In regards to devise OS I am running 2.0.1 on the Particle Argon

In regards to SerialLogHandler I am sad to admit I could not figure out where the output was displayed when using Log.info() so I could not get helpful debugging. I am using Particle Workbench in VSCode

So sorry for the basic misunderstandings. This is my first time using this kind of hardware. I really appreciate all the help!

You can use any serial terminal program (e.g. PuTTY) or CLI particle serial monitor --follow to get the USB Serial output of the system and your own application.

2 Likes

Thank you, that solved my problem!

1 Like