Enno Bartels
Super tuxi


Camera tool

hp215 - version 0.2.3 (21. October 2003)

functree

- About

- Authors

- Features

- Options

- Docu-API

- Download

- Mail

- FAQ

- Todo

- Examples


Back

About:

h p 2 1 5:
This commandline pogramm with the name hp215 can read photos from the HP Photosmart 215 camera.





Authors:

Enno Bartels
- maintainer,
- added autoconf/-make framework,
- added doxygen comments and framework,
- added options framework,
- added single picture mode,
- added preview and picture file formating posiblities,
- added test modes,
- added picture rotation,
- added simple web page creation,
- added dot ini file usage,
- etc.

Roberto Ragusa
- checksum code written

Jason Surprise
- original author





Features:

New to version 0.2.3 (21. October 2003):
1. FIX: Better lock file handling.

New to version 0.2.2 (20. October 2003):
1. NEW: Translations added: German (myself) + Portugues (thanks to Fernando Esteves)
2. NEW: Manpage created and added.
3. NEW: New option: Draw a variable date string in the picture.
4. NEW: Added shell script in directory "tools"
    Script for changes dates of the filenames and inside the html pages.
    Please edit the script before using it.
5. NEW: Added lock file. So the program can only started once.
6. FIX: Picture rotation: Indexing problem solved.
    Now the picture number and the rotation numbers are the same
7. FIX: Picture rotation: Memory problems solved
8. FIX: Picture rotation: Less output on Rotataion only shown in the debug mode
9. FIX: Hexdump output improved, error deleted, memory problem solved
10. FIX: Some typos fixed. Thanks to Carlo Perrassi
11. FIX: Checking commandline options string lengths before importing them!

Features:
- get the time of the camera
- get the number of pictures on the camera
- get the date/time of a picture
- get a preview picture
- get a picture
- delete a picture

- single picture mode
- save pictures into a new directory
- pictures and previews get the date/time/number as filename
- the format of the picture and preview filenames can be changes
- some test modes - picture rotation - 3 different modes - dot ini file usage .hp215 - subfolder creation





Options:



