Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, July 24, 2014

Linux Driver for Canon ImageClass MF3110/3112

I recently stumbled upon a treasure trove while looking for ways to make my old Canon ImageClass MF3112 all-in-one laser printer work with the latest OS around.

Background of the situation

If you're looking for drivers of this printer at the Canon official website, it only provides drivers to support 32-bit Windows XP, Vista and 7... none for Linux nor MacOS. This is pretty much a bummer especially if you have up-to-date workstations that "need" 64-bit OS (the > 4GB RAM thing). In my case, all my workstations and laptops run a Windows 8.1 and an Ubuntu Gnome 14.04, both 64-bit.

Canon actually published a package to install printer drivers for Linux-based OS, called the "UFR II". However, this is only for their not-so-late models, and apparently the one I need is the one they developed prior to this. The older models seem to be an implementation based on a raster-like format that I have no particular clue how it differs.

After a day of two of digging around the Internet, and exploring the vast "Page 2 and 3" Google search results, I found a guy who made a custom linux driver to support this "rastertocups" print driver thing that Canon has done and left to rot. He has a GitHub repo page which sort of discussed what the driver is and what other canon printer models are supported.

Since there's no HowTo wiki entry to use his codes, I opted to share what I did in order to use and install it (credits to ondrej-zary for the source code).

Pre-work Requirements
  • sudo rights (or root)
  • gcc and compiler (e.g. make, build-essential) is installed
  • cups, libcups2-dev, and libcupsimage2-dev is installed
  • even though it doesn't have the required drivers, I installed the UFR II Canon Linux Drivers because it seems that it is needed for the custom drivers to work
The Steps
  1. Download ondrej-zary's carps-cups source code (there's a zip file download link present)
  2. Extract it on the desired work-area folder (temporary use; mine was inside my home folder)
  3. Using the terminal, go to the location of the unzipped folder and run "make" 
    $ cd ~/carps-cups-master 
    $ make 

  4. If there are errors of missing dependencies, you can try to use "apt-file search " to check which packages you need install before trying to make it.
  5. If things look fine and there's no error, proceed with "sudo make install" (or make install for root users);
$ sudo make install
The Result

I've done this and made my printer work with Ubuntu Gnome 14.04 64-bit (cups 1.7.2) and Debian 7 Wheezy 32-bit (cups 1.5.3). I added printer and selected the compiled driver via the cups web interface (usually running at your linux machine "localhost:631").



Hope this helps somebody out there... and again a huge thanks to ondrej-zary!

Monday, April 30, 2012

[Bug] adding gateway route but with different subnet from network

I encountered a weird behavior from my recent projects that were related to some setup of gateway servers, for both Linux-based (Debian) and BSD-based (FreeBSD) systems... wherein there is an issue when adding static gateway routes that does not match or fall within the defined subnet network configured on a network interface.

To give a better detail or explanation of this predicament of mine, below is a sample network configuration scenario...
  • Network IP address subnet is 10.10.1.0/24, so that's basically 10.10.1.X correct?
  • Gateway IP address is... let's say 10.50.1.27...
Clearly on the scenario given, the IP address of the gateway is outside of the network subnet defined for a network interface. Here in the Philippines, this is a common case for leased-line internet connections coming from telco providers. 

From previous engagements, I don't have a problem hard-coding this on either the interfaces config file or in the rc.conf... but in the recent turn of events and experience, it seems that the latest linux kernels and BSD builds have incorporated a sort-of mechanism that prohibits this kind of configuration to be enabled and up upon start-up of the operating system. I've experienced this issue with a Debian Squeeze server and a FreeBSD version 8 I think (am not really a BSD proficient guy, just the basic UNIX made me survive).

The setup still works with this kind of interface configuration, but upon boot-up, you have to manual place the static routes (using "route" command) for it to recognize and see the gateway IP you want it to use.

My initial solutions involved adding static routes on the interfaces config or on the rc.conf files.

For Linux-based:

post-up route add -net 10.50.1.27 netmask 255.255.255.255 dev eth0
post-up route add default gw 10.50.1.27
post-down route add 10.50.1.27 netmask 255.255.255.255 dev eth0
post-down route add default gw 10.50.1.27

For BSD:

defaultrouter="10.50.1.27"
static_routes="net1"
route_net1="-net 10.50.1.27/32"

Sadly though, my attempts in fixing the BSD-based system ended up in failure. As for the Linux machine, well I have yet to fully test it out since the project suddenly reached the end without further testing.

Hope this rather weird post of mine helped to shed some light to their problem and looking for an answer.

Thursday, June 4, 2009

the reason why people stick to Windows... false!

Because of my current line of work, I've been deeply exposed into the utilization of Linux-based systems and servers, and due to that I started to appreciate the flexibility and power of what Linux can actually do as compared to Windblows (Windows). Yet most people still stick on to Windows, not just because their purchased machine came with it or so that they could play games, is because that Microsoft provides support and "liability" upon usage of their products... which is greatly misunderstood and mistaken.

To state a fact, not one operating system available in the (consumer) market is fault-tolerant and susceptible to errors. Even in the open-source community, it has been stressed that Linux and Windows are just as robust as each other, and each still has it's ups and downs. However, the stigma that since Linux-based OS are open source, in which you can't ask anyone for help if you stumbled into trouble, still sticks into society... but this is completely false. I think that Linux-based systems, in particular the widely popular distribution/flavor Ubuntu, has more help support (forums) over the internet than Windows.

People think that when they use Windows, they can "sue" Microsoft if "it" ruins their system, most applicable to corporate or enterprise level systems. But looking at the EULA (yep, the one you just scroll down and select "I agree"), it is stated there that Microsoft products are not fool-proof and therefore Microsoft has no liability on the damages their product can incur. With this, they are just practically the same as Linux, only you just paid Microsoft to use their applications.

I could say that open source is the way to go... it's free... and more flexible than Windows. I admit I still keep my Windows OS copy because I already paid for it before, but oftentimes I use my Ubuntu-partition, most especially on more detailed tasks as a Systems Administrator... but this still goes for ordinary users that just needs all the basic internet, office and multimedia functions. But apart from the basic necessities, photo and video editing are also possible in Linux-based systems. The best part of it, Linux doesn't have any virus to plague you.