# Particle Ethernet Featherwing (with Xenon)

**URL:** <https://community.particle.io/t/particle-ethernet-featherwing-with-xenon/64167>\
**Category:** Hardware\
**Tags:** xenon\
**Created:** [March 13, 2023, 2:35pm UTC](https://community.particle.io/t/particle-ethernet-featherwing-with-xenon/64167 "2023-03-13T14:35:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjdeprisco](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jjdeprisco/32/28280_2.png) [@jjdeprisco](https://community.particle.io/u/jjdeprisco)\
**Post date:** [March 13, 2023, 2:35pm UTC](https://community.particle.io/t/particle-ethernet-featherwing-with-xenon/64167/1 "2023-03-13T14:35:54Z")

</div>

I’m using a Xenon (OS 1.5.2) with a Particle Ethernet FeatherWing. I’ve got the Xenon’s Ethernet capability turned on via the Particle mobile app, and the Xenon is recognized by [Particle.io](http://Particle.io) (logged on via my mesh network via an Argon). Ethernet is plugged in on the Particle Ethernet FeatherWing - getting blink light - and ready to test.

I’m using the sample application sketch provided by Particle here:

> **[Pin configuration - Ethernet - Ethernet | Reference](https://docs.particle.io/reference/device-os/api/ethernet/pin-configuration-ethernet/)**
>
> Reference manual for the C++ API used by user firmware running on Particle IoT devices

```auto
// SAMPLE APPLICATION
#include "Particle.h"
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);
Serial1LogHandler log1Handler(115200, LOG_LEVEL_ALL);

retained uint8_t resetRetry = 0;

void setup() {
#if HAL_PLATFORM_WIFI && !HAL_PLATFORM_WIFI_SCAN_ONLY
    // To force Ethernet only, clear Wi-Fi credentials
    Log.info("Clear Wi-Fi credentionals...");
    WiFi.clearCredentials();
#endif // HAL_PLATFORM_WIFI && !HAL_PLATFORM_WIFI_SCAN_ONLY

    // Disable Listening Mode if not required
    if (System.featureEnabled(FEATURE_DISABLE_LISTENING_MODE)) {
        Log.info("FEATURE_DISABLE_LISTENING_MODE enabled");
    } else {
        Log.info("Disabling Listening Mode...");
        System.enableFeature(FEATURE_DISABLE_LISTENING_MODE);
    }

    Log.info("Checking if Ethernet is on...");
    if (Ethernet.isOn()) {
        Log.info("Ethernet is on");
        uint8_t macAddrBuf[8] = {};
        uint8_t* macAddr = Ethernet.macAddress(macAddrBuf);
        if (macAddr != nullptr) {
            Log.info("Ethernet MAC: %02x %02x %02x %02x %02x %02x",
                    macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4], macAddr[5]);
        }
        Ethernet.connect();
        waitFor(Ethernet.ready, 30000);
        Log.info("Ethernet.ready: %d", Ethernet.ready());
        resetRetry = 0;
    } else if (++resetRetry <= 3) {
        Log.info("Ethernet is off or not detected, attmpting to remap pins: %d/3", resetRetry);

        if_wiznet_pin_remap remap = {};
        remap.base.type = IF_WIZNET_DRIVER_SPECIFIC_PIN_REMAP;

        remap.cs_pin = D10;
        remap.reset_pin = D6;
        remap.int_pin = D7;

        auto ret = if_request(nullptr, IF_REQ_DRIVER_SPECIFIC, &remap, sizeof(remap), nullptr);
        if (ret != SYSTEM_ERROR_NONE) {
            Log.error("Ethernet GPIO config error: %d", ret);
        } else {
            if (System.featureEnabled(FEATURE_ETHERNET_DETECTION)) {
                Log.info("FEATURE_ETHERNET_DETECTION enabled");
            } else {
                Log.info("Enabling Ethernet...");
                System.enableFeature(FEATURE_ETHERNET_DETECTION);
            }
            delay(500);
            System.reset();
        }
    }

    Particle.connect();
}

void loop() {
    static system_tick_t lastPublish = millis();
    static int count = 0;
    static bool reconnect = false;

    if (Particle.connected()) {
        reconnect = false;
        if (millis() - lastPublish >= 10000UL) {
            Particle.publish("mytest", String(++count), PRIVATE, WITH_ACK);
            lastPublish = millis();
        }
    }

    // Detect a network dropout and reconnect quickly
    if (!reconnect && !Ethernet.ready()) {
        Log.info("Particle disconnect...");
        Particle.disconnect();
        waitFor(Particle.disconnected, 5000);
        Log.info("Network disconnect...");
        Network.disconnect();
        Particle.connect();
        reconnect = true;
    }
}

```

When I compile this, I get several errors:

![ethererrors](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/7/2/72f4d380255c89a3fcd5a6b5bd785d67260f1d45.png)

Anyone have any thoughts on where to start with troubleshooting? Issues seem to be in the code provided. Just trying to get a positive test that the Particle Ethernet FeatherWing works.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [March 13, 2023, 2:48pm UTC](https://community.particle.io/t/particle-ethernet-featherwing-with-xenon/64167/2 "2023-03-13T14:48:15Z")

</div>

That code will only work with Device OS 3.3.0 and later, which have `FEATURE_DISABLE_LISTENING_MODE` and pin remapping. Neither of those features are implemented in 1.5.x.

Since you’ve enabled Ethernet support, you shouldn’t need any of the extra code.

---

<div class="post-metadata">

**Author:** ![jjdeprisco](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jjdeprisco/32/28280_2.png) [@jjdeprisco](https://community.particle.io/u/jjdeprisco)\
**Post date:** [March 17, 2023, 2:06pm UTC](https://community.particle.io/t/particle-ethernet-featherwing-with-xenon/64167/3 "2023-03-17T14:06:12Z")

</div>

OK, thanks. Will look into this further.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/6/4/64635adccc35238caa19e9b553ec3e98b163d026.png) [@system](https://community.particle.io/u/system)\
**Post date:** [September 16, 2023, 2:06am UTC](https://community.particle.io/t/particle-ethernet-featherwing-with-xenon/64167/4 "2023-09-16T02:06:39Z")

</div>

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