Controlling a garage door with the Web Server in a Box

Having constructed the WIB I decided to put it to work opening some roller doors on a shed. Please note: putting the control of your doors on the Internet is a bad idea - it is poor security and potentially dangerous. In my case these doors are not critical to the security of the area and a webcam can be used to check that the doors are safe to close. Please consider your own circumstances if you try this yourself; use the information on these pages at your own risk.


That was all that was required for construction. The device can be tested by using the toggle facilty in the WIB home.cgi page.


Unfortunately the WIB does not come with a pulse the digital output command, it only has set to 1 or 0 or toggle. Fortunately, if you have available a real webserver that supports PHP you can implement a safe pulse instruction. This also has the advantage of allowing you to keep your WIB from being directly connected to the Internet.

To generate a pulse on the WIB you need to read the level of the digital output, check that it is zero to make sure that it is not being pulsed by someone else then set the output to one, wait and set the output to zero.

My sample code in php can be found here basecode.php. You will also require 4 files that are installed on the WIB to read the digital levels. These files are d0.cgh, d1.cgh, d2.cgh and d3.cgh. Please note that if the output is latched high the code will produce a button allowing you to clear the output or you could log in to the WIB and force the output low.

Back to Electronics