HPscan v1.0
20 June 2019
Pete Brown
losepete@losepete.plus.com


Introduction
============

HPscan is a basic scanner frontend.

HPscan builds the scanimage.exe command line based on the settings and 
selections made.

  Mode and Resolution options supported 
  Preview image scan at low resolution 
  Selection of an area of the Preview image for scanning supported
  Option to open scan in a Viewer Application 
  No, HPscan does not perform any image correction or enhancement; this is 
  left to whatever graphics editing program you use. 

Originally designed for HP scanners that use the hplip and hpaio libraries 
HPscan can also be used with any scanner that uses a sane ".conf" file - 
later model scanners that cannot be used with TAME/2 because they have no 
entry in the TAME/2 scanner database should work with HPscan.

 

Installation:
=============

HPscanV100.zip contains the following files:

   HPscan.exe - the executable file
   HPscan.hlp - application Help file
   HPscan.txt - this readme file
   HPscan.bmp - bitmap displayed when HPscan starts
   HPscan.cmd - creates a HPscan Desktop folder and program objects
   hplip.conf.0x0a - alternative conf file, see Troubleshooting hpaio below
   TestScan.cmd - example cmd file to perform a test scan, modify as required

HPscan100.wpi contains the above files with the exception of HPscan.cmd

Unzip HPscan.zip retaining the directory structure to a drive:\directory of 
your choice, eg G:\PROGRAMS.

Run HPscan.cmd to create a Desktop program object for HPscan.exe

*After* checking the below Requirements start HPscan and complete
the required Settings.

Instructions on Setup and Use are in the HPscan Help file.



Requirements:
=============

The application nconvert.exe is required as it is used to resize and convert
the Preview scan from JPG to BMP; download from
 http://download.xnview.com/NConvert-os2.zip

Unzip nconvert.zip retaining the directory structure to a drive:\directory of 
your choice, eg G:\PROGRAMS.


To use HPscan with a scanner that uses a scanner.conf file the sane package
needs to be installed, configured and working. Start HPscan, complete the 
required Settings - see the Help for details.


To use HPscan with HP scanners using the hplip and hpaio libraries along with
the cups packages installed from *ZIP* files printing should be configured 
and working.

I have the below packages installed. HPscan should also work with earlier 
cups/hplip/hpaio/sane ZIP package releases but has only been tested with the 
below ZIP packages. 


cups v2.1.0 - main cups package
        http://smedley.id.au/tmp/cups-2.1.0-os2-20151122.zip
cups-filters v1.0.71 - filters used by cups
        http://smedley.id.au/tmp/cups-filters-1.0.71-os2-20150725.zip 
ghostscript v9.15 - ghostscript interpreter 
        https://dl.dropboxusercontent.com/u/76425158/ghostscript-9.15-os2-20141011.zip 
sane v1.0.27 - main scanner software
        http://smedley.id.au/tmp/sane-backends-1.0.27-os2-20190321.zip 
hpaio v3.18 - support library for HP scanners
        http://smedley.id.au/tmp/hpaio-3.18.12-os2-20190114.zip 
hplip v3.18 - support library for HP printers/scanners 
        http://smedley.id.au/tmp/hplip-3.18.12-os2-20190416.zip 
hplip-cups v3.18 - support library for HP printers
        http://smedley.id.au/tmp/hplip-3.18.12-os2-20190420.zip

Also check https://os2ports.smedley.info/ for updates.

****** Late addition:
 hpaio v3.19.5 tested and working
         http://smedley.id.au/tmp/hpaio-3.19.5-os2-20190609.zip   

The above packages should be installed to the drive specified as %UNIXROOT%
- the drive with the \etc, \usr and \var directories. The cups, cups-filters,
ghostscript, hplip and hpaio packages must be unzipped to the root of that
drive keeping the zip file directory structure.

The hpaio.dll file must be copied to the sane\lib\sane directory

The hplip.conf file must be copied to the %ETC% directory - usually 
[BootDrive]:\MPTN\ETC - and the Paths should be checked and modified as 
necessary to suit your system.

