I'm sure this is a problem which plagues all of us with more basic networking hardware,
The 'dropping out' of the router.
What I refer to here is those annoying times when for no apparant reason you have to phsyically power off, and then power on your ADSL modem, or Router.
For several years now I have used a SmoothWall Linux firewall to protect my LAN from outside attacks.
Last week I got fed up of the drop outs, and decided to give my 'parallel port plug socket' (Full write up and circuit diagrams coming soon!) its first real assignment.
So I set to work, and fist started searching for linux parallel port control programs.
Very quickly I came across a great resource, Parallel Port Output on ePanorama.net.
This page basically has everything you could ever want or need to know about parallel port control, on a variety of operating systems.
Buried within the mass of links was a program called Parashell.
Parashell is a program that allows you to control the parallel port (input and output) using simple command line arguments. Due to it's easy interface all you need to know is the parallel port's address (ie., 0x378, 0x3bc, etc.) and a little bit about binary.
This program works a treat, and because it is supplied in binary form theres virtually no work to get it running on the smoothwall - just copy the file using pscp.
I then set about writing a very simple script to be called during shutdown to first turn the power to the modem off, and then back on again, just before the actual reboot.
My thinking behind this was to give the ADSL modem a slight head start on the smoothwall. My Edimax AR-2004A Router takes around 40 seconds to boot, while the smoothwall only takes 30.
The script seems to work perfectly, but while testing (with a low wattage light connected instead of the modem), I found a major problem.
During the boot sequence of the smoothwall, the parallel port pins were set to low, causing the light to turn off just as the smoothwall finished booting.
After a bit of panic, and a couple of beers, I realised a solution - Use the Computer turning it off Strategically. It also has the side effect that if the smoothwall was turned off for any length of time (highly unlikely for me!) the modem would be restarted during the smoothwall startup.
The end result is 2 scripts for the smoothwall, rc.modemoff and rc.modemon, which are called during the shutdown and startup scripts respectively.
My network is set up with 8Mb MaxDSL, coming via pppoa to an Edimax AR-2004A router.
The Router is setup in RFC1483 Bridge mode, and the smoothwall treats it as a pppoe modem.
From what I've seen, in these cases where the router hangs, the smoothwall still believes it is connected via pppoe, sometimes only for seconds before a redial, but more often than not its dead for several hours before it closes the connection. (Or when I wake up in the morning and reboot everything!)
Maybe its cheap chips, or dodgy firmware - the 'hangs' were a problem on the AR-2004A long before I discovered the smoothwall. They certainly happen less often nowadays!
If anyone can help shed some light on why these hangs happen, or what I can to to reduce them, I would be delighted to hear from you.
The next step is to either write some code, or integrate with someone elses mod, to automatically start the smoothwall reboot process in the event that none of a user configurable list of ping recipients responds to pings.
Once I have found/written the reboot mod, and published the circuit diagrams, I plan to make this available to all as a smoothwall mod :)
James
__________________________