README file for Single-Use Camera Reader
========================================

If viewing in Notepad, turn Word Wrap on.


What it is
----------
Single-Use Camera Reader, as the name implies, is software that allows you to read picture data from one or more types of "single-use" digital cameras currently on the market. It is known to support the Dakota Digital Camera (PureDigital Technology), and may (but is not guaranteed to) support the Walgreens single-use digital camera. Both are based on the Sunplus (now Grandtech) SPCA504b controller chip.

The program allows you to read picture data, clear the camera (for reuse), view basic status and hardware information (such as firmware version), and dump the raw contents of the camera's internal memory. Future versions may allow you to do additional things such as upload custom firmware.



Installation
------------
This program uses S. Mayer's LibUSB-Win32 library to communicate with the USB port. This consists of three parts:

* libusbfl.sys - USB filter driver for Windows. To install, right-click on libusb_fl.inf and choose "Install".
* libusbst.sys - USB stub driver for the camera. To install, right-click on libusb_sa.inf and choose "Install". Or, select it when you plug the camera in and Windows asks for a driver.
* libusb0.dll - LibUSB communications library. This can be left in the same directory as the Single-Use Camera Reader software.

You MUST REBOOT THE COMPUTER before the drivers will have any effect. After you do, Windows should detect the camera if it is plugged in.



Basic Usage
-----------
Plug in your single-use camera, then run the Single-Use Camera Reader software. If the camera is detected, all options will be enabled. If no camera was detected, all camera-control operations will be greyed out. Check your connections, make sure USB is configured correctly on your system (plug in the camera, if you have not done so!) and press Re-query to look for it again.

* Press "Get Pictures" to download all pictures from the camera. A Save As dialogue will appear, enter the name that the files should be prefixed with. Files on the camera have names in the form of DSC_####.JPG; if you enter "downloaded-" as the filename, the files will be saved as e.g. "downloaded-DSC_0001.JPG", "downloaded-DSC_0002.JPG", etc. If the target file already exists, you will be asked whether to overwrite it.

* Press "Clear Camera Memory" to delete all pictures from the camera. Once this is done, it will be ready to take pictures again like new. Note that your camera may shut itself off after clearing; you may have to close the Single-Use Camera Reader, unplug and replug the camera before you can perform any other operations on it. Wait for it to shut off (or the Ready light to come back on) before you unplug it.

Note: Deleting all pictures does NOT securely erase all picture data from the camera. Until it is completely overwritten by new picture data, all or parts of your old pictures are still in the memory.


Advanced Usage
--------------
Single-Use Camera Reader also supports several additional operations, available from the Advanced menu.

* Memory Dumps: 
	The following memory-dump options are available from the Advanced > Memory Dump menu:
Select "RAM" to dump the 6KB block of RAM accessible through the USB interface (0x0000 ~ 0x1800).
Select "Register block" to dump the register space (0x2000-0x2FFF).
Select "Firmware" to dump the entire external program memory (0x0000 ~ 0xFFFF) to a file.
Select "FLASH" to dump the external picture FLASH memory (16 MB). This will write TWO files: every 512-byte block of FLASH memory is accompanied by 16 out-of-band bytes of ECC data. This is used to determine bad blocks and for the wear-leveling system. The main data will be output to the filename you specify, and the ECC data will be output to the same filename with ".ecc" appended to it. You will be prompted to overwrite if either of these files exist. This process will take a minimum of 10 hours, since it must be read one byte at a time and reading each byte requires multiple USB transfers.

* Device Status: 
	Use this option to display information about the camera and some status registers. The information displayed is as follows:
Firmware revision: displays a sequence of bytes representing the camera's firmware and hardware revision info.
Serial #: Displays the camera's factory-assigned(?) serial number.
Ready Status: reads the Ready Status register (0x0001).
Operation Mode: Mode the camera is in (e.g. idle, upload, etc.) When idle, this should be 0. This will probably be shown as 0 at all times, since you cannot access the status menu while uploading :-)
Enable Status: reads the Enable Status register (0x0ee1).
Composite Status: reads several status registers; some are unknown. The first is the Ready Status already displayed.
Mapper: reads the value of register 0x2c07, which controls which half of the firmware is mapped to external memory. When '0', the low half is mapped to 0x8000 ~ 0xffff; when '1', the high half is mapped here. This is automatically taken care of when you dump firmware.

* Send Reset: sends a reset sequence to the camera. Single-Use Camera Reader automatically sends the reset and enable sequences after detecting the camera.

* Send Enable: sends the transfer-enable sequence to the camera. Currently, this just writes a value directly to a register, forcing it enabled, but there is also a more proper way of doing this.  Single-Use Camera Reader automatically sends the reset and enable sequences after detecting the camera.


Credits
-------
Single-Use Camera Reader is based on John Maushammer's (http://www.maushammer.com/systems/dakotadigital/DakotaDigital.html) pureread.c driver for Macintosh. In fact, code for all the most important operations (camera enable, bulk transfer, FLASH-reading routines) is taken more or less directly from this project. Camera command information is also taken from the gPhoto software for Linux.

For a more complete list of people involved in the hacking of the single-use digital camera, see http://cexx.org/dakota/ .


LibUSB-Win32
------------
This program uses, and includes binaries for, the LibUSB-Win32 program. The components of LibUSB-Win32 are distributed under the GNU General Public License and the GNU LGPL. You can obtain updated versions of LibUSB-Win32 and the source code from the LibUSB-Win32 homepage at http://libusb-win32.sourceforge.net .


Copyright and License
---------------------
Single-Use Camera Reader (c)2003 T. R. Gipson. Program home page: http://cexx.org/dakota/

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

The full text of the GNU General Public License is included in the file "GPL.txt" included with this software.