---
title: "W5500 server disconnection interrupt needed"
url: "https://maker.wiznet.io/forum/15677"
markdown_url: "https://maker.wiznet.io/forum/15677/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "CellketTech"
created: "2025-04-07T14:12:08+09:00"
last_activity: "2025-04-15T13:46:46+09:00"
language: "en"
views: 10
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 server disconnection interrupt needed

## Question

Asked by CellketTech on 2025-04-07 in Ethernet Chips.

Hello experts

I have designed a board containing W5500 module used for LAN connection with my server. The board has a cellular modem as backup for server communication in case of internet problem.

Board works as expected but I have to add a code for switching from LAN to cellular when needed.

I am looking for a way to know when internet LAN is temporarily not exist to be able to switch communication to the modem.

I tried disconnection interrupt but it is not work for me...

Any Idea?

Thanks

Dan Groswirth

cellkey.tech@gmail.com

## Replies

### Reply 1 by Hannah, 2025-04-15

Hi, Dan.

You can directly check the Ethernet link status using the **PHYCFGR register** of the W5500.
In particular, by checking **bit 0 (LNK, Link Status)** of the PHYCFGR register, you can determine whether the LAN cable is currently connected.

### Reply 2 by , 2025-04-15

To detect when your LAN connection is down and switch to the cellular modem, you can periodically ping a known external server to check the connectivity. If the ping fails for a certain number of retries, you can then trigger the switch to the cellular modem. This method doesn't rely on interrupts but uses a heartbeat mechanism to actively monitor the LAN status. By using timeouts and retries, you can handle temporary LAN disconnections and automatically switch to the backup modem when necessary. Once the LAN is restored, you can periodically check the connection again and switch back if needed. This approach ensures seamless communication failover between LAN and cellular without complicated hardware interrupts.

---

Source: https://maker.wiznet.io/forum/15677
