cups fails with 'permissions' problem on serial printer

I am trying to test GAINSCHA receipt printers on opensuse 11.4

They have supplied drivers and filter. I have added filter to /usr/lib/cups/filter and drivers(ppd files) to /usr/share/cups/model/gainscha/. I can add the printer model and driver from Yast.

The printer is a serial printer and I connect to it using ‘usb-to-serial’ converter. I can raw-print direct to printer by, ’ echo hello > /dev/ttyUSB0 '. It works.

Serial port parameters used while setting up Cups queue are correct. ( Tested via cutecom, opening port with the same parameters and writing to the port. It is also printing).

Now when I print from any application, the job is held up in Cups queue for reasons, ’ no permissions to port’. I tried becoming root and printing from kwrite. Again the same problem.

Any ideas? Thanks in advance.

cups doesn’t run as root, it runs as user lp. Therefore your serial port must have rw permissions for user lp.

I added user lp to dialout group, which has RW permissions on /dev/ttyUSB0, but to no avail. Then for testing, I added lp to group root, again to no avail.Then I ‘chmod’ ded permissions on /dev/ttyUSB0 to everybody. Then did cups work.

SuSEConfig should really have setup proper permission-scheme for serial printing when it setup the queue for me. But obviously it did not. I am not sure if this qualifies to be a bug, or it is an intentional design.

It’s not something that users often do, connecting a serial port to cups. So sysadmin skills are still useful here. The best way to do it is with a udev rule. You can do something similar to what I did for a camera:

adding a new PTP camera to udev - Blogs - openSUSE Forums

Put it in a new rules file. You can also change permission and ownership as explained here: Writing udev rules