Ethernet Detection

Could someone explain how to detect from an application on a Xenon whether the device is Ethernet LAN connected and therefore a gateway device?

What does this do?
System.enableFeature(FEATURE_ETHERNET_DETECTION);

The Ethernet FeatherWing uses SPI, as well as D3, D4, and D5. In order to probe for the presence of the Wiznet W5500 on SPI, D4 and D5 need to be set to output and toggled.

This would obviously be bad if you had other, non-Ethernet hardware connected to those GPIO pins. The default defaults to disabled and the detection is not done and those pins are not touched.

If you use that enableFeature command, or check the Use with Ethernet checkbox during mobile app setup, the feature flag is enabled in configuration flash and the Ethernet will be probed for at startup until you turn it off.

The Ethernet FeatherWing uses SPI, as well as D3, D4, and D5. In order to probe for the presence of the Wiznet W5500 on SPI, D4 and D5 need to be set to output and toggled.

This would obviously be bad if you had other, non-Ethernet hardware connected to those GPIO pins.

I must be having an off-day - I understood about the use of the SPI and D4 and D5 pins.

I appreciate you have answered what System.enableFeature(FEATURE_ETHERNET_DETECTION); does. I am still unclear how an application can ‘probe’ for Ethernet use other than testing for Ethernet.ready(), is that it?

The sample code for determining whether Ethernet is present and up can be found here:

Thanks, solution is to test

if (System.enableFeature(FEATURE_ETHERNET_DETECTION))

It should be:

if (System.featureEnabled(FEATURE_ETHERNET_DETECTION)) 
1 Like

Apologies cut’n’paste error

so, once the configuration has been set either through the setup app or the code,
(System.featureEnabled(FEATURE_ETHERNET_DETECTION))
and one no longer wants to use that device in the ethernet featherwing is there a piece of code that will disable the detection? i.e. return the device config to what it was prior to enabling the detection?
and as an aside, when visiting this link,


i noticed the ethernet featherwing link on first line under ethernet is 404.