[SOLVED] Particle CLI trouble with "Ethernet" not in scope

[Start]: I am using the Particle CLI to compile code from the command line.
particle compile photon --target 3.1.0

[Problem]: However, I am getting an error where Ethernet is not recognized and it is blocking compilation.

Compile Error

[Repeatable?]: This error does not occur when I compile using the Particle Workbench extension in VS Code.

[Code]: Here is the code file I am compiling with Particle CLI

#define CLOUD_CHECK_MS 5000

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(AUTOMATIC);

SerialLogHandler logHandler(LOG_LEVEL_WARN, {{"app", LOG_LEVEL_INFO}});

long now = 0;
long lastCloudCheck = 0;

void setup() {
  System.enableFeature(FEATURE_ETHERNET_DETECTION);
}

void loop() {
  now = millis();
  if(now - lastCloudCheck > CLOUD_CHECK_MS){
    lastCloudCheck = now;
    if (WiFi.ready() || Ethernet.ready()) {
      Log.info("Internet OK");
    }
  }
}

image
This might be the reason :wink:
There is no stock support for Ethernet on the Photon.

However, in the topic tags you have selected Argon (which would support Ethernet)
image

Which is it?

3 Likes

Oh my goodness. The Shame…

I’m using an Argon

particle compile argon --target 3.1.0
works without errors

Thank you @ScruffR

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.