PupCam
NOTES ON SETTING UP A NET ACCESSIBLE WEBCAM WITH PUPPY LINUX
2014-09-31
Key components of my initial setup:
- HP thin client (t5540: 1MHz, 1GB RAM)
- Philips NSC700<mumble> VGA USB web-cam
- Netgear N600 USB stick wi-fi network adapter
- Puppy Linux 5.2.8 on USB stick (with Puppy Player 'startup')
- X-based 'guvcview' to control the camera and capture images
Using the Puppy Player configuration as a starting point simplified the process of getting the box on the network with a static IP address. I had already solved that problem for the Puppy Player project, and realized that I could just take advantage of it.
One particularly key item to be aware of is the fact that I have modified the Puppy Linux 5.2.8 image on the USB stick so that it will execute 'start-extra' from the USB root, which is a shell script that allows me to add my own commands to the pre-X-start start-up procedure. Also, though I'm not using it presently, this custom PL5.2.8 image also includes 'start-extrax', another optional shell script which is run by the X-start script.
Of course, this Puppy Player configuration has a dependency on my local server 'gusoyn' to launch, but given that the web-cam is local, I don't see that as a problem. In the case of trying to setup a stand-alone web-cam system, this would have to change. The key element would be the configuration of a static IP address, which is not the norm for a Puppy Linux boot up sequence. One possibility would be to borrow the static IP setting commands section from the Puppy Player setup script (pplay-setup.sh) and placing those commands in the 'start-extra' script, which would take care of it.
In any case, usage of an HP thin-client running Puppy Linux as a web-cam required that I:
- Create a 'pupcam.sh' in the USB stick root that handles all of the web-cam initialization and execution
- Adjust the Puppy Player 'start-extra' to test for the presence of pupcam.sh, and adjusting execution path for Puppy Player and executing pupcam.sh, if extant
A 'solved' problem was related to the image sizes. Though guvcview has a command line switch to indicate the desired image size, the application defaults to the smallest 'native' size of the camera, unless, .guvcviewrc exists in the /root directory, having been created by a prior execution of guvcview. My solution was to have a copy of that file on the USB stick and copy that into place as part of the pupcam.sh command sequence.
There is one outstanding bug/problem that I have yet to resolve. Occasionally the wi-fi connection will drop and at that point the system is useless. Determining why the connection dropped and how to recover is still a future activity. Efforts so far have proved unworkable.
Using a second system as a test fixture, an HP t5510 with a PCI wireless card, I have tried several possible methods for recovery. I can detect when the connection is lost, but recovering is not so simple. Initially, I thought that I would only have to reset the wireless configuration parameters with iwconfig, then re 'up' the device with ifconfig, but so far that has not restored the connection.