BSeries - Using the W5500 chip to send/receive Modbus/TCP data packets through ethernet

Make sure you’ve disable Ethernet support in Device OS:

SYSTEM_THREAD(ENABLED);

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

This is necessary because you need to prevent Device OS from touching the W5500. If Device OS detects that you have a W5500 it will attempt to use it for the cloud connection, and during initialization it will enable PPP mode, which will prevent using it in socket mode from your code.

As long as you’ve disabled Ethernet in Device OS you should be able access it using plain SPI and a 3rd-party W5500 library as a socket device.

1 Like