uusage: hp215 [Options]

 1. Camera modes:
 -----------------
   -gdc                    =   Get the actual time/date of the camera.

   -gn                     =   Get the number of pictures.

   -gdp                    =   Get the time of the pictures.

   -gt                     =   Get the preview/thumb pictures.

   -gp                     =   Get the pictures.

   -dp                     =   Delete pictures.

   -a                      =   Do all steps:
                               1. Get the date+time of the cam.
                               2. Get the number of pictures.
                               3. Get the time+date of the pictures.
                               4. Get preview/thumb pictures.
                               5. Get pictures.
                               6. Delete pictures.
                               7. Create html page.


 2. Single picture mode:
 ------------------------
   -no xxx                 =   Which picture numbers !?
                               Example: -no 1,2,5-6,17
                               DEFAULT: all pictures
                               Numbering will start with 1 !

  Picture/preview file name format:
 ----------------------------------
   -ds <format string>     =   Date/time string for preview and picture.
                               %b  Month as short text:  Jan..Dec
                               %B  Month as long  text:  Januar..December
                               %d  Day of month       :  01..31
                               %f  Day of month       :  1..31
                               %H  Hour               :  00..23
                               %I  Hour               :  01..12
                               %J  Hour               :  0..23
                               %K  Hour               :  1..12
                               %m  Month              :  01..12
                               %M  Minute             :  00..59
                               %p  Timespace          :  AM/PM
                               %y  Year               :  00..99
                               %Y  Year               :  2000..
                               %1  Picture number     :  00-xx
                               %2  Picture number     :  000-xxx
                               %3  Picture number     :  01-xx
                               %4  Picture number     :  001-xxx
                               %q  Sum of pics        :  01-xx
                               %Q  Sum of pics        :  001-xxx

                               Default        : %2._%d.%b.%Y_%H%M
                               Default example: 001._08.Jan.2003_1632

   -tds                    =   Test date time string with example date.
                               Nothing will be done with the camera!


 3. Html page creation:
 ----------------------

  -wp                        =   Add html pages to the picture
                                 This is default.
                                 Html pages will only be created in
                                 this modes: -a, -gt or -gp.
  -nwp                       =   No html pages.


 4. Sub directorys:
 ------------------

  -sdp                       =   Create the subdir "preview" for the preview pictures
  -nsdp                      =   Do not create the subdir "preview"
                                 Default: -sdp

  -sdf                       =   Create the subdir "fullsize" for the fullsize pictures
  -nsdf                      =   Do not create the subdir "fullsize"
                                 Default: -nsdf


 5. Post-editing:
 ----------------

  -rl xxx                    =   Rotate picture 90 degrees left
                                 Example: -rl 1,2,5-6,17
                                 Numbering will start with 1 !

  -rr xxx                    =   Rotate picture 90 degrees right
                                 Example: -rr 1,2,5-6,17
                                 Numbering will start with 1 !

  -rh xxx                    =   Rotate picture 180 degrees
                                 Example: -rh 1,2,5-6,17
                                 Numbering will start with 1 !


  -at                        =   Add date/time string below inside the picture
                                 If you use this option. A security copy of the pictures
                                 will be done without the date/time string.

  -atds <format string>      =   Date/time string format inside the picture.
                             =   Look at -ds for options.
                                 Default        : %f. %B. %Y   %H:%M
                                 Default example: 8. Januar. 2003   -  16:32



 6. General options:
 -------------------

  -h ,   --help              =   Prints this page and exit.
  -v ,   --version           =   Prints the actual version of hp215 and exit.

  -d ,   --debug             =   Print debug output.
  -dh ,  --debug-hexdump     =   Print debug hexdump of the usb messages.
  ! Put --debug and/or --debug-hexdump at first place after the command -
    then the other option - for debug output as early as possible!

  -to ,  --timeout x         =   Usb timeout in ms. default 4000.

  -2 ,   --open-cam-twice    =   Try opening camera twice.
                                 In some casses necessary:
                                 (If your camera hang after only one init!

  -f ,   --force-deletion    =   If you add this option and
                                 deleting of pictures was an option (-a or -dp)
                                 then NO safety query to you will be done
                                 to delete the pictures !!

  -pc ,  --print-cmd <cmd> <picno>
                             =   Print only the command code for this command.
                                 cmd's: 179(b3)=GetPreview, 180(b3)=GetPic,
                                        197(c5)=getPicDate, 177(b1)=Delete
                                 Nothing will be done with the camera!

  -puu , --print-usb-usermap =   Print only the usb usermap for hotplug
                                 Nothing will be done with the camera!


 7. Ini file usage:
 ------------------
   You can add a ini file .hp215 in your home directory and fill it with some of
   the commandline option, you want to have by default:
   Please use one option per line.
   Possible options are:
    -ds x, -wp, -nwp, -d, -dh, -to, -2, -f, -sdp, -nsdp, -sdf, -nsdf, -at, -atds

   Example file:
    -ds %Y.%m.%d_%H%M_picture
    -d
    -dh






Documentation-API
Documentation-API





Download:

21. oct. 2003: hp_photosmart215-0.2.3.tar.gz
20. oct. 2003: hp_photosmart215-0.2.2.tar.gz
26. apr. 2003: hp_photosmart215-0.2.1.tar.gz (obsolet)
01. mar. 2003: hp_photosmart215-0.2.0.tar.gz (obsolet)
21. nov. 2002: hp_photosmart215-0.1.9.tar.gz (obsolet)

configure
make
make install

at problems read the FAQ file






Mail:

Feel free to send comments/suggestions/patches !
ennobartels@t-online.de





FAQ:

FAQ:
=====

1. I get this error what can I do?
   Error: Writing to usb bulk endpoint: Connection timed out

   There are some problems with the usb connection!
   To solve this:
   1. Don't turn off the camera for this!
   2. Pull off the usb cable from the camera.
   3. Wait 3 seconds.
   4. Insert the the usb cable to the camera again.
   5. Wait 3 seconds -> 
      If the kernel detects the camera, there should be a beep!
   6. Try your commandline command again!



2. I get this error what can I do?
   Error: Writing to usb bulk endpoint: Operation not permitted

   1. Please try it again as superuser. 
   2. If that works and you want this to work for a
      normal user, you must do the following:
      Edit as superuser the hotplug configuration file
      /etc/hotplug/usb/usbcam.usermap  (SuSE8.1/8.2)
      /etc/hotplug/usb.usermap         (redhat 8.0)

      Add at the end of that file the output of
      the command.
       ./hp215 -puu
      Save the file and it should work as normal user!



3. If I try to insert the cable into the camera if the camera is on
   the display changes normal to "PC" but no beep of the detection of 
   the camera will accur and after 5-10 Second the "PC" String in the
   display will disappear to the normal camera mode.

   Happens only in the -gp mode on SuSE7.2
   And very very rare in the on SuSE8.2

   > su, command: usbmgr              will not help :-(
   > su, command: rcusbmgr restart    will not help :-(
   > su, command: rchotplug restart   will not help :-(
   > test again after 1 hour          will not help :-(
   > battery to low:                  NoNo-Thanks not the problem!
   > restart the computer:            That HELPS !!


4. Will you add a GUI ?

   No because this programm will be added to gphoto2
   and gphoto2 has a gui.


5. Why isn't your work included in gphoto2 ?

   -  I did started working on this.
      After version 0.2.3 more in this way will be done!


6. I get something like this if I use the -gpa mode only
   -D- Receiving picture header ... OK!
   -D- Sending ACK ... OK!
   -D- Receiving picture ...
   -E- Error opening (null) for write
 
   This is a bug in the 0.1.9 version use -gpa and -gta 
   OR
   Update to version 0.2.3 and use -gp (-gpa is obsolete)



7. I get this:
   Warning: Picture may be corrupted...
   What should I do.

   - Look with an picture viewer if the picture is really 
     corrupted. Mostly this is not the case.
   - If it is corrupted try it again. 
   - Or try to get only that picture 
     example: if it is picture 5
              hp215 -no 5 -gp
   

8. It doesn't work! What can I do ?

   1. Try answer of question 2
   2. try answer of question 1
   3. Try it with the -2 option
   4. Try it with greater timeout values example 5000 etc.
   5. Send me an output
      - use the --debug option for detailed output
      - send the output to me with some infos about 
        + what you have done 
        and your
        + libusb version (locate libusb), 
        + linux version  (more /proc/version) 
        + hotplug version (??)
        + distribution version 

   Give me feedback!








Todo:

TODO
=====

 1.   Add more languages if possible ?!

 2.   Hidden features ?
 2.2  Write programm to test all possible codes
 2.3  Check if there are hidden features and commands for the camera

 3.   Is the datetime string right 
 3.1. Check the hour ranges for 1-12 or 0-12 or 0-11
 3.2. Check the hour ranges for 1-23 ....

 4.   Add code into gphoto
      I have done a little bit done.
      --> I will do more after version 2.3

 5.   The use of convert by system:
      Now it is used without an absolute path to the convert program. This could
      be a security leak. So how to add the path - how can configure.in 
      get the found convert programm with path to a variable in the 
      config.h file? 

 6.   What happens if you have 2 hp215 cams ?

 7.   Problem with "make distcheck"! Whats going on?







Examples:

hp215 -gp
= get all pictures

hp215 -gp -no 2,3,7
= get only pictures 2 3 and 7

hp215 -a
=  a. get the date+time of the camera,
   b. get the number of pictures,
   c. get the time+date of the ALL pictures,
   d. get ALL previews,
   e. get ALL pictures,
   f. delete ALL pictures with 
      <do you really delete ALL pictures> safety query. 

hp215 -gdc -gt -gp -no 3-5,12
=  a. get the date+time of the cam,
   b. get the previews of pic. 3,4,5 and 12 ,
   c. get the pictures of pic. 3,4,5 and 12

hp215 -gdc -gt -gp -no 3-5,12 -rl 4-5 -rr 12
=  a. get the date+time of the cam,
   b. get the previews of pic. 3,4,5 and 12 ,
   c. get the pictures of pic. 3,4,5 and 12
   d. rotate left picture 4 and 5
   e. rotate right picture 12

hp215  -dp -no 12
= delete only picture 12

hp215 -h
= show all options