Canon BJC-80 Printer/Linux IrDA

The BJC-80 is a portable colour bubblejet printer with quite good resolution (720dpi horizontal, 360dpi vertical). It is similar in performance to some of the desktop printers like the BJC-210SP, but is very compact and suited to carrying with with a laptop. It has an IrDA interface which works with Linux IrDA (in addition to an ordinary parallel interface). There are no switches to select the interface to be used. I had access to a BJC-50 for a short period and I believe it will work with Linux IrDA in an identical manner.

In my experience the printer will work happily on a 12V DC power source, such as the one on my yacht Windclimber.

The printer is supposed to be able to work as a scanner as well, but there does not seem to be any information available on how to drive it with Linux.

Kernel Version Dependencies

I have not found the BJC-80 to work with all kernel versions. If you are starting afresh I would recommend going to kernel 2.2.13 which works well. with some subsequent versions was been mixed. The linux irda major device number has changed with kernel versions. To determine the correct number to insert in /etc/conf.modules, execute:
	grep MAJOR /usr/src/linux/include/net/irda/*
and use the number disclosed there, almost certainly 161 unless you are trying a very old kernel (when it was 60).

Start-up

The BJC-80 seems to be a bit slow in the discovery phase, and as of linux-2.2.7 and up to linux-2.2.pre15 will not be discovered unless the timeout is increased. I do this in my IrDA startup script which is version dependent:
	#! /bin/sh
	# irda start script for linux 2.2.13 and later and
	#         irda-utils-0.9.5 and later
	/sbin/irattach /dev/ttyS0 -s 1
	sleep 1
	insmod ircomm
	echo 110 > /proc/sys/net/irda/slot_timeout
	echo start bj80 | lpc
for earlier versions:
	#! /bin/sh
	# irda start script for linux 2.2.7 and irda-utils-0.9.4
	insmod irda
	echo 110 > /proc/sys/net/irda/slot_timeout
	insmod irtty
	irattach /dev/ttyS0
	irmanager -d 1
Note:

Ghostscript

The BJC-80 appears to be the same as a BJC-600 as far the input requirements are concerned. A script like:
	#!/bin/sh
	#
	# Print Postscript to the Canon BJC-80 Bubble Jet Printer
	#
	# 	seems to behave the same as a BJC-600
	#
	gs -sPAPERSIZE=a4 -sDEVICE=bjc600 -sOUTPUTFILE=- -q -dNOPAUSE - quit.ps
can be used in a pipeline from PostScript to the printer, e.g. invoked by lpd. In my case, the script is kept in /usr/local/lib/lpd/ps2bj80

lpd

To use the BJC-80 successfully with lpd, lpd must be able to set the serial line to raw mode (i.e.clear the sgtty l_flags), and for best results, set the line speed to 115,200 baud. There are two slightly different ways to achieve this depending on the version of lpd you use.

unixlpr

This package, available by ftp is the basis of the lpr in some commercial distributions of Linux (e.g. Red Hat, SUSE).

Conventional Berkeley lpr

l_flags are set/cleared with "xs/xc" printcap entries but a number of versions of lpd do not support these entries, or worse, the printcap manual entry implies they are supported, but the underlying code is missing.

A version of the lpd set that supports these flags can be obtained at ftp://phoenix.physiol.usyd.edu.au/pub/lpd-5.9+l_flags.tar.gz

/etc/printcap

A printcap entry needs to include the right instructions to set the serial parameters. Its form varies depending on which lpr you use.

unix lpr

The printcap entry needs to be something like:
	bj80|IrDA BubbleJet|lp|bj80ps|GS-Cannon BubbleJet 80:\
		:sh:\
		:xo:\
		:lp=/dev/ircomm0:\
		:ms=115200,raw:\
		:mx#8000:\
		:pl#80:pw#90:Rl#56:PS:Rw#100:\
		:sd=/usr/spool/lpd/bj80:\
		:if=/usr/local/lib/lpd/ps2bj80:\
		:lf=/usr/spool/lpd/bj80/bj80-log:

Berkeley lpr

The printcap entry needs to be something like:
	bj80|IrDA BubbleJet|lp|bj80ps|GS-Cannon BubbleJet 80:\
		:sh:\
		:xo:\
		:lp=/dev/ircomm0:\
		:mx#8000:\
		:pl#80:pw#90:Rl#56:PS:Rw#100:\
		:sd=/usr/spool/lpd/bj80:\
		:if=/usr/local/lib/lpd/ps2bj80:\
		:lf=/usr/spool/lpd/bj80/bj80-log:\
		:xc#01777777:\
		:fc#017:\
		:fs#020000010002:
On my system, /dev/ircomm0 was created with
	mknod /dev/ircomm0 c 161 0

Problems

Nothing seems to work

If you are having problems that seem to be hard to pin down to IrDA, lpd, ghostscript etc., remember that you can use the printer in a more conventional configuration with a printer cable connected to your parallel port, and avoid confusing IrDA problems with others. You would need to change (or have an additional) printcap entry with lp=/dev/lp0. This will enable you to ensure all the non-IrDA bits are functional unfettered by any IrDA problems. Then you can swap to IrDA.

Flawed printer output

If the printer gives output, but occasionally skips a few head passes or distorts the odd head pass, you probably are not running in raw mode. See lpd. You can check if this is your problem by starting a print job and executing:
	stty raw < /dev/ircomm0

IrDA not loaded?

The IrDA modules must be loaded for IrDA to work (see start-up). You can check this with
	cat /proc/modules
which should give output including something like:
	ircomm                 14204   0 (unused)
	irtty                   7452   2 (autoclean)
	irda                  143361   1 (autoclean) [ircomm irtty]
Running
	ifconfig
should show a configured IrDA network device, i.e. output something like:
irda0     Link encap:UNSPEC  HWaddr E3-48-57-E9-00-00-00-C9-00-00-00-00-00-00-00-00  
          unspec addr:[NONE SET]  Mask:[NONE SET]
          UP RUNNING NOARP  MTU:2048  Metric:1
          RX packets:328 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2296 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:8 
The directory /proc/net/irda should exist, and that is where the entry "discovery" should be seen. Executing:
	cat /proc/net/irda/discovery
should show that your printer has been detected with something like:
IrLMP: Discovery log:
  nickname: BJC-80, hint: 0x8804, saddr: 0x7ee1e1e0, daddr: 0x1f8f081e

No sign of printer with IrDA

If the printer is not discovered by IrDA, the slot_timeout is probably too short. Try:
	echo 110 > /proc/sys/net/irda/slot_timeout
though the particular number (greater than the default 80) may vary with machine and kernel release. Note that you seem to have to use numbers divisible by 10. Check that the command actually works, as no errors are logged if it does not:
	cat /proc/sys/net/irda/slot_timeout

49,590 accesses.

Maintained by Dave Davey daved@physiol.usyd.edu.au

Last updated 5 July 2005

Valid HTML 4.01!