Re: [sane-devel] Canon ImageClass MF644Cdw

2019-11-04 Thread Louis Lagendijk
hi David, 
Can you please try to load the sane debug symbols: It would be good to
see where in the backend
this line "0x6D08054: ??? (in /usr/lib/x86_64-linux-gnu/sane/libsane-
pixma.so.1.0.28)"  is erroring?

Thanks, Louis

On Sat, 2019-10-05 at 13:48 -0700, David McMahon wrote:
> Thanks Kip.  I've tried a few more things to try to isolate.
> First
> 
> $  cat /etc/lsb-release
> DISTRIB_ID=LinuxMint
> DISTRIB_RELEASE=19
> DISTRIB_CODENAME=tara
> DISTRIB_DESCRIPTION="Linux Mint 19 Tara"
> 
> Commenting pixma out of dll.conf avoids the buffer overflow but then
> of course the scanner is not found.
> 
> $ scanimage -L
> 
> No scanners were identified. If you were expecting something
> different,
> check that the scanner is plugged in, turned on and detected by the
> sane-find-scanner tool (if appropriate). Please read the
> documentation
> which came with this software (README, FAQ, manpages).
> 
> valgrind might be of use here?  Here's a rum with pixma uncommented
> in dll.conf:
> 
> $ valgrind scanimage -L
> ==16057== Memcheck, a memory error detector
> ==16057== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et
> al.
> ==16057== Using Valgrind-3.13.0 and LibVEX; rerun with -h for
> copyright info
> ==16057== Command: scanimage -L
> ==16057== 
> *** buffer overflow detected ***: scanimage terminated
> ==16057== 
> ==16057== Process terminating with default action of signal 6
> (SIGABRT)
> ==16057==at 0x5526E97: raise (raise.c:51)
> ==16057==by 0x5528800: abort (abort.c:79)
> ==16057==by 0x5571896: __libc_message (libc_fatal.c:181)
> ==16057==by 0x561CCFE: __fortify_fail_abort (fortify_fail.c:33)
> ==16057==by 0x561CD20: __fortify_fail (fortify_fail.c:44)
> ==16057==by 0x561AA0F: __chk_fail (chk_fail.c:28)
> ==16057==by 0x5619F28: _IO_str_chk_overflow (vsprintf_chk.c:31)
> ==16057==by 0x5576493: _IO_default_xsputn (genops.c:417)
> ==16057==by 0x5544FEA: vfprintf (vfprintf.c:1643)
> ==16057==by 0x5619FCA: __vsprintf_chk (vsprintf_chk.c:82)
> ==16057==by 0x5619EF9: __sprintf_chk (sprintf_chk.c:31)
> ==16057==by 0x6D08054: ??? (in /usr/lib/x86_64-linux-
> gnu/sane/libsane-pixma.so.1.0.28)
> ==16057== 
> ==16057== HEAP SUMMARY:
> ==16057== in use at exit: 23,779 bytes in 57 blocks
> ==16057==   total heap usage: 2,975 allocs, 2,918 frees, 1,105,998
> bytes allocated
> ==16057== 
> ==16057== LEAK SUMMARY:
> ==16057==definitely lost: 0 bytes in 0 blocks
> ==16057==indirectly lost: 0 bytes in 0 blocks
> ==16057==  possibly lost: 10,968 bytes in 30 blocks
> ==16057==still reachable: 12,811 bytes in 27 blocks
> ==16057== suppressed: 0 bytes in 0 blocks
> ==16057== Rerun with --leak-check=full to see details of leaked
> memory
> ==16057== 
> ==16057== For counts of detected and suppressed errors, rerun with:
> -v
> ==16057== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from
> 0)
> Aborted
> 
> On Sat, Oct 5, 2019 at 1:21 PM Kip Shaffer 
> wrote:
> > Hi David!  Here is my output from the same command.  I have nothing
> > in my pixma.conf file.
> > SANE_DEBUG_BJNP=5 scanimage -L 2>&1
> > [sanei_debug] Setting debug level of bjnp to 5.
> > [bjnp] sanei_bjnp_find_devices, pixma backend version: 0.23.4
> > [bjnp] sanei_bjnp_find_devices: No devices specified in
> > configuration file.
> > [bjnp] sanei_bjnp_find_devices: Added all configured scanners, now
> > do auto detection...
> > [bjnp] prepare_socket: lo is not a valid IPv4 interface,
> > skipping...
> > [bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast,
> > socket = 39
> > [bjnp] prepare_socket: lo is not a valid IPv6 interface,
> > skipping...
> > [bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast,
> > socket = 40
> > [bjnp] sanei_bjnp_find_devices: Select returned, time left
> > 0.42
> > [bjnp] sanei_find_devices: Discover response:
> > [bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10 
> > [bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f 
> > [bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or
> > service not known
> > [bjnp]
> > bjnp_allocate_device(mfnp://192.168.1.111:8610/timeout=1) 0
> > [bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or
> > service not known
> > [bjnp] setup_udp_socket: Setting up a UDP socket, dest:
> > 192.168.1.111  port 8610
> > [bjnp] bjnp_get_scanner_mac_address: Discover response:
> > [bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10 
> > [bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f 
> > [bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
> > 192.168.1.111:8610
> > [bjnp] get_scanner_id: Get scanner identity
> > [bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00 
> > [bjnp] setup_udp_socket: Setting up a UDP socket, dest:
> > 192.168.1.111  port 8610
> > [bjnp] get_scanner_id: scanner identity:
> > [bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a 
> > 

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-11-04 Thread Louis Lagendijk
On Thu, 2019-10-31 at 16:31 -0700, Ralph Little wrote:
> Hi,
> 
> On Thu, Oct 31, 2019 at 4:12 PM David McMahon 
> wrote:
> > Thanks for the clue!  Looking on that on the settings page of the
> > printer, the hostname is the default of "Canoncbcab3" which seems
> > harmless enough.  I changed it to "Can" to see if that changed
> > anything, but still getting the buffer overflow.
> > If you have a link handy to that part of the code, can you point me
> > to it?  Maybe it's something else right after the strcpy().
> >  
> 
> Hmm, that might have been slightly misleading.
> 
> I'm looking at backend/pixma_bjnp.c at line 801, which is where we
> see the last successful debug message from the function
> get_scanner_id():
> 
> "get_scanner_id: Scanner model = "
> 
> 
> It returns to the only place it is called, line 1817 in
> add_scanner().
> We don't get the error message (at line 1819) so it must next call
> the function determine_scanner_serial() which attempts to determine a
> "serial number" for the scanner.
> This could be one of a selection of things, so that might be the
> culprit, since it does some strcpy() calls in there, although we
> don't have any debug messages in there, so we don't really know how
> far it got before the buffer overrun struck :(
> 
> If it were me chasing this, I would add some more dbg messages to see
> how far it got, perhaps one after the call to
> determine_scanner_serial() to see if it returned to start off with.
> If it didn't some dbg in the function determine_scanner_serial() to
> see what it decided.
> 
> Cheers,
> Ralph

Could be, but it may also be caused by the call to
parse_IEEE1284_to_model at the end of get_scanner_id. The use of
BJNP_IEEE1284_MAX in the strcpy (already replaced by a mecpy)  may be
incorrect there. It probably should be a strlen(tok + 4). The next line
should be removed, so  the code reads (with a bit of readability
improvement:

tatic intparse_IEEE1284_to_model (char *scanner_id, char *model){/* *
parses the  IEEE1284  ID of the scanner to retrieve make and model * of
the scanner * Returns: 0 = not found *  1 = found, model is
set */
  char s[BJNP_IEEE1284_MAX];  char *tok;  char * model_str;
  strncpy (s, scanner_id, BJNP_IEEE1284_MAX);  s[BJNP_IEEE1284_MAX - 1]
= '\0';  model[0] = '\0';
  tok = strtok (s, ";");  while (tok != NULL){  /* MDL contains
make and model */
  if (strncmp (tok, "MDL:", 4) == 0){  model_str =
tok +4;  memcpy (model, model_str,
strlen(model_str));  return 1;}  tok = strtok
(NULL, ";");}  return 0;}
I will include this in my next push to git
BR, Louis



Re: [sane-devel] Canon ImageClass MF644Cdw

2019-11-02 Thread Louis Lagendijk
On Sat, 2019-11-02 at 17:41 +0100, Rolf Bensch wrote:
> Hi Louis,
> 
> Do you have any ideas about this issue?
> 
> Cheers,
> Rolf
> 
I have this on my list for next week: I am having a few issues with my
Maxify 5450 that I need to fix first to get a stable platform to test
(although my ethernet switches may be causing some of the issues). once
that is done I am planning to look into open Sane/BJNP issues.

It would help if I could get a wireshark dump so I can try to
understand what is happening


BR, Louis 
> Am 01.11.19 um 00:31 schrieb Ralph Little:
> > Hi,
> > 
> > On Thu, Oct 31, 2019 at 4:12 PM David McMahon  > > wrote:
> > 
> > 
> > Thanks for the clue!  Looking on that on the settings page of
> > the
> > printer, the hostname is the default of "Canoncbcab3" which
> > seems
> > harmless enough.  I changed it to "Can" to see if that changed
> > anything, but still getting the buffer overflow.
> > If you have a link handy to that part of the code, can you
> > point me
> > to it?  Maybe it's something else right after the strcpy().
> >  
> > 
> > 
> > Hmm, that might have been slightly misleading.
> > 
> > I'm looking at backend/pixma_bjnp.c at line 801, which is where we
> > see
> > the last successful debug message from the function
> > get_scanner_id():
> > 
> > "get_scanner_id: Scanner model = "
> > 
> > It returns to the only place it is called, line 1817 in
> > add_scanner().
> > We don't get the error message (at line 1819) so it must next call
> > the
> > function determine_scanner_serial() which attempts to determine a
> > "serial number" for the scanner.
> > This could be one of a selection of things, so that might be the
> > culprit, since it does some strcpy() calls in there, although we
> > don't
> > have any debug messages in there, so we don't really know how far
> > it got
> > before the buffer overrun struck :(
> > 
> > If it were me chasing this, I would add some more dbg messages to
> > see
> > how far it got, perhaps one after the call to
> > determine_scanner_serial()
> > to see if it returned to start off with. If it didn't some dbg in
> > the
> > function determine_scanner_serial() to see what it decided.
> > 
> > Cheers,
> > Ralph





Re: [sane-devel] Canon ImageClass MF644Cdw

2019-11-02 Thread Rolf Bensch
Hi Louis,

Do you have any ideas about this issue?

Cheers,
Rolf

Am 01.11.19 um 00:31 schrieb Ralph Little:
> Hi,
> 
> On Thu, Oct 31, 2019 at 4:12 PM David McMahon  > wrote:
> 
> 
> Thanks for the clue!  Looking on that on the settings page of the
> printer, the hostname is the default of "Canoncbcab3" which seems
> harmless enough.  I changed it to "Can" to see if that changed
> anything, but still getting the buffer overflow.
> If you have a link handy to that part of the code, can you point me
> to it?  Maybe it's something else right after the strcpy().
>  
> 
> 
> Hmm, that might have been slightly misleading.
> 
> I'm looking at backend/pixma_bjnp.c at line 801, which is where we see
> the last successful debug message from the function get_scanner_id():
> 
> "get_scanner_id: Scanner model = "
> 
> It returns to the only place it is called, line 1817 in add_scanner().
> We don't get the error message (at line 1819) so it must next call the
> function determine_scanner_serial() which attempts to determine a
> "serial number" for the scanner.
> This could be one of a selection of things, so that might be the
> culprit, since it does some strcpy() calls in there, although we don't
> have any debug messages in there, so we don't really know how far it got
> before the buffer overrun struck :(
> 
> If it were me chasing this, I would add some more dbg messages to see
> how far it got, perhaps one after the call to determine_scanner_serial()
> to see if it returned to start off with. If it didn't some dbg in the
> function determine_scanner_serial() to see what it decided.
> 
> Cheers,
> Ralph



Re: [sane-devel] Canon ImageClass MF644Cdw

2019-11-02 Thread Kip Shaffer
Thank you Louis!  As mentioned further back in the thread, Rolf's latest
PPA worked well without anything in the file 'pixma.conf' (except for an
error generated at the end of reading from the sheet feeder).  But I
thought it might be helpful to test the mfnp:// protocol directive for the
sake of completeness.  It did not seem to work.

To start, here is what happens with an empty pixma.conf file:
$ sudo scanimage -L
device `pixma:MF642C/643C/644C_192.168.1.111' is a CANON Canon i-SENSYS
MF640 Series multi-function peripheral

Next, we will add this to pixma.conf: mfnp://MF640_192.168.1.111
$ sudo scanimage -L
[bjnp] bjnp_allocate_device: ERROR - Cannot resolve host:
MF640_192.168.1.111 port 8612
(it then goes on to find the printer anyway on its own)

This is curious for a couple reasons.  1) Why does the error start with
[bjnp] when I specified mfnp?  2) Why does it think that MF640_ is part of
the host name when the documentation shows putting the model number ahead
of the IP address?

Lastly, we will attempt to fix point 2 above by using only the IP
address: mfnp://192.168.1.111
$ sudo scanimage -L
[bjnp] udp_command: ERROR - no data received (timeout = 1)
[bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this
scanner
[bjnp] udp_command: ERROR - no data received (timeout = 1)
[bjnp] add_scanner: ERROR - Cannot read scanner make & model: mfnp://
192.168.1.111:8612/timeout=1
(again, it goes on to find the printer anyway on its own, presumably with
no help from the pixma.conf file)

Again, the output is prefixed with [bjnp], and it doesn't seem like it is
able to communicate correctly.  Let's generate some debugging:
$ sudo SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.25.0
[bjnp] sanei_bjnp_find_devices: Adding scanner from pixma.conf: mfnp://
192.168.1.111
[bjnp] bjnp_allocate_device(mfnp://192.168.1.111:8612/timeout=1) 0
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this
scanner
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
192.168.1.111:8612
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] get_scanner_id: ERROR - Failed to retrieve scanner identity:
[bjnp] add_scanner: ERROR - Cannot read scanner make & model: mfnp://
192.168.1.111:8612/timeout=1
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...

It continues with the auto detection (included for reference)
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 39
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 40
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.46
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] bjnp_allocate_device(mfnp://192.168.1.111:8610/timeout=1) 1
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
192.168.1.111:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-31 Thread Ralph Little
Hi,

On Thu, Oct 31, 2019 at 4:12 PM David McMahon  wrote:

>
> Thanks for the clue!  Looking on that on the settings page of the printer,
> the hostname is the default of "Canoncbcab3" which seems harmless enough.
> I changed it to "Can" to see if that changed anything, but still getting
> the buffer overflow.
> If you have a link handy to that part of the code, can you point me to
> it?  Maybe it's something else right after the strcpy().
>
>

Hmm, that might have been slightly misleading.

I'm looking at backend/pixma_bjnp.c at line 801, which is where we see the
last successful debug message from the function get_scanner_id():

"get_scanner_id: Scanner model = "

It returns to the only place it is called, line 1817 in add_scanner().
We don't get the error message (at line 1819) so it must next call the
function determine_scanner_serial() which attempts to determine a "serial
number" for the scanner.
This could be one of a selection of things, so that might be the culprit,
since it does some strcpy() calls in there, although we don't have any
debug messages in there, so we don't really know how far it got before the
buffer overrun struck :(

If it were me chasing this, I would add some more dbg messages to see how
far it got, perhaps one after the call to determine_scanner_serial() to see
if it returned to start off with. If it didn't some dbg in the function
determine_scanner_serial() to see what it decided.

Cheers,
Ralph


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-31 Thread David McMahon
On Thu, Oct 31, 2019 at 2:56 PM Ralph Little  wrote:

> Hi David,
>
> On Thu, Oct 31, 2019 at 2:45 PM David McMahon  wrote:
>
>> ...
>> [bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
>> [bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
>> [bjnp] get_scanner_id: Scanner identity string =
>> MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
>> MF642C/643C/644C; - length = 90
>> [bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
>> *** buffer overflow detected ***: scanimage terminated
>> Aborted
>>
>>
> Having a quick look at the code, it looks like the very next thing the
> backend does is try to generate a "serial number" by using the hostname.
> Involves an unprotected strcpy().
> Does your scanner machine have a particularly long hostname?
>

Thanks for the clue!  Looking on that on the settings page of the printer,
the hostname is the default of "Canoncbcab3" which seems harmless enough.
I changed it to "Can" to see if that changed anything, but still getting
the buffer overflow.
If you have a link handy to that part of the code, can you point me to it?
Maybe it's something else right after the strcpy().


>
> Cheers,
> Ralph
>


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-31 Thread Ralph Little
Hi David,

On Thu, Oct 31, 2019 at 2:45 PM David McMahon  wrote:

> ...
> [bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
> [bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
> [bjnp] get_scanner_id: Scanner identity string =
> MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
> MF642C/643C/644C; - length = 90
> [bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
> *** buffer overflow detected ***: scanimage terminated
> Aborted
>
>
Having a quick look at the code, it looks like the very next thing the
backend does is try to generate a "serial number" by using the hostname.
Involves an unprotected strcpy().
Does your scanner machine have a particularly long hostname?

Cheers,
Ralph


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-31 Thread David McMahon
So close!   Thanks to Kip and Rolf for updating the package.

Still wondering if anyone else has hit this problem on LinuxMint or
elsewhere.
I'm still stuck here with a non-functional scanimage / simplescan.

Anyone have any thoughts/pointers/ideas?

$ SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.24.1
[bjnp] sanei_bjnp_find_devices: No devices specified in configuration file.
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 9
[bjnp] prepare_socket: docker0 is IPv4 capable, sending broadcast, socket =
10
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 11
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.40
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.499986
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.339876
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 0
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
canoncbcab3.lan:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
[bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
[bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
[bjnp] get_scanner_id: Scanner identity string =
MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
MF642C/643C/644C; - length = 90
[bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
*** buffer overflow detected ***: scanimage terminated
Aborted

On Sat, Oct 5, 2019 at 1:48 PM David McMahon  wrote:

> Thanks Kip.  I've tried a few more things to try to isolate.
>
> First
>
> $  cat /etc/lsb-release
> DISTRIB_ID=LinuxMint
> DISTRIB_RELEASE=19
> DISTRIB_CODENAME=tara
> DISTRIB_DESCRIPTION="Linux Mint 19 Tara"
>
> Commenting pixma out of dll.conf avoids the buffer overflow but then of
> course the scanner is not found.
>
> $ scanimage -L
>
> No scanners were identified. If you were expecting something different,
> check that the scanner is plugged in, turned on and detected by the
> sane-find-scanner tool (if appropriate). Please read the documentation
> which came with this software (README, FAQ, manpages).
>
> valgrind might be of use here?  Here's a rum with pixma uncommented in
> dll.conf:
>
> $ valgrind scanimage -L
> ==16057== Memcheck, a memory error detector
> ==16057== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==16057== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright
> info
> ==16057== Command: scanimage -L
> ==16057==
> *** buffer overflow detected ***: scanimage terminated
> ==16057==
> ==16057== Process terminating with default action of signal 6 (SIGABRT)
> ==16057==at 0x5526E97: raise (raise.c:51)
> ==16057==by 0x5528800: abort (abort.c:79)
> ==16057==by 0x5571896: __libc_message (libc_fatal.c:181)
> ==16057==by 0x561CCFE: __fortify_fail_abort (fortify_fail.c:33)
> ==16057==by 0x561CD20: __fortify_fail (fortify_fail.c:44)
> ==16057==by 0x561AA0F: __chk_fail (chk_fail.c:28)
> ==16057==by 0x5619F28: _IO_str_chk_overflow (vsprintf_chk.c:31)
> ==16057==by 0x5576493: _IO_default_xsputn (genops.c:417)
> ==16057==by 0x5544FEA: vfprintf (vfprintf.c:1643)
> ==16057==by 0x5619FCA: __vsprintf_chk (vsprintf_chk.c:82)
> ==16057==by 0x5619EF9: __sprintf_chk (sprintf_chk.c:31)
> ==16057==by 0x6D08054: ??? (in
> 

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-11 Thread Rolf Bensch
Hi Ken,

Am 07.10.19 um 19:16 schrieb ken:

[snip]
> Does scanning also work from the flatbed (platen) and via the manual
> feed slot (aka Stack Bypass)? 

I've senn this working with another ImageClass scanner. Maybe somebody
else can confirm this?

> According to 
> https://www.usa.canon.com/internet/portal/us/home/support/details/printers/color-laser/color-imageclass-mf644cdw/?tab=richtexteditortab_5417439e-0c5b-4a4c-8b4f-54ba103c6eba,
>  the scan resolutions for this unit are 300 x 600 and 600 x 600 dpi.  It 
> would, of course, be really nice to achieve higher resolutions.  Are the 
> Canon-stated resolutions perhaps limited by their own Windows and Mac 
> software?

The scan resolutions are restricted by hardware. If you need another
scan resolution you must use an external image converter program. But
you won't win anything if you increase the scan resolution. No program
can create contents which isn't available on the 600dpi scan.

[snip]

> What document formats are available for scanner output (on Linux of course)?

At the frontend you can set the desired scan area. E.g. in xsane you can
set the scan borders in a preview window.

[snip]

Hope this helps.

Cheers,
Rolf






Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-07 Thread ken
On 10/5/19 11:13 AM, Kip Shaffer wrote:
> I just updated from Rolf's PPA, and I am very happy to say that I can
> now detect and scan from my Canon ImageClass MF644Cdw over the
> network.  I confirmed it can scan in resolutions of 75, 150, 300, 600,
> 1200, and 2400 for both Text and Color modes.  It successfully read 2
> sided multiple pages from the sheet feeder.  
>
> The only issue I saw (same as earlier) is that when it completes a job
> reading from the sheet feeder, SimpleScan pops up a dialog box stating
> "Failed to Scan" "Error communicating with scanner."   This does not
> affect the job... all pages were scanned successfully. 

As I'm in the market for one, it's really great to hear about a new and
good quality printer/scanner which is working with Linux.  I still have
a few questions about it though, if people would be so kind as to give
information about the Canon Color imageCLASS MF644Cdw:

Does scanning also work from the flatbed (platen) and via the manual
feed slot (aka Stack Bypass)?

According to
https://www.usa.canon.com/internet/portal/us/home/support/details/printers/color-laser/color-imageclass-mf644cdw/?tab=richtexteditortab_5417439e-0c5b-4a4c-8b4f-54ba103c6eba,
the scan resolutions for this unit are 300 x 600 and 600 x 600 dpi.  It
would, of course, be really nice to achieve higher resolutions.  Are the
Canon-stated resolutions perhaps limited by their own Windows and Mac
software?

Can copying be done with this machine without a PC being connected to it?

What document formats are available for scanner output (on Linux of course)?

Finally (and sorry for the slight OTness), do all the printing functions
of this model work for Linux?  (Neither the Linux Foundation
OpenPrinting.org site nor tldp.org list it.)

Thanks much for your help.





Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-05 Thread Kip Shaffer
Hi David!  Here is my output from the same command.  I have nothing in my
pixma.conf file.

SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.23.4
[bjnp] sanei_bjnp_find_devices: No devices specified in configuration file.
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 39
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 40
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.42
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] bjnp_allocate_device(mfnp://192.168.1.111:8610/timeout=1) 0
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
192.168.1.111:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
[bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
[bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
[bjnp] get_scanner_id: Scanner identity string =
MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
MF642C/643C/644C; - length = 90
[bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
[bjnp] add_scanner: New scanner added: mfnp://
192.168.1.111:8610/timeout=1, serial 192.168.1.111, mac address:
f4a997c93d62.
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.47
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] bjnp_allocate_device(mfnp://192.168.1.111:8610/timeout=1) 1
[bjnp] get_scanner_name: Name for 192.168.1.111 not found : Name or service
not known
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 f4 a9  97 c9 3d 62 c0 a8 01 6f
[bjnp] add_scanner: Scanner at mfnp://192.168.1.111:8610/timeout=1 was
added before, good!
[bjnp] sanei_find_devices: scanner discovery finished...
device `pixma:MF642C/643C/644C_192.168.1.111' is a CANON Canon i-SENSYS
MF640 Series multi-function peripheral


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-05 Thread David McMahon
Hi Kip, Rolf

I've got the latest and still unable to connect.  Did you need to resolve
anything like this?  Are you just adding a bjnp line to pixma.conf?

$ SANE_DEBUG_BJNP=5 scanimage -L 2>&1
[sanei_debug] Setting debug level of bjnp to 5.
[bjnp] sanei_bjnp_find_devices, pixma backend version: 0.23.4
[bjnp] sanei_bjnp_find_devices: Adding scanner from pixma.conf: bjnp://
192.168.86.39
[bjnp] bjnp_allocate_device(bjnp://192.168.86.39:8612/timeout=1) 0
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this
scanner
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
192.168.86.39:8612
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :42 4a 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8612
[bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no data
received (timeout = 1)
[bjnp] get_scanner_id: ERROR - Failed to retrieve scanner identity:
[bjnp] add_scanner: ERROR - Cannot read scanner make & model: bjnp://
192.168.86.39:8612/timeout=1
[bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do auto
detection...
[bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, socket = 9
[bjnp] prepare_socket: docker0 is IPv4 capable, sending broadcast, socket =
10
[bjnp] prepare_socket: lo is not a valid IPv6 interface, skipping...
[bjnp] prepare_socket: eth0 is IPv6 capable, sending broadcast, socket = 11
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.499969
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 1
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
canoncbcab3.lan:8610
[bjnp] get_scanner_id: Get scanner identity
[bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] get_scanner_id: scanner identity:
[bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
[bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
[bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
[bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
[bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
[bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
[bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
*** buffer overflow detected ***: scanimage terminated
[bjnp] get_scanner_id: Scanner identity string =
MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
MF642C/643C/644C; - length = 90
[bjnp] get_scanner_id: Scanner model = MF642C/643C/644C

On Sat, Oct 5, 2019 at 8:13 AM Kip Shaffer  wrote:

> I just updated from Rolf's PPA, and I am very happy to say that I can now
> detect and scan from my Canon ImageClass MF644Cdw over the network.  I
> confirmed it can scan in resolutions of 75, 150, 300, 600, 1200, and 2400
> for both Text and Color modes.  It successfully read 2 sided multiple pages
> from the sheet feeder.
>
> The only issue I saw (same as earlier) is that when it completes a job
> reading from the sheet feeder, SimpleScan pops up a dialog box stating
> "Failed to Scan" "Error communicating with scanner."   This does not affect
> the job... all pages were scanned successfully.
>
> Thank you everyone!  I am happy to continue tests if there is energy for
> debugging the error message!
>
> -Kip
>
> On Fri, Oct 4, 2019 at 3:33 PM Rolf Bensch  wrote:
>
>> Hi,
>>
>> It seems that the network model differs between sources and network
>> scanner discovery. I just fixed it. It will be available from my ppa

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-05 Thread Kip Shaffer
Just a bit more data about the end of the job dialog box - Here is the last
bit of output that happens right after the job finishes from
SANE_DEBUG_BJNP=5 simple-scan 2>&1

[bjnp] bjnp_recv_header: TCP response header(payload data = 4 bytes):
[bjnp]  :4d 46 4e 50 82 21 00 00  10 9d 00 01 00 00 00 04
[bjnp] bjnp_recv_data: read response payload (0x4 bytes max), buffer:
0x7f9ba3ac6934, start_pos: 0x0
[bjnp] bjnp_recv_data: Received TCP response payload (4 bytes):
[bjnp]  :00 00 00 0a
[bjnp] bjnp_set_timeout to 1000, but using minimum value 1
[bjnp] bjnp_read_bulk(dn=1, bufferptr=7f9bb81a6700, 0x2 = 2)
[bjnp] bjnp_read_bulk: 0x0 = 0 bytes available at start
[bjnp] bjnp_read_bulk: Already received 0x0 = 0 bytes, backend requested
0x2 = 2 bytes
[bjnp] bjnp_read_bulk: No (more) scanner data available, requesting more(
blocksize = 262152 = 40008
[bjnp] bjnp_send_read_req sending command
[bjnp]  :4d 46 4e 50 02 20 00 00  10 9e 00 01 00 00 00 00
[bjnp] bjnp_recv_header: receiving response header
[bjnp] bjnp_recv_header: TCP response header(payload data = 2 bytes):
[bjnp]  :4d 46 4e 50 82 20 00 00  10 9e 00 01 00 00 00 02
[bjnp] bjnp_read_bulk: In flight: 0x2 = 2 bytes available
[bjnp] bjnp_read_bulk: Try to read 0x2 = 2 (of max 0x2 = 2) bytes
[bjnp] bjnp_recv_data: read response payload (0x2 bytes max), buffer:
0x7f9bb81a6700, start_pos: 0x0
[bjnp] bjnp_recv_data: Received TCP response payload (2 bytes):
[bjnp]  :06 06
[bjnp] bjnp_read_bulk: Expected at most 2 bytes, received this time: 2
[bjnp] bjnp_read_bulk: OK: Returning 2 bytes, backend expexts 2
[bjnp] sanei_bjnp_deactivate (1)
[bjnp] bjnp_finish_job: Finish scanjob
[bjnp]  :4d 46 4e 50 02 11 00 00  10 9f 00 01 00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_finish_job: Finish scanjob response
[bjnp]  :4d 46 4e 50 82 11 00 00  10 9f 00 01 00 00 00 00
[bjnp] sanei_bjnp_activate (1)
[bjnp] bjnp_send_job_details: Job details
[bjnp]  :4d 46 4e 50 02 10 00 00  10 a0 00 01 00 00 01 88
[bjnp]  0010:00 00 00 00 00 00 00 00  00 74 00 73 00 75 00 6e
[bjnp]  0020:00 61 00 6d 00 69 00 00  00 00 00 00 00 00 00 00
[bjnp]  0030:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0040:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0050:00 00 00 00 00 00 00 00  00 72 00 6f 00 6f 00 74
[bjnp]  0060:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0070:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0080:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0090:00 00 00 00 00 00 00 00  00 50 00 72 00 6f 00 63
[bjnp]  00a0:00 65 00 73 00 73 00 20  00 49 00 44 00 20 00 3d
[bjnp]  00b0:00 20 00 36 00 34 00 38  00 31 00 00 00 00 00 00
[bjnp]  00c0:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  00d0:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  00e0:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  00f0:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0100:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0110:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0120:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0130:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0140:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0150:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0160:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0170:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0180:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0190:00 00 00 00 00 00 00 00  70 5f ac a3 9b 7f 00 00
[bjnp]  01a0:70 60 ac a3 9b 7f 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_send_job_details: Job details response:
[bjnp]  :4d 46 4e 50 82 10 00 00  10 a0 00 01 00 00 00 04
[bjnp]  0010:80 00 00 00
[bjnp] bjnp_open_tcp: Setting up a TCP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_set_timeout to 100, but using minimum value 1
[bjnp] bjnp_read_int(1, bufferptr, 0x10 = 16):
[bjnp] bjnp_poll_scanner: Poll details (type 5)
[bjnp]  :4d 46 4e 50 02 32 00 00  10 a1 00 00 00 00 00 64
[bjnp]  0010:00 05 00 00 00 00 00 00  00 72 00 6f 00 6f 00 74
[bjnp]  0020:00 20 00 20 00 74 00 73  00 75 00 6e 00 61 00 6d
[bjnp]  0030:00 69 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0040:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0050:00 00 00 00 00 00 00 00  00 00 00 14 00 00 00 00
[bjnp]  0060:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[bjnp]  0070:00 00 00 00
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.1.111  port
8610
[bjnp] bjnp_poll_scanner: Poll details response:
[bjnp]  :4d 46 4e 50 82 32 00 00  10 a1 00 00 00 00 00 24
[bjnp]  0010:00 00 00 00 00 00 00 00  00 00 00 14 00 00 00 00
[bjnp] 

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-05 Thread Kip Shaffer
I just updated from Rolf's PPA, and I am very happy to say that I can now
detect and scan from my Canon ImageClass MF644Cdw over the network.  I
confirmed it can scan in resolutions of 75, 150, 300, 600, 1200, and 2400
for both Text and Color modes.  It successfully read 2 sided multiple pages
from the sheet feeder.

The only issue I saw (same as earlier) is that when it completes a job
reading from the sheet feeder, SimpleScan pops up a dialog box stating
"Failed to Scan" "Error communicating with scanner."   This does not affect
the job... all pages were scanned successfully.

Thank you everyone!  I am happy to continue tests if there is energy for
debugging the error message!

-Kip

On Fri, Oct 4, 2019 at 3:33 PM Rolf Bensch  wrote:

> Hi,
>
> It seems that the network model differs between sources and network
> scanner discovery. I just fixed it. It will be available from my ppa
> tomorrow.
>
> Hope this helps.
>
> Cheers,
> Rolf
>
>
> Am 04.10.19 um 18:53 schrieb David McMahon:
> >
> >
> > On Fri, Oct 4, 2019 at 3:51 AM Rolf Bensch  > <mailto:r...@bensch-online.de>> wrote:
> >
> > Hi Kip,
> >
> > Am 14.09.19 um 03:40 schrieb Kip Shaffer:
> > > Scanning Results!  I updated to today's
> > version: 1.0.28+git20190913-bionic0
> > >
> > > Using Simple Scan I was able to scan at 75, 150, 300, 600, 1200,
> and
> > > 2400 dpi in both Text and Photo modes.  Perfect!
> >
> > I just updated the doc files.
> >
> > >
> > > When scanning from the document feeder, it scans front and back,
> one
> > > sheet or many, but after the job is done there is a pause, and
> then it
> > > says "Error communicating with scanner".
> >
> > Can you scan again after closing the message and/or does your
> > scanner hang?
> >
> > The pause comes from adf-wait parameter. Please read the man page for
> > details.
> >
> > >
> > > Also, this has all been through USB.  I tried to connect with the
> > > network and scanimage -L cannot find it.  I added the address to
> > > pixma.conf (neither line helped):
> > > bjnp://MF640_192.168.1.97
> > > bjnp://192.168.1.97 <http://192.168.1.97> <http://192.168.1.97>
> >
> > Please read 'man sane-pixma' to get some help for this issue. If this
> > won't help, please provide a log file with SANE_DEBUG_BJNP.
> >
> >
> > Here's mine:
> >
> > $ SANE_DEBUG_BJNP=5 scanimage -L 2>&1
> > [sanei_debug] Setting debug level of bjnp to 5.
> > [bjnp] sanei_bjnp_find_devices, pixma backend version: 0.23.3
> > [bjnp] sanei_bjnp_find_devices: Adding scanner from pixma.conf:
> > bjnp://192.168.86.39 <http://192.168.86.39>
> > [bjnp] bjnp_allocate_device(bjnp://192.168.86.39:8612/timeout=1
> > <http://192.168.86.39:8612/timeout=1>) 0
> > [bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
> > using as hostname
> > [bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39
> >  port 8612
> > [bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
> > udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
> > ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no
> > data received (timeout = 1)
> > [bjnp] bjnp_init_device_structure: Cannot read mac address, skipping
> > this scanner
> > [bjnp] bjnp_allocate_device: Scanner not yet in our list, added it:
> > 192.168.86.39:8612 <http://192.168.86.39:8612>
> > [bjnp] get_scanner_id: Get scanner identity
> > [bjnp]  :42 4a 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
> > [bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39
> >  port 8612
> > [bjnp] udp_command: ERROR - recv failed: Connection refused[bjnp]
> > udp_command: ERROR - recv failed: Connection refused[bjnp] udp_command:
> > ERROR - recv failed: Connection refused[bjnp] udp_command: ERROR - no
> > data received (timeout = 1)
> > [bjnp] get_scanner_id: ERROR - Failed to retrieve scanner identity:
> > [bjnp] add_scanner: ERROR - Cannot read scanner make & model:
> > bjnp://192.168.86.39:8612/timeout=1
> > <http://192.168.86.39:8612/timeout=1>
> > [bjnp] sanei_bjnp_find_devices: Added all configured scanners, now do
> > auto detection...
> > [bjnp] prepare_socket: lo is not a valid IPv4 interface, skipping...
> > [bjnp] prepare_socket: eth0 is IPv4 capable, sending broadcast, sock

Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-04 Thread Rolf Bensch
 Get scanner identity
> [bjnp]  :4d 46 4e 50 02 30 00 00  00 01 00 00 00 00 00 00
> [bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39
>  port 8610
> [bjnp] get_scanner_id: scanner identity:
> [bjnp]  :4d 46 4e 50 82 30 00 00  00 01 00 00 00 00 00 5a
> [bjnp]  0010:4d 46 47 3a 43 41 4e 4f  4e 3b 43 4d 44 3a 4d 46
> [bjnp]  0020:4e 50 31 2c 4d 75 6c 74  69 50 41 53 53 20 32 2e
> [bjnp]  0030:31 3b 4d 44 4c 3a 4d 46  36 34 32 43 2f 36 34 33
> [bjnp]  0040:43 2f 36 34 34 43 3b 43  4c 53 3a 49 4d 47 3b 44
> [bjnp]  0050:45 53 3a 43 61 6e 6f 6e  20 4d 46 36 34 32 43 2f
> [bjnp]  0060:36 34 33 43 2f 36 34 34  43 3b
> [bjnp] get_scanner_id: Scanner identity string =
> MFG:CANON;CMD:MFNP1,MultiPASS 2.1;MDL:MF642C/643C/644C;CLS:IMG;DES:Canon
> MF642C/643C/644C; - length = 90
> [bjnp] get_scanner_id: Scanner model = MF642C/643C/644C
> [bjnp] add_scanner: New scanner added:
> mfnp://canoncbcab3.lan:8610/timeout=1, serial canoncbcab3.lan, mac
> address: 1098c3da2cf7.
> [bjnp] sanei_find_devices: Discover response:
> [bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
> [bjnp] sanei_bjnp_find_devices: Select returned, time left 0.42
> [bjnp] sanei_find_devices: Discover response:
> [bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
> [bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
> [bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
> using as hostname
> [bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 2
> [bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
> using as hostname
> [bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39
>  port 8610
> [bjnp] bjnp_get_scanner_mac_address: Discover response:
> [bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
> [bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
> [bjnp] add_scanner: Scanner at mfnp://canoncbcab3.lan:8610/timeout=1
> was added before, good!
> [bjnp] sanei_find_devices: Discover response:
> [bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
> [bjnp] sanei_find_devices: scanner discovery finished...
> 
> No scanners were identified. If you were expecting something different,
> check that the scanner is plugged in, turned on and detected by the
> sane-find-scanner tool (if appropriate). Please read the documentation
> which came with this software (README, FAQ, manpages). 
> 
> 
> >
> > TL:DR - the sane-pixma backend is functional for the Canon ImageClass
> > MF644Cdw when connected via USB, with only a slight hiccup after
> > scanning from the sheet feeder.  I was not able to scan over the
> network.
> 
> Many thanks for your report.
> 
> Hope this helps.
> 
> Cheers,
> Rolf
> 



Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-04 Thread David McMahon
ner: New scanner added:
mfnp://canoncbcab3.lan:8610/timeout=1, serial canoncbcab3.lan, mac
address: 1098c3da2cf7.
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
[bjnp] sanei_bjnp_find_devices: Select returned, time left 0.42
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] bjnp_allocate_device(mfnp://canoncbcab3.lan:8610/timeout=1) 2
[bjnp] get_scanner_name: Forward lookup for canoncbcab3.lan succeeded,
using as hostname
[bjnp] setup_udp_socket: Setting up a UDP socket, dest: 192.168.86.39  port
8610
[bjnp] bjnp_get_scanner_mac_address: Discover response:
[bjnp]  :4d 46 4e 50 82 01 00 00  00 00 00 00 00 00 00 10
[bjnp]  0010:00 01 80 00 06 04 10 98  c3 da 2c f7 c0 a8 56 27
[bjnp] add_scanner: Scanner at mfnp://canoncbcab3.lan:8610/timeout=1
was added before, good!
[bjnp] sanei_find_devices: Discover response:
[bjnp]  :42 4a 4e 50 02 01 00 00  00 00 00 00 00 00 00 00
[bjnp] sanei_find_devices: scanner discovery finished...

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

>
> >
> > TL:DR - the sane-pixma backend is functional for the Canon ImageClass
> > MF644Cdw when connected via USB, with only a slight hiccup after
> > scanning from the sheet feeder.  I was not able to scan over the network.
>
> Many thanks for your report.
>
> Hope this helps.
>
> Cheers,
> Rolf
>
>


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-10-04 Thread Rolf Bensch
Hi Kip,

Am 14.09.19 um 03:40 schrieb Kip Shaffer:
> Scanning Results!  I updated to today's version: 1.0.28+git20190913-bionic0
> 
> Using Simple Scan I was able to scan at 75, 150, 300, 600, 1200, and
> 2400 dpi in both Text and Photo modes.  Perfect!

I just updated the doc files.

> 
> When scanning from the document feeder, it scans front and back, one
> sheet or many, but after the job is done there is a pause, and then it
> says "Error communicating with scanner". 

Can you scan again after closing the message and/or does your scanner hang?

The pause comes from adf-wait parameter. Please read the man page for
details.

> 
> Also, this has all been through USB.  I tried to connect with the
> network and scanimage -L cannot find it.  I added the address to
> pixma.conf (neither line helped):
> bjnp://MF640_192.168.1.97
> bjnp://192.168.1.97 <http://192.168.1.97>

Please read 'man sane-pixma' to get some help for this issue. If this
won't help, please provide a log file with SANE_DEBUG_BJNP.

> 
> TL:DR - the sane-pixma backend is functional for the Canon ImageClass
> MF644Cdw when connected via USB, with only a slight hiccup after
> scanning from the sheet feeder.  I was not able to scan over the network.

Many thanks for your report.

Hope this helps.

Cheers,
Rolf



Re: [sane-devel] Canon ImageClass MF644Cdw

2019-09-28 Thread Olaf Meeuwissen
Hi David,

David McMahon writes:

> [...]
> sane-devel/Rolf, is there an open request/bug for this Canon
> printer/scanner?  Can I do anything from my end to help?

You can check at

  https://gitlab.com/sane-project/backends/issues

and filter that list on backends/pixma or search it for your scanner.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join



Re: [sane-devel] Canon ImageClass MF644Cdw

2019-09-28 Thread Kip Shaffer
Hi David & SaneDevel!  The only way I have been able to detect the scanner
is when it is connected via USB.  I would love to connect to it via the
network! So +1 on this request, and I'm also willing to do whatever it
takes to try things.

-Kip

On Sat, Sep 28, 2019 at 8:55 AM David McMahon  wrote:

> Hi Kip & sane-devel,
>
> Pardon the duplicate thread (
> https://alioth-lists.debian.net/pipermail/sane-devel/2019-September/037043.html),
> but I'm hoping you got further than I did.
>
> I too am trying to get this scanner working over WiFi on Linux Mint 19
> (Tara).
>
> I've got the latest sane packages from ppa:rolfbensch/sane-git and
> pixma.conf contains:
> bjnp://192.168.86.39
>
> $ scanimage -V
> scanimage (sane-backends) 1.0.28git; backend version 1.0.28
> $ scanimage -L
> [bjnp] udp_command: ERROR - no data received (timeout = 1)
> [bjnp] bjnp_init_device_structure: Cannot read mac address, skipping this
> scanner
> [bjnp] udp_command: ERROR - no data received (timeout = 1)
> [bjnp] add_scanner: ERROR - Cannot read scanner make & model: bjnp://
> 192.168.86.39:8612/timeout=1
>
> No scanners were identified. If you were expecting something different,
> <...snip...>
>
> Kip, it looks like you got further at one point in the original thread
> with scanimage actually returning something.
> Can I ask what your net.conf and pixma.conf files look like?
> I guess after that you still couldn't get any WiFi scanning from the
> device though?
>
> sane-devel/Rolf, is there an open request/bug for this Canon
> printer/scanner?  Can I do anything from my end to help?
>
> Thanks,
> David
>
>
>


Re: [sane-devel] Canon ImageClass MF644Cdw

2019-09-12 Thread Rolf Bensch
Hi Kip,

As Olaf mentioned before, your scanner is implemented in stable SANE version 
1.0.28 (http://www.sane-project.org/sane-backends.html#S-PIXMA), but not tested 
yet.

If you're using Ubuntu or an Ubuntu clone, you can use my ppa to update SANE: 
https://launchpad.net/~rolfbensch/+archive/ubuntu/sane-git .

If you have another Linux OS, please install SANE as described in INSTALL.linux 
(http://www.sane-project.org/docs.html).

If your scanner can be found by SANE, please test scanning all dpi resolutions 
and the document feeder with single/multiple pages, single side and duplex. 
Maybe you want to test WiFi support.

Hope this helps.

Cheers,
Rolf

Am 12.09.19 um 08:52 schrieb Olaf Meeuwissen:
> Hi Steve, Kip, Rolf, list,
>
> Steve McNeil writes:
>
>> Hi Kip,
>>
>> If you can build from source, I think I can help you.
>>
>> I think I can modify the source files for you to test with.
> You shouldn't have to modify anything in sane-backends-1.0.28.
>
> @Rolf> What kind of testing would you like to be done?
>
>> Thank you,
>> Steve
>>
>> On 9/5/19 4:00 AM, sane-devel-requ...@alioth-lists.debian.net wrote:
>>> Greetings!  Would it be possible to add a Canon ImageClass MF644Cdw to the
>>> Canon Pixma driver?
>>>
>>> Here is the info from sane-find-scanner:
>>>
>>> found USB scanner (vendor=0x04a9 [Canon], product=0x27fe
>>> [MF642C/643C/644C]) at libusb:002:003
>>>
>>> I am happy to run any testing you desire!
>>>
>>> -Kip
> Hope this helps,
> --
> Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
>  GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
>  Support Free Softwarehttps://my.fsf.org/donate
>  Join the Free Software Foundation  https://my.fsf.org/join
>



Re: Canon ImageClass MF644Cdw

2019-09-12 Thread Olaf Meeuwissen
Hi Steve, Kip, Rolf, list,

Steve McNeil writes:

> Hi Kip,
>
> If you can build from source, I think I can help you.
>
> I think I can modify the source files for you to test with.

You shouldn't have to modify anything in sane-backends-1.0.28.

@Rolf> What kind of testing would you like to be done?

> Thank you,
> Steve
>
> On 9/5/19 4:00 AM, sane-devel-requ...@alioth-lists.debian.net wrote:
>>
>> Greetings!  Would it be possible to add a Canon ImageClass MF644Cdw to the
>> Canon Pixma driver?
>>
>> Here is the info from sane-find-scanner:
>>
>> found USB scanner (vendor=0x04a9 [Canon], product=0x27fe
>> [MF642C/643C/644C]) at libusb:002:003
>>
>> I am happy to run any testing you desire!
>>
>> -Kip

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join



Canon ImageClass MF644Cdw

2019-09-11 Thread Steve McNeil

Hi Kip,

If you can build from source, I think I can help you.

I think I can modify the source files for you to test with.

Thank you,
Steve

On 9/5/19 4:00 AM, sane-devel-requ...@alioth-lists.debian.net wrote:


Greetings!  Would it be possible to add a Canon ImageClass MF644Cdw to the
Canon Pixma driver?

Here is the info from sane-find-scanner:

found USB scanner (vendor=0x04a9 [Canon], product=0x27fe
[MF642C/643C/644C]) at libusb:002:003

I am happy to run any testing you desire!

-Kip




Canon ImageClass MF644Cdw

2019-09-04 Thread Kip Shaffer
Greetings!  Would it be possible to add a Canon ImageClass MF644Cdw to the
Canon Pixma driver?

Here is the info from sane-find-scanner:

found USB scanner (vendor=0x04a9 [Canon], product=0x27fe
[MF642C/643C/644C]) at libusb:002:003

I am happy to run any testing you desire!

-Kip