Every time I call my ISP with the complaint
I don't have internet access.
, they ask me
Did you unplug the router, wait a couple of minutes and plug it in power again?
What I cannot understand is why isn't the firmware already doing that for me. It aught to be easy as pie to ping e.g. google every 60 seconds, and on failure, initiate system reset. Do this 3 times in a row, then give up and inform the user of self-diagnostics results.
Furthermore, in my experience, firmware development benefits heavily from assert()
calls, peppered throughout the code. Those usually hang the device (while(1);
) during development, in order to point the developers to the problem. Why not do a quick log message and then gracefully reboot, when an aseert() blows at run-time? Routers are soft-realtime machines, so some downtime in the name of fault tolerance (the user doesn't need to restart the router from the power adapter like some kind of savage) would be worthwhile.
Why is manually restarting a router still such an often needed task?