The various libraries and executables required by the above software can be
installed from RPM packages using Arca Noae Package Manager. I think that
the following executables are required if not already installed 
in %UNIXROOT%\usr\bin 

bc.exe 
cat.exe 
mktemp.exe 
printf.exe 
rm.exe 



If using cups/hplip installed from *RPM* packages:

sane is required - http://smedley.id.au/tmp/sane-backends-1.0.27-os2-20190321.zip

hpaio.dll is required - http://smedley.id.au/tmp/hpaio-3.19.5-os2-20190609.zip
  1] Unzip the hpaio.dll file to [PathTo\]sane\lib\sane\hpaio
  2] Unzip the models.dat file to /usr/share/hplip/data/models/models.dat

Locate the already installed hplip.conf file and copy to the %ETC% directory
 - usually [BootDrive]:\MPTN\ETC and modify paths as necessary.

Tested with the following RPM packages
 cups 2.1.3-10
 cups-filters 1.17.2-3
 ghostscript 9.18-7
 hplip 3.17.11-1
 hpaio-3.19.5 


Both ZIP and RPM installations:

Modify the included TestScan.cmd to match your installation and scanner then
save to the directory containing scanimage.exe
Open a Command Window in the directory containing scanimage.exe and enter
  TestScan.cmd
You should now have a successful scan, file TestScan.pnm, or a log file 
containing some indication of why scanning failed.




Troubleshooting
===============

If the TestScan.cmd failed to produce a scan the log file should give some
indication of the problem.


Scanners using a sane conf file:

Are you using the correct conf file for the scanner?

Does the scanner have an identifying entry in the conf file?




Scanners using hpaio

This log file snippet indicates that either the file, models.dat, containing
model attributes could not be found or that the model is not included in the 
models.dat file:-

[dll] init: backend `hpaio' is version 1.0.0
[hpaio] sane_hpaio_open(/net/envy_photo_6200_series?ip=192.168.1.252): scan/sane/hpaio.c 387 scan_type=0 scansrc=1556143472
scanimage: open of device hpaio:/net/envy_photo_6200_series?ip=192.168.1.252 failed: Operation not supported
[dll] sane_exit: exiting

Open the models.dat file in a text editor and check the model is listed.
NOTE: The model name used in the URI must match the model name listed in
models.dat exactly 

If the model is listed in models.dat follow these steps

1] Start [BootDrive]:\TCPIP\bin\SYSLOGD.EXE
2] Run the TestScan.cmd
3] Close SYSLOGD.EXE
4] Open the %ETC% ([BootDrive]:\MPTN\ETC)\SYSLOG.MSG with a text editor. If the
   log contains a message like the below it confirms there is a problem 
   locating the models.dat file

[localhost] Apr 24 23:04:32 scanimage: io/hpmud/model.c 538: no envy_photo_6200_series attributes found in /hplip/share/hplip
/data/models/models.dat

Note the "split" in the path in the above log entry - it should all be on 1 line.


Possible Resolution   

Modify the paths in the hplip.conf.0x0a supplied in HPscan.zip as necessary and save
it to %ETC% as hplip.conf

Retry the TestScan.cmd


Brief explanation: Not sure why but on 3 systems I have using ArcaOS or eCS 
scanning fails when using the hplip.conf supplied with hpaio. A libc debug
log revealed that, somehow, the hex value 0x0d was appearing in the path to
the models.dat file which is created by hpaio adding /data/models/models.dat
to the home path in the hplip.conf file. With the hpaio supplied hplip.conf
the path to the models.dat file became

  /hplip/share/hplip0x0d/data/models/models.dat

The newline value, 0x0d, causes the path to be read *only*  up to that newline
character so the models.dat file cannot be found.

This seems to be a libc library problem of some sort on my systems as the
hpaio porter, Paul Smedley, cannot replicate the problem on his systems.

The hplip.conf.0x0a supplied with HPscan has had the 0x0d value removed from
the end of each line. Scanning works fine on my systems using this a copy of
this file with paths modified for my system.

 




