Ethernet
Note:
Ethernet is available on the Photon 2, Argon, Boron when used with the Ethernet FeatherWing or with the B-Series SoM with the evaluation board or the equivalent circuitry on your base board. Circuitry can be added to your P2 or E404X base board for Ethernet as well.
On the P2, Photon 2, and M-SoM it is highly recommended that you use Device OS 5.9.0 or later when using Ethernet due to important bugs that were fixed in 5.6.0 and 5.7.0 that can affect Ethernet usability on RTL872x devices.
It is not available on Gen 2 devices (Photon, P1, Electron, and E-Series except the E404X).
For more information about Ethernet, see the application note AN037 Ethernet.
By default, Ethernet detection is not done because it will toggle GPIO that may affect circuits that are not using Ethernet. When you select Ethernet during device setup, it is enabled and the setting stored in configuration flash.
It's also possible to enable Ethernet detection from code. This is saved in configuration flash so you don't need to call it every time.
You should call it from setup() but make sure you are using SYSTEM_THREAD(ENABLED)
so it can be enabled before the connecting to the cloud. You should not call it from STARTUP().
SYSTEM_THREAD(ENABLED);
void setup()
{
System.enableFeature(FEATURE_ETHERNET_DETECTION);
}
Prior to Device OS 5.9.0, interrupt (nINTERRUPT) and reset (nRESET) pins were required to use Ethernet. With Device OS 5.9.0 you can operate without these connected.
If you are using the Adafruit Ethernet Feather Wing (instead of the Particle Feather Wing), by default nRESET and nINTERRUPT pins are not connected. You will either need to connect them (on the small header on the short side) to pins D3 and D4 with jumper wires, or use Device OS 5.9.0 and operate without these two hardware control pins.
Device | SPI MISO | SPI MOSI | SPI SCK | Chip Select | Reset | Interrupt |
---|---|---|---|---|---|---|
Particle Ethernet | MISO | MOSI | SCK | D5 | D3 | D4 |
Adafruit Ethernet | MISO | MOSI | SCK | D5 | 1 | 1 |
B-SoM eval board | MISO | MOSI | SCK | D8 | A7 | D22 |
M.2 SoM breakout board | MISO | MOSI | SCK | D8 | A7 | D22 |
Muon | MISO | MOSI | SCK | A3 | NC | A4 |
Tracker SoM | MISO | MOSI | SCK | D2 | D6 | D7 |
1On the Adafruit Ethernet FeatherWing this pin is not connected by default.