Printer support

stream

Member

Thanks: 1
Messages: 21

#1
Hi there!

I have had a very hard time connecting my Canon printer (MF 4150). Tried several things outlined in the official doc, and some online threads.

The printer is connected directly to the desktop which runs Freebsd 11, via USB port.

Here is the output of the dmesg.
Code:
ulpt0: <Canon Inc. MF4100, class 0/0, rev 2.00/1.00, addr 5> on usbus0
ulpt1: <Canon Inc. MF4100, class 0/0, rev 2.00/1.00, addr 5> on usbus0
ugen0.6: <Canon Inc. MF4100> at usbus0 (disconnected)
ugen0.6: <Canon Inc. MF4100> at usbus0
ulpt0: <Canon Inc. MF4100, class 0/0, rev 2.00/1.00, addr 6> on usbus0
ulpt1: <Canon Inc. MF4100, class 0/0, rev 2.00/1.00, addr 6> on usbus0
I installed cups also, and tried adding the canon MF4150. But the Gutenprint driver does not have a specific driver. Experimented with some alternatives, such as Pixma MG 4100 series, and added printer. That didn't work- when I print a doc (sample text file or online pdf doc), it does nothing.

Am not really sure how to debug this, and get around this. Can you folks suggest some options, and/or alternatives to get this printer (MF4150) to work with Freebsd.

Thank you
 
Last edited by a moderator:
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#2
One other thing I tried. Using linux compatibility mode, I extracted the linux driver RPM package, obtained from Canon site.
And then uploaded the CNCUPSMF4100ZS.ppd, directly instead of gutenprint.

But now, I get an error: "File "/usr/local/libexec/cups/filter/pstoufr2cpca" not available: No such file or directory"

Appreciate any help, inputs you can suggest to resolve this.
 

scottro

Daemon

Thanks: 436
Messages: 1,288

