Menu

xsyscan failed to run (by Yuri Huang)

Help
2007-07-18
2013-04-08
  • Ivaylo Kroumov

    Ivaylo Kroumov - 2007-07-18

    Hi Ivaylo
    i'm Yuri Huang,and from china,nice to meet you.
    thank you for your driver,now I have some questions I would
    like to ask you.
    I hope you can help me

    1.Now My Travel Scan 660 Scanner don't work,i don't know
    why.
    info after modprobe scanner vendor=0x0a82 product=0x6600 :
    usb.c: registered new driver usbscanner
    scanner.c: probe_scanner: User specified USB read timeout -
    100
    scanner.c: USB scanner device (0x0a82/0x6600) now attached
    to scanner0
    scanner.c: 0.4.16:USB Scanner Driver
    scanner.c: probe_scanner: User specified USB scanner --
    Vendor:Product - a82:6600
    run xscan:
    root@RSystem:~# xsyscan
    loading the calibration data.
    no offset coefficient data.
    no gain coefficient data.
    initializing the scanner.
    error initializing the scanner.

    2.How can i hacking the xscan program to do not need X,
    That is, use command line.

    Thank's

    --
    Best regards
    Yuri

     
    • Ivaylo Kroumov

      Ivaylo Kroumov - 2007-07-18

      i was unable to reach to man by his e-mail, so i am posting my answer here.

      the original message follows:

      ---

      hi Yuri Huang,

      First, sorry for the delayed answer; i was on a vacation in the high mountains, where
      the mail is delivered by pack-mules only.

      Now, on your questions:

      My driver for the Travel Scan 660 scanner is somehow deprecated. It uses the scanner.o module, which is not included in the newer kernels. The modern way to do such things is by libusb. I have abandoned the Travel Scan 660, because the document processing software, for which it was initially intended, moved to faster german equipment.

      However, i can still be of assistance in reviving this old piece of code, but i will need some help in it. The driver is written four years ago and now i am ashamed for how dumb and non-informative it is.

      About the messages, you quote:

      > loading the calibration data.
      > no offset coefficient data.
      > no gain coefficient data.

      No problem so far; you will calibrate the scanner, once it's up and running. The calibration routine is built into the driver and can be invoked from the xsyscan program.

      > initializing the scanner.
      > error initializing the scanner.

      The most probable reason for the failure is missing device node. The driver looks for "/dev/usbscanner" and "/dev/usb/scanner", and hugs the bouquet when there's no one.

      If this is not the case, you will have to dig into the driver, so we can understand what the real problem is. The master initialization is in syscan.c module. Go and find syscan_init() function. There are many invocations of the IO() macro. Try to insert control printouts after each of them; use plain printf()'s for that purpose. Tell me what's the line, which fails to pass.

      > 2.How can i hacking the xscan program to do not need X,
      > That is, use command line.

      That's the easyest part. The xsyscan.c program is just a sample frontend to the driver.
      To scan from the command line, you will need something like this:

      > #include <stdio.h>
      > #include <stdlib.h>
      > #include <string.h>
      > #include <stdarg.h>
      > #include <sys/types.h>
      >
      > #include "cbind.h"
      > #include "frm2.h"
      >
      > #include "lm9832.h"
      > #include "syscan.h"
      >
      > int main (void) {
      > frm2 *f;
      >
      >     syscan_dpi (100, 100);
      >     syscan_table_load (& offs, "cal-offs");
      >     syscan_table_load (& gain, "cal-gain");
      >
      >     if (syscan_init (offs, gain))
      >         err ("error initializing the scanner.\n");
      >
      >     msg ("insert document to scan");
      >
      >     for (;;) {
      >
      >         while (syscan_paper () == 0);
      >
      >         if (syscan_scan (& f))
      >             err ("error while scanning.");
      >
      >         frm2_save (f, "test.frm2");
      >         if (f) free (f);
      >     }
      > }

      Note, that i wrote the above sample in "prima vista" and never compiled it, so it may need some adjustments.

      Hope this will help.

      Yours,

      Ivaylo Kroumov

      Sofia, 07-07-18

       

Log in to post a comment.

MongoDB Logo MongoDB