[sane-devel] MyPen driver

Richard Ulrich ricul77 at gmail.com
Tue Sep 4 21:40:36 UTC 2012


Hi Allan,

thanks for the script. Yes, the spaces got lost when I initially didn't
have a better means of copying the logs from the virtual machine than
pasting into wordpress.
Now, I can scp, so the logs are better now.

I scanned a vertical line as well as a horizontal line and a reference
number from a payment slip. 

At first sight, it looks easy. 
With the vertical line I see sudden changes from 0xff to 0x00.
With the horizontal line I see some 0x00 in the middle of the 0xff's.
And the payment slip looks a bit more random, but with 0xff's at the top
and bottom.

But I couldn't figure out the parameters needed to restore an image so
far.

I created a simple application where I can manipulate the parameters and
get images for the three logs. But so far, the resulting images didn't
resemble to the scanned content. It's all at: 
https://github.com/ulrichard/mypen/

So far I assumed 8bit grayscale, and tried to interpret the bulk reads
as a single scanline as well as a series of two dimensional images. 
What did I forget to try?

I disassembled the device and saw a chip : "mpf sst 39vf010 90-4c-wh"
That's a flash memory, so probably no the interesting part. The bigger
chip is virtually unreadable. A picture is at:
http://gallery.ulrichard.ch/gallery2/main.php?g2_itemId=7083&g2_imageViewsIndex=1

And as for the next step. I read somewhere that it's easier to write a
siple userland program that communicates with a new scaner before
creating a sane backend. Does that involve direct usage of libusb? Are
there existing examples that I could use as a starting point?

Rgds
Richard



