Tag Archives: drivers

ddiwrapper on ubuntu 9.04

I have a Canon Pixma MP830 printer. This printer supports high resolution printing up to 9600x2400 dpi, but the gutenprint driver only supports 600x600 dpi.

So what do I do to make it print with higher resolution?

I wanted to use ddiwrapper, a system that would let you use the native win2k/winxp drivers from the manufacturer. Basically it uses wine to load those drivers feed the print job into the driver and feed the driver's output to the printer.

Note:

This is an incomplete solution. I managed to get as far as being able to install ddiwrapper and the driver. I didn't manage to actually print a test page. When trying to print the test page I don't get any errors, and the printing system reports printing has finished but nothing is actually printed.
I wrote this post in case there are others that might want to try this and maybe can find the final solution.

There were two problems with ddiwrapper:

  1. it didn't compile on my system ( Ubuntu 9.04 x86_64 with Wine 1.1.25 ), complaining that : "Relocatable linking with relocations from format elf32-i386 (gdi32.o) to format elf64-x86-64 (gdi32.e8IuDu.o) is not supported" . This was fixed as soon as I added -m32 in a few Makefiles
  2. the excanondriver utility that is used to extract the driver is meant to be used with executable archives, zip or lha files, but the driver for MP830 is just an executable so I modified this file to work with driver files from a directory.

The fixes to both problems are provided in the diff file bellow.

Compile ddiwrapper

  1.  
  2. apt-get install wine-dev
  3. wget http://www.linuxprinting.org/download/ddiwrapper/ddiwrapper_0.3-rc1.tgz
  4. tar -xzpf ddiwrapper_0.3-rc1.tgz
  5. cd ddiwrapper
  6.  

apply the diff file ddiwrapper 0.3rc1 ubuntu 9.04 amd64-0.1 (2.58 KB) , compile and install:

  1.  
  2. patch -p1 < ddiwrapper.diff
  3. make && make install
  4.  

Install the drivers

Insert the driver's cdrom that came with the printer, it shoud be automounted.
Copy drivers from the cdrom to a local folder ~/cdrv :

  1.  
  2. mkdir ~/cdrv
  3. cp /media/cdrom/MP/Drv2KXP/*  ~/cdrv
  4.  

Delete the drivers for fax and scanner:

  1.  
  2. cd ~/cdrv
  3. sudo rm -rf Fax mp830fx.cat MP830fx.inf mp830sc.cat MP830sc.inf Scan
  4.  

Move all drivers from ~/cdrv/Print to ~/cdrv :

  1.  
  2. sudo mv ~/cdrv/Print/*  ~/cdrv
  3. rmdir ~/cdrv/Print
  4.  

Now install the driver:

  1.  
  2. sudo excanondriver ~/cdrv/ /usr/share/ddiwrapper/drivers/default
  3.  

Add the printer ( usb://dev/usblp0 should be replaced with whatever is the location of your printer) :

  1.  
  2. cd ~/ddiwrapper
  3. lpadmin -p ddiwrapper -v usb://dev/usblp0 -P doc/ddiwrapper.ppd -E
  4.  

or you can use the Printing admin application from System->Administration->Printing and load the ppd file in ~/ddiwrapper/doc/ddiwrapper.ppd

Apparmor setup

Ubuntu 9.04 has apparmor installed, and there is a profile for cupsd. The ddiwrapper tries to access files that are not specified in this profile, but by looking at the error messages generated in the logs I managed to find all the files and add them to the profile. Here's a diff file with the changes I did : apparmor cupsd profile patch- (871 bytes)

Apply the diff file to cups apparmor profile and restart apparmor:

  1.  
  2. patch < usr.sbin.cupsd.diff
  3. /etc/init.d/apparmor restart
  4.  

Testing

The new printer should show up in the Printing admin and I thought I  should be able print a test page but it didn't work.
The README file for ddiwrapper mentions there is a way to "dry" test this by feeding the driver a ps file and verifying if the output is correct but there are no details about how to do that.
Now what ? Has anyone managed to make this work for Pixma MP830 ? Any idea about how to debug it ?

realtek 8180 on kernel 2.6.23

To make RealTek 8180 wireless cards work in Linux you need the open source drivers from rtl8180-sa2400. Actually this driver supports more realtek cards not just 8180, you can get the list of supported devices from their homepage.

The only problem with those drivers is that they are a bit outdated. They were initially build sometime in 2005 at a time when the kernel version was 2.6.12 . Since then there were patches released to make those drivers work with newer kernels and the latest patch I found was for kernel 2.6.22.You can download the patch from sourceforge . I downloaded that and it just complied and installed without problems.

I loaded the following kernel modules in the exact order :

  1. modprobe ieee80211_crypt-rtl
  2. modprobe ieee80211_crypt_wep-rtl
  3. modprobe ieee80211_crypt_tkip-rtl
  4. modprobe ieee80211_crypt_ccmp-rtl
  5. modprobe ieee80211-rtl
  6. modprobe r8180 # or some other for other supported cards

At this point I got the card working but there was no security. I knew this card supports WEP encryption and I was trying to set up a link between the card and a linksys WRT54G router that can also do WEP. When I tried to set a key (WEP ) I the card told me setting a key was not supported by hardware and I got the following error in dmesg: rtl_ieee80211_crypt_wep: could not allocate crypto API arc4

This was very weird because I knew I already loaded the arc4 crypto module . Then why doesn't it work?
After digging a bit in the code I realize that the ecb module is also needed for kernel versions higher then 2.6.15.

After I loaded the ecb module I was able to set a key with iwconfig and the link was up.

To summarize...
in order get this driver working you have to compile your kernel with the following options:

-> Networking
-> Networking support (NET [=y])
-> Wireless
-> Improved Wireless API

for the wireless tools ( iwconfig ) to work
Device Drivers
-> Wireless LAN
I'm not sure if this one is really needed cause the rtl8180 drivers user their own 802.11 stack but it doesn't hurt to enable it as a module, and if you have other wireless devices or you want to ue your card as a host ap you may need tis anyway.

From the Cryptographic API make sure you select ARC4 and ECB

After you compile the kernel you need to load the modules like this:

  1.  
  2. modprobe ecb
  3. modprobe arc4
  4. modprobe ieee80211_crypt-rtl
  5. modprobe ieee80211_crypt_wep-rtl
  6. modprobe ieee80211_crypt_tkip-rtl
  7. modprobe ieee80211_crypt_ccmp-rtl
  8. modprobe ieee80211-rtl
  9. modprobe r8180

bring up the interface :

  1.  
  2. ifconfig wlan0 up

and set the ESSID and key with iwconfig in order to connect it with the Access point

  1.  
  2. iwconfig wlan0 essid "your_Access_poing_ESSID" key restricted the_wep_key_used_by_your_access_point

If everything went well you should see something like: wlan0 802.11b linked when typing iwconfig
Next i will try to configure this card to be used as a Host AP.
Did any of you try that ? feel free to share your experiences in the comments.

Update:

There is a new project that forked the rtl8180 driver and ported it to the new 802.11 stack in 2.6.23 kernel. This new project was already included in 2.6.23 but at the moment only support for  rtl8185 is available. The project is rtl-wifi and you might want to watch their page for when they add support for 8180