<div dir="ltr"><div>Hi Martin, <br><br><div>Good work Martin!<br></div><div>Any missing commands would be a smoking gun imho.<br></div><br>Rolf, are you following this thread ?<br><br></div>/Troels<br><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-24 23:09 GMT+01:00 Martin <span dir="ltr"><<a href="mailto:martin.gu@intergga.ch" target="_blank">martin.gu@intergga.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Troels<br>
<br>
I don't have access to another computer. But I have installed OpenSUSE 13.2<br>
and the result is the same as on 13.1.<br>
I did not (yet) test with short delays between the commands, but I compared<br>
the communication of the Canon software scangear on Windows with the one of<br>
SANE:<br>
<br>
At start ScanGear sends the following (linebreaks added by me):<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"<br>
xmlns:vcn="<a href="http://www.canon.com/ns/cmd/2008/07/canon/" target="_blank">http://www.canon.com/ns/cmd/2008/07/canon/</a>"><br>
  <ivec:contents><ivec:operation>VendorCmd</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
      <ivec:jobID> </ivec:jobID><br>
      <vcn:ijoperation>ModeShift</vcn:ijoperation><br>
      <vcn:ijmode>1</vcn:ijmode><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
response:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"<br>
xmlns:vcn="<a href="http://www.canon.com/ns/cmd/2008/07/canon/" target="_blank">http://www.canon.com/ns/cmd/2008/07/canon/</a>"><br>
  <ivec:contents><br>
    <ivec:operation>VendorCmdResponse</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
      <ivec:response>OK</ivec:response><br>
      <ivec:response_detail/><br>
      <vcn:ijoperation>ModeShiftResponse</vcn:ijoperation><br>
      <vcn:ijresponse>OK</vcn:ijresponse><br>
      <vcn:ijresponse_detail/><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
ScanGear starts a scan with the following command sequece:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"><br>
  <ivec:contents><br>
    <ivec:operation>StartJob</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
      <ivec:jobID>00000001</ivec:jobID><br>
      <ivec:bidi>1</ivec:bidi><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
response:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"><br>
  <ivec:contents><br>
    <ivec:operation>StartJobResponse</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
      <ivec:response>OK</ivec:response><br>
      <ivec:response_detail/><br>
      <ivec:jobID>00000001</ivec:jobID><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
command:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"<br>
xmlns:vcn="<a href="http://www.canon.com/ns/cmd/2008/07/canon/" target="_blank">http://www.canon.com/ns/cmd/2008/07/canon/</a>"><br>
  <ivec:contents><br>
    <ivec:operation>VendorCmd</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
    <ivec:jobID>00000001</ivec:jobID><br>
    <vcn:ijoperation>ModeShift</vcn:ijoperation><br>
    <vcn:ijmode>1</vcn:ijmode><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
response: some data<br>
<br>
command:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"><br>
  <ivec:contents><br>
    <ivec:operation>EndJob</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
      <ivec:jobID>00000001</ivec:jobID><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
response:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<cmd xmlns:ivec="<a href="http://www.canon.com/ns/cmd/2008/07/common/" target="_blank">http://www.canon.com/ns/cmd/2008/07/common/</a>"><br>
  <ivec:contents><br>
    <ivec:operation>EndJobResponse</ivec:operation><br>
    <ivec:param_set servicetype="scan"><br>
      <ivec:response>OK</ivec:response><br>
      <ivec:response_detail/><br>
      <ivec:jobID>00000001</ivec:jobID><br>
    </ivec:param_set><br>
  </ivec:contents><br>