Am Freitag, den 31.08.2012, 20:37 -0400 schrieb m. allan noah:
> Well, it looks like some leading spaces have been removed from the log
> (not sure if thats github, or your editor or some such), but i have
> modified the attached script to read that file.
> 
> cat usbsnoop.log | perl spike4.pl > usbsnoop.out
> 
> It will prune the log down to the parts that actually matter, the
> contents of bulk reads and writes.
> 
> allan
> 
> On Fri, Aug 31, 2012 at 7:44 PM, Richard Ulrich <ricul77 at gmail.com> wrote:
> > Hi allan,
> >
> > so, here is what I captured:
> > https://github.com/ulrichard/mypen/blob/master/logs/usbsnoop.log
> > http://blog.ulrichard.ch/?p=687
> >
> > The hard part was setting up the virtual machine with USB support...
> >
> > How do I proceed with analyzing the log? What do I look for?
> >
> > Rgds
> > Richard
> >
> > Am Montag, den 27.08.2012, 16:40 -0400 schrieb m. allan noah:
> >> Get a trace of it working under windows with
> >> http://www.pcausa.com/Utilities/UsbSnoop/ (preferred) or with
> >> wireshark. I've got some scripts to simplify the usbsnoop output, but
> >> you will still spend a bunch of time staring at the logs.
> >>
> >> allan
> >>
> >> On Mon, Aug 27, 2012 at 4:32 PM, Richard Ulrich <ricul77 at gmail.com> wrote:
> >> > Hi,
> >> >
> >> > I just subscribed to this list.
> >> >
> >> > After asking C-Channel multiple times for a linux driver for their
> >> > PayPen family of devices, I decided to buy a cheap one from eBay and see
> >> > what I can do myself.
> >> >
> >> > The USB ID was recognized, but that was about it.
> >> > Bus 002 Device 010: ID 0a93:0002 C Technologies AB C-Pen 10
> >> >
> >> > This is how it looks:
> >> > http://www.wetter.ch/portrait/files/468/00020992-mypen_20.3.03.jpg
> >> >
> >> > Searching on the internet I found out that there are similar devices,
> >> > but none of them seems to be really supported on linux.
> >> > http://lists.alioth.debian.org/pipermail/sane-devel/2009-February/024028.html
> >> > http://www.sane-project.org/unsupported/c-channel-mypen-pro.html
> >> >
> >> > Now if I want to give it a try developing a driver, how should I
> >> > proceed?
> >> >
> >> > Rgds
> >> > Richard
> >> >
> >> > Here is the output of $sane-find-scanner -v -v
> >> >
> >> > This is sane-find-scanner from sane-backends 1.0.22
> >> >
> >> >   # sane-find-scanner will now attempt to detect your scanner. If the
> >> >   # result is different from what you expected, first make sure your
> >> >   # scanner is powered up and properly connected to your computer.
> >> >
> >> > searching for SCSI scanners:
> >> > checking /dev/scanner... failed to open (Invalid argument)
> >> > checking /dev/sg0... failed to open (Access to resource has been denied)
> >> > ...
> >> > checking /dev/sgz... failed to open (Invalid argument)
> >> >   # No SCSI scanners found. If you expected something different, make
> >> > sure that
> >> >   # you have loaded a kernel SCSI driver for your SCSI adapter.
> >> >
> >> > searching for USB scanners:
> >> > checking /dev/usb/scanner... failed to open (Invalid argument)
> >> > ...
> >> > checking /dev/usbscanner15... failed to open (Invalid argument)
> >> > trying libusb:
> >> >
> >> > ...
> >> > <device descriptor of 0x0a93/0x0002 at 002:010>
> >> > bLength               18
> >> > bDescriptorType       1
> >> > bcdUSB                2.00
> >> > bDeviceClass          255
> >> > bDeviceSubClass       0
> >> > bDeviceProtocol       0
> >> > bMaxPacketSize0       8
> >> > idVendor              0x0A93
> >> > idProduct             0x0002
> >> > bcdDevice             1.17
> >> > iManufacturer         1 ()
> >> > iProduct              2 ()
> >> > iSerialNumber         3 ()
> >> > bNumConfigurations    1
> >> >  <configuration 0>
> >> >  bLength              9
> >> >  bDescriptorType      2
> >> >  wTotalLength         32
> >> >  bNumInterfaces       1
> >> >  bConfigurationValue  1
> >> >  iConfiguration       0 ()
> >> >  bmAttributes         160 (Remote Wakeup)
> >> >  MaxPower             200 mA
> >> >   <interface 0>
> >> >    <altsetting 0>
> >> >    bLength            9
> >> >    bDescriptorType    4
> >> >    bInterfaceNumber   0
> >> >    bAlternateSetting  0
> >> >    bNumEndpoints      2
> >> >    bInterfaceClass    255
> >> >    bInterfaceSubClass 0
> >> >    bInterfaceProtocol 255
> >> >    iInterface         0 ()
> >> >     <endpoint 0>
> >> >     bLength           7
> >> >     bDescriptorType   5
> >> >     bEndpointAddress  0x81 (in 0x01)
> >> >     bmAttributes      3 (interrupt)
> >> >     wMaxPacketSize    8
> >> >     bInterval         1 ms
> >> >     bRefresh          0
> >> >     bSynchAddress     0
> >> >     <endpoint 1>
> >> >     bLength           7
> >> >     bDescriptorType   5
> >> >     bEndpointAddress  0x82 (in 0x02)
> >> >     bmAttributes      3 (interrupt)
> >> >     wMaxPacketSize    64
> >> >     bInterval         1 ms
> >> >     bRefresh          0
> >> >     bSynchAddress     0
> >> >
> >> > <trying to find out which USB chip is used>
> >> >     checking for GT-6801 ...
> >> >     this is not a GT-6801 (bcdUSB = 0x200)
> >> >     checking for GT-6816 ...
> >> >     this is not a GT-6816 (bDeviceClass = 255, bInterfaceClass = 255)
> >> >     checking for GT-8911 ...
> >> >     this is not a GT-8911 (check 1, bDeviceClass = 255, bInterfaceClass
> >> > = 255)
> >> >     checking for MA-1017 ...
> >> >     this is not a MA-1017 (bDeviceClass = 255, bInterfaceClass = 255)
> >> >     checking for MA-1015 ...
> >> >     this is not a MA-1015 (bcdUSB = 0x200)
> >> >     checking for MA-1509 ...
> >> >     this is not a MA-1509 (bcdUSB = 0x200)
> >> >     checking for LM983[1,2,3] ...
> >> >     this is not a LM983x (bcdUSB = 0x200)
> >> >     checking for GL646 ...
> >> >     this is not a GL646 (bDeviceClass = 255, bInterfaceClass = 255)
> >> >     checking for GL646_HP ...
> >> >     this is not a GL646_HP (bcdUSB = 0x200)
> >> >     checking for GL660+GL646 ...
> >> >     this is not a GL660+GL646 (bDeviceClass = 255, bInterfaceClass =
> >> > 255)
> >> >     checking for GL84x ...
> >> >     this is not a GL84x (bDeviceSubClass = 0x0)
> >> >     checking for ICM532B ...
> >> >     this is not a ICM532B (check 2, bcdUSB = 0x200)
> >> >     checking for PV8630/LM9830 ...
> >> >     this is not a PV8630/LM9830 (bDeviceClass = 255)
> >> >     checking for M011 ...
> >> >     this is not a M011 (bcdUSB = 0x200)
> >> >     checking for RTS8822 ...
> >> >     this is not a RTS8822 (bDeviceClass = 255)
> >> >     checking for rts8858c ...
> >> >     this is not a rts8858c (bDeviceClass = 255)
> >> >     checking for SQ113 ...
> >> >     this is not a SQ113 (bDeviceClass = 255)
> >> >     checking for HP4500C/4570C/5500C/5550C/5590/7650 chipset ...
> >> >     this is not a HP4500C/4570C/5500C/5550C/5590/7650 chipset
> >> > (bDeviceSubClass = 0x0)
> >> >     checking for rts8801/rts8891 ...
> >> >     this is not a rts8801/rts8891 (bDeviceClass = 255)
> >> > <Couldn't determine the type of the USB chip (result from sane-backends
> >> > 1.0.22)>
> >> >
> >> > found USB scanner (vendor=0x0a93, product=0x0002) at libusb:002:010
> >> >
> >> > ...
> >> >
> >> >   # Your USB scanner was (probably) detected. It may or may not be
> >> > supported by
> >> >   # SANE. Try scanimage -L and read the backend's manpage.
> >> >
> >> >   # Not checking for parallel port scanners.
> >> >
> >> >   # Most Scanners connected to the parallel port or other proprietary
> >> > ports
> >> >   # can't be detected by this program.
> >> >
> >> >   # You may want to run this program as root to find all devices. Once
> >> > you
> >> >   # found the scanner devices, be sure to adjust access permissions as
> >> >   # necessary.
> >> > done
> >> >
> >> >
> >> > --
> >> > sane-devel mailing list: sane-devel at lists.alioth.debian.org
> >> > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> >> > Unsubscribe: Send mail with subject "unsubscribe your_password"
> >> >              to sane-devel-request at lists.alioth.debian.org
> >>
> >>
> >>
> >
> >
> 
> 
> 





More information about the sane-devel mailing list