What Do Watchdog and Auto-Reconnect Do in a Serial Server? A Guide to Engineering Stability

A watchdog is a timer circuit or software mechanism inside a serial server that automatically resets the system if the main program fails to "feed" it within a set period. Auto-reconnect is the function that re-establishes a TCP connection after it drops due to network jitter, router restart, or peer failure. Both address the same goal: keeping the link between serial field devices and the network available for as long as possible in unattended industrial sites. Take the four-port serial server (SS200) as an example: it supports Modbus TCP/RTU, MQTT, and TCP/UDP, and operates from -40°C to 75°C — long-running devices like this typically rely on both mechanisms.
What exactly does a watchdog monitor?
Watchdogs fall into two categories, and engineers need to distinguish their scopes.
- Hardware watchdog: A timer chip independent of the main CPU (or a module in a separate clock domain inside the CPU). If the main program crashes, enters an infinite loop, or suffers an interrupt fault, the hardware watchdog pulls the reset pin low and forces a restart. It does not depend on the operating system, so it remains effective against firmware crashes.
- Software watchdog: Implemented by the OS or an application task, it typically monitors the health of a critical task. It can catch task blocking or memory leaks, but if the kernel itself crashes, it may fail as well.
In practice, both are used together: the hardware watchdog as a last resort and the software watchdog for fine-grained task monitoring. When selecting a serial server, confirm whether it has an independent hardware watchdog and check the reset time in the datasheet. Models without one are prone to prolonged "false alive" states in harsh electromagnetic environments, often showing link LEDs on but no data forwarding.
What kinds of disconnections does auto-reconnect handle?
There are at least three types of "disconnection" in industrial sites, and auto-reconnect must address each:
- Physical link loss: A disconnected cable, powered-down switch, or severed fiber. The device detects the loss of carrier, enters a wait state, and re-establishes the TCP connection once the link is restored.
- Abnormal TCP disconnection: The peer server restarts or a routing change resets the connection. The device detects this via TCP Keepalive or application-layer heartbeats, then retries at a preset interval.
- Serial-side device offline: A meter on the RS485 bus loses power or has an address conflict, so requests go unanswered. The TCP connection may still exist, but data cannot be collected. Some serial servers support serial timeout reporting so the upper-layer platform can detect this.
Auto-reconnect typically includes three configurable parameters: reconnect interval, maximum retry count, and whether to cache data during reconnection. For Modbus TCP/RTU passthrough, the register address mapping must remain unchanged after reconnection; otherwise the host may read incorrect data. The four-port serial server (SS200) supports Modbus TCP/RTU passthrough and maintains serial parameters and mapping after reconnection, making it suitable for continuous polling in production-line data acquisition.
How do watchdog and auto-reconnect work together?
The two mechanisms operate on different time scales:
- Milliseconds to seconds: The watchdog monitors program execution and resets on failure. After reset, the device reinitializes its network and serial ports, equivalent to a cold start.
- Seconds to minutes: Auto-reconnect monitors link status and rebuilds the session once the network recovers. It does not reboot the system, so recovery is faster and less disruptive to production.
Engineering note: If a field device frequently triggers the hardware watchdog, check power ripple and electromagnetic interference first rather than simply increasing the feed interval. Repeated resets shorten device lifespan and may lose unsaved configuration.
In unattended pump stations, distribution rooms, or agricultural greenhouses, these two mechanisms together reduce the probability of "someone must go on-site to reboot" to a low level. Device connectivity rates typically reach 95% or above, depending on site network quality and device configuration.
Which stability parameters should you check when selecting a model?
For long-running industrial sites, verify the following items in your selection checklist:
- Hardware watchdog: Is it independent of the main CPU? Is the reset time specified?
- Auto-reconnect: Is the reconnect interval configurable? Does it support TCP Keepalive?
- Heartbeat and registration packets: Does it support custom heartbeat packets for platform-side online status detection?
- Operating temperature: Industrial devices typically cover -40°C to 75°C; wide-temperature design reduces summer overheating failures.
- Protection and isolation: Does the RS485 side have optical isolation? Does the Ethernet port have ESD protection?
Take the four-port serial server (SS200) as an example: it provides 2 serial ports and 1×10/100M Ethernet port, supports Modbus TCP/RTU, MQTT, and TCP/UDP, operates from -40°C to 75°C, and offers industrial-grade protection. On the same link, if USB or Bluetooth debugging is needed at the front end, pair it with the U485 industrial USB/Bluetooth to RS485 (model: U485), which offers 2.5KV optical isolation, 15KV ESD protection, and baud rates up to 3Mbps — suitable for quick on-site troubleshooting of the serial side.
FAQ
Does a watchdog reset lose configuration?
It depends on whether the configuration was written to non-volatile memory. Saved settings usually persist; unsaved runtime parameters reset.
Are auto-reconnect and heartbeat the same thing?
No. Heartbeat detects whether the link is alive; reconnect is the action taken after a disconnection is detected. They work together.
Does reconnection lose data during Modbus RTU to TCP conversion?
Requests not delivered during reconnection are lost, and the host must retry on timeout. Caching can reduce loss but cannot guarantee zero data loss.