#3
Does it work with Linux? (I know that in the past, there's been lots of problems with Canon printers and Linux). If so, you might be able to use a Linux ppd. If it uses postscript, then you may be able to just use that.
 

leebrown66

Well-Known Member

Thanks: 126
Messages: 386

#4
There is a manual for the Linux driver here which indicates it should handle PostScript. Maybe there's a generic PS driver you could try.
 

Oko

Daemon

Thanks: 768
Messages: 1,620

#5
stream You first stop should have being OpenPrinting database. Quick search indicates that all-in-one device should be fully supported including scanning.

http://www.openprinting.org/printer/Canon/Canon-i-Sensys_MF4150_AKA_imageCLASS

I took a clue from one of the comments and found PPD (PostScript Printer Description) file for you.

https://github.com/vicamo/cndrvcups-lb/blob/master/ppd/CNCUPSMF4100ZS.ppd

That is any easy read and it looks like that is a PostScript printer which supports PostScript level 3. The information I left you should be sufficient for you to set up the printer. If you are not following what I am taking about FreeBSD might not be for you (at least not before you do some serious studying).

One other thing I tried. Using linux compatibility mode, I extracted the linux driver RPM package, obtained from Canon site.
And then uploaded the CNCUPSMF4100ZS.ppd, directly instead of gutenprint.

But now, I get an error: "File "/usr/local/libexec/cups/filter/pstoufr2cpca" not available: No such file or directory"

Appreciate any help, inputs you can suggest to resolve this.
You can't use Linux drivers on FreeBSD. Linux compatibility is for userland programs only and should be removed anyway. Linux and FreeBSD have also very different drivers' API.
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#6
Thanks guys.

Scottro- no I didn't try in linux.

Oko- apologies for not being clear in the second post. Yes, I did look at that openprinting link. I searched for and wanted to get that CNCUPSMF4100ZS.ppd. That's what prompted me to download the linux driver from Canon website, extract the .rpm package using linux rpm command to get to that ppd file. So I went to linux compat mode, and extracted using rpm2cpio.

By the way, the CNCUPSMF4100ZS.ppd file you suggested is what I had previously- identical.

This time around, I turned off linux now to make sure there are no conflicts, and rebooted the machine.
After uploading CNCUPSMF4100ZS.ppd in the CUPS administration page, I added the printer back. Tried to print a sample doc. Unfortunately, got hit with the same error "File "/usr/local/libexec/cups/filter/pstoufr2cpca" not available: No such file or directory".

This cups error logs same as last time:
E [18/Feb/2018:23:22:16 -0500] Canon_MF4100_Series: File \"/usr/local/libexec/cups/filter/pstoufr2cpca\" not available: No such file or directory
E [18/Feb/2018:23:22:16 -0500] [Job 4] Unable to start filter "pstoufr2cpca" - No such file or directory.

Maybe I'm doing something wrong?
 

xchris

Member

Thanks: 13
Messages: 64

#7
stream : if you installed the linux compat libraries, you may need too the linux-c7-cups-libs (or linux-c6-cups-libs), I had similar issues with my samsung scx, plus I had to copy some files (filters) from the linux driver to the linux compat directory, looks like the linux-*-cups uses them if you install the ppd file.
 

shepper

Aspiring Daemon

Thanks: 247
Messages: 739

#8
It is not clear that the MFC 4150 is Postscript capable. The Manufacturers website https://www.usa.canon.com/internet/...imageclass-mf4150?tab=technicalspecifications does no specifically list the supported Printer Languages.

A CNET review https://www.cnet.com/products/canon-imageclass-mf4150/specs/ gives the following
Printer Drivers / Emulations UFRII LT
This debian page https://wiki.debian.org/PrinterDriver/Canon/UFR-II describes the UFRII driver needs 32bit linux libraries. It also provides download links.

From this, I would suggest that you will need 32bit LInux emulation to run this in FreeBSD.
 

ralphbsz

Daemon

Thanks: 763
Messages: 1,288

#9
That printer is usable on the Mac, with a downloadable driver. The Mac uses a version of CUPS.

Here is a suggestion: Create a very small virtual machine. In that VM, install Linux, with CUPS, and with the downloaded Linux driver for this printer. Then print over the network (via lpr/lpd) to that Linux virtual machine. Another way to accomplish this would be to get a raspberry pi (about $20), install Linux on it, and use it as a printer adapter.
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#10
Thanks all for the suggestion.

ralphabsz: linux VM is my last option if this doesn't work. would prefer to run FreeBSD though.

xchris: I uninstalled linux-c6, and installed linux-c7, to see if that works.

shepper: Thanks for the debian link. Strange I found pstoufr2cpca file in the Debian part of the Canon tar file. PTo extract that I had to use deb2targz.

Anyway, now the pstoufr2cpca file error is gone. But I get a different error:

279 D [19/Feb/2018:16:21:00 -0500] [Job 13] Canon_MF4100_Series: error while loading shared libraries: libdbus-1.so.3: cannot open shared object file: No such file or directory

However, dbus is alread installed, and up to date. for example, here is the /usr/local/lib
libdbus-1.so.3 -> libdbus-1.so.3.14.10
libdbus-1.so.3.14.10
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#11
Actually, I also installed linux-c7-dbus-libs, that seems to be resolving the libdbus-1.so error above.
Now, the printer just does not print, but logs show this error

pstoufr2cpca write error,9


Anything I can do here?
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#14
stream You first stop should have being OpenPrinting database. Quick search indicates that all-in-one device should be fully supported including scanning.

http://www.openprinting.org/printer/Canon/Canon-i-Sensys_MF4150_AKA_imageCLASS

I took a clue from one of the comments and found PPD (PostScript Printer Description) file for you.

https://github.com/vicamo/cndrvcups-lb/blob/master/ppd/CNCUPSMF4100ZS.ppd
That is any easy read and it looks like that is a PostScript printer which supports PostScript level 3. The information I left you should be sufficient for you to set up the printer. If you are not following what I am taking about FreeBSD might not be for you (at least not before you do some serious studying).
You can't use Linux drivers on FreeBSD. Linux compatibility is for userland programs only and should be removed anyway. Linux and FreeBSD have also very different drivers' API.
Oko: I'd like to make sure I haven't missed anything here for OpenPrinting. Can you elaborate on your comment. What steps are necessary to get the printer to work in FreeBSD, without any linux drivers. I uploaded the CNCUPSMF4100ZS.ppd file in the cups URL. Do you suggest nay other installation/uploading? As Shepper mentioned above, this printer does not use postscript directly. It needs conversion of ps to ufr2 format- something specific to Canon.
 

Oko

Daemon

Thanks: 768
Messages: 1,620

#15
Oko: I'd like to make sure I haven't missed anything here for OpenPrinting. Can you elaborate on your comment. What steps are necessary to get the printer to work in FreeBSD, without any linux drivers. I uploaded the CNCUPSMF4100ZS.ppd file in the cups URL. Do you suggest nay other installation/uploading? As Shepper mentioned above, this printer does not use postscript directly. It needs conversion of ps to ufr2 format- something specific to Canon.
If it is not PostScript printer you are out of luck my friend. Generally speaking there are few collection of open source printer drivers for Linux and BSDs. They are contained in the following packages: GhostScript, Gutenprint, hpijs (HPLIP), and splix. There are also bunch of binary blob Linux specific drivers like those Brother provides for its cheap junk. While there are many very nice reliable non-post script printers (I used a HP LaserJet 4L for more than 10 years), rule of the thumb is that any serious device will speak PostScript and it will not need driver at all. Once you found yourself looking for a stupid driver you are better off going to local store and getting yourself a new device. I personally really like Brother monochromatic laser printers. At work I use HL-5100DN and at home I have HL-5250DN. Both printers don't require any drivers. 15-20 years ago I would recommend HP but no longer.
 

xchris

Member

Thanks: 13
Messages: 64

#16
Actually, I also installed linux-c7-dbus-libs, that seems to be resolving the libdbus-1.so error above.
Now, the printer just does not print, but logs show this error

pstoufr2cpca write error,9


Anything I can do here?
did you add the user to cups group?
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#17
did you add the user to cups group?
thanks for the tip. I just did, and rebooted system, along with a fresh cups install.
Now, I dont get the write error. Instead the following in the error logs:

>>
execv failed: Exec format error
(/usr/local/libexec/cups/filter/pstoufr2cpca) stopped with status 108 (Exec format error)

The above was because I had not loaded linux in the kernel.
After kldload linux, and kldload linux64, and restarting cups:

I get the same error.

"pstoufr2cpca write error,9."
 

ralphbsz

Daemon

Thanks: 763
Messages: 1,288

#18
Error 9 is EBADF. Sounds like someone is not opening up some file-like resource. I think it's time to pull up the source code of this utility, find the line that prints the error, and figure out what could lead to EBADF in that place.
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#19
Error 9 is EBADF. Sounds like someone is not opening up some file-like resource. I think it's time to pull up the source code of this utility, find the line that prints the error, and figure out what could lead to EBADF in that place.
What particular file are you referring to? The pstufr2cpca is a text file, having a bunch of paper/font setting. And in turn points to some drivers. That's way beyond me.. and even then, not sure if I'm going to be lucky with a decent solution. I like the raspberry pi idea you suggested- am going to invest some time to get that working..
 

OJ

Daemon

Thanks: 253
Messages: 1,038

#20
Perhaps I missed something in the thread, but if this printer doesn't have a driver and it isn't postscript, then it's not going to work. Somebody with the skills could perhaps write a driver, but barring that it's just not going to work. So, I guess my point here is "what's the point"?
 
OP
OP
S

stream

Member

Thanks: 1
Messages: 21

#21
Perhaps I missed something in the thread, but if this printer doesn't have a driver and it isn't postscript, then it's not going to work. Somebody with the skills could perhaps write a driver, but barring that it's just not going to work. So, I guess my point here is "what's the point"?
You maybe right after all.. Can't tell if there is any point to all this. But my hope is someone may have thought of a simple workaround- Canon is not a nameless brand.
But am confused when you say there is no driver or that this printer is not postscript- the CNCUPSMF4100ZS.ppd file acts as the cups printer "driver", and the pstoufr2cpca file should in principle "filter" the non standard PS file into a postscript-like language that the printer understands.. Somewhere along the process something is broken. Anyway, for now, I've given up on the freebsd route for printing Canon.

Thank you all for contributing.
 

OJ

Daemon

Thanks: 253
Messages: 1,038

#22
But am confused when you say there is no driver or that this printer is not postscript
What I mean is that there is no driver for that printer. The driver has to be specifically for a Canon MF4150, not some other printer. Only that one. Either that or the printer needs to support postscript. I'm sorry, I can't make it any clearer than that. I don't know the program you pointed to, but I don't see Canon MF4150 mentioned there so I can't see it of being of any use. As for postscript, it will say in the printer docs. I checked the technical specs quickly and don't see it mentioned. I also don't see the word "linux" in the docs which is usually a quick search to see if a printer will work for open source.

Personally, I avoid Canon like the plague. They're not friendly to us. HP is often a reasonable choice, and there are others. I think they were mentioned up above. Canon being a very well known brand is not the issue. The thing is that they have no respect for us and steadfastly make big-market proprietary drivers only. To write a driver someone needs to get some key pieces of information from Canon and they're not going to give that out - so it's just not going to happen.
 

ralphbsz

Daemon

Thanks: 763
Messages: 1,288

#23
What particular file are you referring to?
I was suggesting debugging the source code: Find out exactly what program / module / function prints that error message, and then figure out why it does that. This would require reading the source code to a large part of the printer software stack (or at least grep'ing it for that message). That's a lot of work, unless you have software development experience. Probably not an efficient way to fix it.
 

shepper

Aspiring Daemon

Thanks: 247
Messages: 739

#24
Perhaps I missed something in the thread, but if this printer doesn't have a driver and it isn't postscript, then it's not going to work. Somebody with the skills could perhaps write a driver, but barring that it's just not going to work. So, I guess my point here is "what's the point
There is a linux driver and there are threads where linux drivers have been used in FreeBSD with a Linux emulation layer.

IMHO, this is a stitched-together, Frankenstein approach. I recognize that not everybody can go out and drop a couple of C-notes on a printer and there is a sense of accomplishment from pounding a square peg into a round hole.

From the standpoint of fiddling, I thought the arm/rasberrypi based solution was kinda neat. There is also a router based solution. The LEDE/OpenWRT project has cups packages to install a printserver, with linux driver, on a router. Just send your FreeBSD printjob as "raw" to the router print server

Edit: After some additional thought, Pi/Arm and router solutions would not work as the binary blob from Canon is i386.
 
Top