B402 Eval Kit Via Ethernet: Losing Cloud Connection (but remains breathing cyan)

Hi all!

Today I got my B402 Evaluation kit connected to Particle Cloud via Ethernet using the Android App.

Everything is apparently working 100% as I can ping/signal and call custom events just fine. I can also build and flash firmware OTA using Particle Build.

I am however seeing repeatable dropouts (100% of the time) if I don’t call anything on the device over a period of 3-5 minutes. The RGB led remains breathing cyan but the device will not respond to pings/functions. Power cycling will fix this temporarily.

I stripped code down to the following and am still seeing the same issue. This has been both compiled for target Boron 1.4.4 , and flashed, using the Particle Build online IDE.

image

Would love some assistance, as this is a real annoyance for development!

Regards,
Alex

Hi Alex,

Quite a few changes to the Ethernet functions have been implemented in DeviceOS 1.5.0-rc.1/2 - can you compile to these versions and check again?

I tried last night but have awoken to an SOS state which I’m trying to recover from now…

The B402 even over Ethernet uses UDP to communicate with the Particle cloud. It sends a packet to the Particle cloud servers, which causes your network router to create a temporary port mapping back to the device. Since these are a finite resource your router will eventually discard the back-channel to the device, which breaks the cloud connectivity, but the device cannot tell that the back-channel is gone until it sends data again, which by default happens every 23 minutes.

The solution is to adjust the keep-alive for your network. Add this to setup to have a packet sent to the cloud every 2 minutes to make sure your router does not discard the port-forwarded back-channel when using Ethernet.

Particle.keepAlive(120);
2 Likes

Thank you Rikkas, as soon as I get the module working again I will test this and report back

1 Like

@no1089

After firmware update I get SOS (1 blink between) every time I enable ETHERNET.
I will have to attempt to revert as I’ve spent 3 hours troubleshooting this so far to no avail.

The latest sketch I have been flashing to test is attached at the bottom of this reply.

EDIT: Reverting to 1.4.4 fixed SOS issue, so it seems to me that 1.5.0-r.c.2 perhaps has an issue with ethernet

#include "Particle.h"

SYSTEM_MODE(MANUAL);

// ENABLING FEATURE_ETHERNET_DETECTION CAUSES SOS, DISABLING FIXES
// STARTUP(System.enableFeature(FEATURE_ETHERNET_DETECTION));  // < this causes SOS
STARTUP(System.disableFeature(FEATURE_ETHERNET_DETECTION));    // < this works

boolean connectToCloud = false;

void setup() {
    Serial.begin();
    delay(5000);
    Serial.println("setup()");
}

void loop() {
    delay(1000);
    
    Serial.println("loop()");
    Particle.process();
    delay(1000);
    
    Particle.process();
    
    if(connectToCloud && Particle.connected() == false) {
        Serial.println("attempt connect");
        Particle.connect();
        connectToCloud = false;
    } else {
        Serial.println("connected");
    }
    
    Serial.println("end loop()");
    
}

I might be conflating issues here, but what you are seeing in 1.5.0-rc.2 sounds reminiscent of this PR:https://github.com/particle-iot/device-os/pull/2057 - although that is for the B5SOM.

It does sound like the outcomes are the same in terms of SOS, though I don’t have the time to check out potential fixes at this stage.

This has been merged and should be released today with DeviceOS 1.5, so keep an eye out and test once it is out if you can.

– Edit –
DeviceOS 1.5 has been released. Please try it and report back :smiley:

@no1089 So I have just tried and confirmed working ethernet on 1.5 now.

The only issue at this stage however is that I’ve been forced to rerun the Particle Set-Up (via Android app) in order to get it to work. Disabling and enabling ethernet programmatically has only worked AFTER initially configuring the bsom via the app.

Is this a known issue or something I’m missing?