</cmd><br>
<br>
SANE does not send the VendorCmd. Do you think incorporating the missing<br>
command sequence could solve the issue? I do not want to damage my MG7550 with<br>
wrong commands, that's why I am reluctant to experiment with code-changes.<br>
<br>
Many thanks for your help<br>
Martin<br>
<br>
Am Sonntag, 11. Januar 2015, 14.52:06 schrieb Troels Thomsen:<br>
<div class="HOEnZb"><div class="h5">> Martin,<br>
> ad 1)<br>
> I'm sorry I have no understanding of the protocol what so ever, and have<br>
> spent max ½ hour in the code, to see what the patches I was sent, did.<br>
> ad 2)<br>
> I agree , this IS strange ...<br>
> ad 3)<br>
> I agree , this IS strange ...<br>
> ad 4)<br>
> Frankly, you have so many strange phenomenons going on, so ... you could<br>
> try....<br>
> (not that this a satisfactory solution at all...)<br>
><br>
> At this point, I think I would try to test it on another computer, to see<br>
> if all these really strange phenomenons (e.g. 'enabling Ethernet on the<br>
> device, makes usb scanning work' ) somehow is related to hardware or the<br>
> Linux installation. Just to make sure....<br>
><br>
> Sorry, its not much help.<br>
><br>
> /Troels<br>
><br>
> 2015-01-07 23:26 GMT+01:00 Martin <<a href="mailto:martin.gu@intergga.ch">martin.gu@intergga.ch</a>>:<br>
> > Troels<br>
> ><br>
> > I agree with you, we have to be careful on the test methodology.<br>
> > My knowledge in c is limited since I wrote my last c-program about 20<br>
> > years<br>
> > ago. But I could try.<br>
> > But before trying to modify the source code I have some questions:<br>
> ><br>
> > 1) Did you analyze the USB-calls of the Canon-software on windows and<br>
> > compare<br>
> > them to the SANE-sequence? What is the meaning of the first sequece 55 53<br>
> > 42<br>
> > 43 F0 36 04 0B...?<br>
> ><br>
> > 2) What is the difference between scanimage and xsane? Is it only the<br>
> > timing?<br>
> ><br>
> > 3) What is the difference between xsane and the gimp plugin? Is it only<br>
> > the<br>
> > timing? Why does the gimp plugin only work after xsane?<br>
> ><br>
> > 4) Would it be worth while to make a few tests with the printer mode, i.e.<br>
> > to<br>
> > try to start xsane after printing?<br>
> ><br>
> > Martin<br>
> ><br>
> > > > If the scanner does not work on a USB port it is quite unlikely to<br>
> > > > work<br>
> > > > over the network: the bjnp network code just carries the USB exchange<br>
> > > > over IP.<br>
> > ><br>
> > > I mostly agree, though Rolf asks specifically for the USB trace, because<br>
> > > (as I understood) it differs slightly from the IP traces I had already<br>
> > > submitted.<br>
> > > (fix usb first , then patch it for IP, if need be)<br>
> > ><br>
> > > One advice:<br>
> > > Be very paranoid on your test methodology. I looked stupid a couple of<br>
> > > times (sorry Rolf!), because I was fooled by the USB interface and/or<br>
> > > the<br>
> > > Canon firmware.<br>
> > > When testing a new patch, I tried some settings in random (DPI ,<br>
> > > colour/black-n-white etc) and reported the success/failures.<br>
> > > BUT the thing is, that the Canon MF8230 firmware can go into bad-mode,<br>
> ><br>
> > when<br>
> ><br>
> > > it has received some strange commands, and the following scans might<br>
> > > work<br>
> > > slightly strange for that reason. I was even fooled by the phenomenon,<br>
> ><br>
> > that<br>
> ><br>
> > > scanning a 1 by 1 cm square works, but scanning the whole A4 didn't.<br>
> ><br>
> > (Well<br>
> ><br>
> > > ... there WERE some differences between what worked through USB and IP<br>
> > > at<br>
> > > this point in time. I'm guessing it was something timing-critical, but I<br>
> > > never dissected that last patch from Rolf which fixed it)<br>
> > ><br>
> > > So I started rebooting the scanner whenever I was in doubt.<br>
> > > (disconnect/connect the USB interface plus move Cannon unit from to<br>
> > > "printer mode" and back to "scanner mode" was normally enough)<br>
> > ><br>
> > ><br>
> > > So what do we do? / What is status?<br>
> > ><br>
> > > Since scanning CAN work , one could argue the back-end DOES send all the<br>
> > > necessary+correct commands to the printer.<br>
> > > If timing is the critical parameter (backed by the fact that something<br>
> > > as<br>
> > > stupid as enabling IP on the printer-side, suddenly makes it work now<br>
> > > and<br>
> > > then), maybe we should try to insert an ugly time-delay before every USB<br>
> > > write? If that changes anything to the better, we can start to hunt down<br>
> > > where it is really necessary, and hopefully find a nicer approach<br>
> > > afterwards?<br>
> > ><br>
> > > Martin, are you comfortable with pulling the code out of the GIT<br>
> > > repository, compile , install and experiment with inserting delays?<br>
> > > I think there is something called "SANE interface USB" sanei_usb.c/h.<br>
> ><br>
> > That<br>
> ><br>
> > > was maybe a place to start.<br>
> > ><br>
> > > Louis, what is the odds of success for this approach?<br>
> > ><br>
> > > :-)<br>
> > ><br>
> > > /Troels<br>
> > ><br>
> > > 2015-01-03 20:43 GMT+01:00 Martin <<a href="mailto:martin.gu@intergga.ch">martin.gu@intergga.ch</a>>:<br>
> > > > Am Samstag, 3. Januar 2015, 11.16:10 schrieb Louis Lagendijk:<br>
> > > > > On Fri, <a href="tel:2015-01-02" value="+4520150102">2015-01-02</a> at 22:59 +0100, Martin wrote:<br>
> > > > > > Hi Troels<br>
> > > > > ><br>
> > > > > > > *Is it USB3 (on the computer)?<br>
> > > > > ><br>
> > > > > > no, it is USB2<br>
> > > > > ><br>
> > > > > > > *Do you have access to another computer, where you can try it -<br>
> ><br>
> > Does<br>
> ><br>
> > > > it<br>
> > > ><br>
> > > > > > > work excactly the same strange way ... ?<br>
> > > > > ><br>
> > > > > > No,I don't have access to another computer. But I have also<br>
> ><br>
> > Windows 7<br>
> ><br>
> > > > > > installed. With Windows 7 and the Canon-software it works OK.<br>
> > > > > ><br>
> > > > > > > *Does unit have ethernet connection / can you try that way?<br>
> > > > > ><br>
> > > > > > Yes. With the ethernet connection the printer works. Thus the<br>
> > > ><br>
> > > > IP-address<br>
> > > ><br>
> > > > > > below is correct.<br>
> > > > > > But I cannot access the scanner.<br>
> > > > > ><br>
> > > > > >     xsane pixma:MG7500_192.168.0.3<br>
> > > > > ><br>
> > > > > > results in the error message "illegal argument". Same thing with<br>
> > > > > ><br>
> > > > > >     scanimage --help -d bnjp://<a href="http://192.168.0.3:8612" target="_blank">192.168.0.3:8612</a><br>
> > > > ><br>
> > > > > Hi Martin<br>
> > > > > If the scanner does not work on a USB port it is quite unlikely to<br>
> ><br>
> > work<br>
> ><br>
> > > > > over the network: the bjnp network code just carries the USB<br>
> > > > > exchange<br>
> > > > > over IP.<br>
> > > > > Anyhow, you can find the name with scanimage -L (but make sure that<br>
> ><br>
> > port<br>
> ><br>
> > > > > 8612 is not blocked by a firewall (see the man-page for sane-pixma<br>
> > > > > in<br>
> > > > > the latest sources from GIT. you need to enable port 8612 for both<br>
> > > > > incoming and outgoing traffic.<br>
> > > > ><br>
> > > > > Louis<br>
> > > ><br>
> > > > Hi Louis<br>
> > > ><br>
> > > > The necessary ports on the firewall are open, yet scanimage -L does<br>
> > > > not<br>
> > > > find<br>
> > > > the scanner.<br>
> > > ><br>
> > > > But this lead to another discovery:<br>
> > > > I enabled LAN on the MG7550. And although the unit is connected via<br>
> ><br>
> > USB 2<br>
> ><br>
> > > > xsane sometimes works?! But with LAN disabled xsane never works<br>
> > > > without<br>
> > > > prior<br>
> > > > scanimage -T. And once xsane or scanimage -T failed all succeeding<br>
> ><br>
> > calls<br>
> ><br>
> > > > fail<br>
> > > > until the scanner is switched off and on again.<br>
> > > ><br>
> > > > Log of xsane working:<br>
> > > > [sanei_debug] Setting debug level of pixma to 21.<br>
> > > > [pixma] pixma is compiled with pthread support.<br>
> > > > [pixma] pixma version 0.17.13<br>
> > > > [pixma] pixma_collect_devices() found Canon PIXMA MG7500 Series at<br>
> > > > libusb:001:007<br>
> > > > [pixma] pixma_find_scanners() found 1 devices<br>
> > > > [pixma] pixma_collect_devices() found Canon PIXMA MG7500 Series at<br>
> > > > libusb:001:007<br>
> > > > [pixma] pixma_open(): Canon PIXMA MG7500 Series<br>
> > > > [pixma] *mp150_open***** This is a generation 4 scanner.  *****<br>
> > > > [pixma] [pixma] Reader task id=139772037314304 (threaded)<br>
> > > > Reader task started<br>
> > > > [pixma]<br>
> > > > [pixma] pixma_scan(): start<br>
> > > > [pixma]   line_size=4605 image_size=4895115 channels=3 depth=8<br>
> > > > [pixma]   dpi=300x300 offset=(0,0) dimension=1535x1063<br>
> > > > [pixma]   gamma_table=0x1f201e0 source=0<br>
> > > > [pixma]   threshold=127 threshold_curve=0<br>
> > > > [pixma]   ADF page count: 0<br>
> > > > [pixma] OUT  T=58.770 len=288<br>
> > > > [pixma]  00000000:3c 3f 78 6d 6c 20 76 65  72 73 69 6f 6e 3d 22 31<br>
> > > > [pixma]  00000010:2e 30 22 20 65 6e 63 6f  64 69 6e 67 3d 22 75 74<br>
> > > > ...<br>
> > > > Log of xsane not working:<br>
> > > > pixma] pixma_collect_devices() found Canon PIXMA MG7500 Series at<br>
> > > > libusb:001:008<br>
> > > > [pixma] pixma_find_scanners() found 1 devices<br>
> > > > [pixma] pixma_collect_devices() found Canon PIXMA MG7500 Series at<br>
> > > > libusb:001:008<br>
> > > > [pixma] pixma_open(): Canon PIXMA MG7500 Series<br>
> > > > [pixma] *mp150_open***** This is a generation 4 scanner.  *****<br>
> > > > [pixma] INTR T=1.249 len=32<br>
> > > > [pixma]  00000000:00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00<br>
> > > > [pixma]  00000010:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00<br>
> > > > [pixma]<br>
> > > > [pixma] Sending time: '15/01/03 15:32'<br>
> > > > [pixma] OUT  T=1.250 len=36<br>
> > > > [pixma]  00000000:eb 80 00 00 00 00 00 00  00 00 00 00 00 00 00 14<br>
> > > > [pixma]  00000010:31 35 2f 30 31 2f 30 33  20 31 35 3a 33 32 00 00<br>
> > > > [pixma]  00000020:00 00 00 53<br>
> > > > [pixma]<br>
> > > > [pixma] IN   T=21.251 len=-9<br>
> > > > [pixma]   ERROR: ETIMEDOUT<br>
> > > > [pixma]<br>
> > > > ...<br>
> > > ><br>
> > > > Martin<br>
> > > ><br>
> > > ><br>
> > > > --<br>
> > > > sane-devel mailing list: <a href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a><br>
> > > > <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel</a><br>
> > > > Unsubscribe: Send mail with subject "unsubscribe your_password"<br>
> > > ><br>
> > > >              to <a href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a><br>
> ><br>
> > --<br>
> > sane-devel mailing list: <a href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a><br>
> > <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel</a><br>
> > Unsubscribe: Send mail with subject "unsubscribe your_password"<br>
> ><br>
> >              to <a href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a><br>
<br>
</div></div></blockquote></div><br></div>