With this guide we will configure a MyBook World to act as a print server for a connected USB printer. After installing CUPS, we will demonstrate the administrative web interface, add a Printer and show how to print from Mac or Windows clients.
Prerequisites
See other guides on this site for more details:
- Enable Optware package repositories
- Disable Mionet (recommended, you can put that memory to better use)
- Check the USB printer is detected
[root@nas ~]# lsusb
Bus 001 Device 003: ID 04e8:3268 Samsung Electronics Co., Ltd
Bus 001 Device 001: ID 0000:0000
Installation
Install the cups and cups-doc packages as a minimum. You probably also want cups-pdf package for pdf support, and cups-driver-gutenprint which contains a vast array of print drivers for various models. Check against the supported list at gutenprint.
Warning: It is crucial to install the cups-doc package, it contains the entire web interface! If you omit this package, you see only 'Error 404' pages when trying to follow the rest of the instructions.
[root@nas ~]# /opt/bin/ipkg install cups
Installing cups (1.3.5-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/cups_1.3.5-1_arm.ipk
Installing libjpeg (6b-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/libjpeg_6b-2_arm.ipk
Installing libpng (1.2.24-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/libpng_1.2.24-1_arm.ipk
Installing zlib (1.2.3-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/zlib_1.2.3-2_arm.ipk
Installing libtiff (3.8.2-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/libtiff_3.8.2-1_arm.ipk
Installing libstdc++ (6.0.3-6) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/libstdc++_6.0.3-6_arm.ipk
Installing openssl (0.9.7m-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/openssl_0.9.7m-3_arm.ipk
Installing openldap-libs (2.3.38-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/openldap-libs_2.3.38-1_arm.ipk
Installing libdb (4.2.52-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/libdb_4.2.52-3_arm.ipk
Installing gdbm (1.8.3-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/gdbm_1.8.3-2_arm.ipk
Installing cyrus-sasl-libs (2.1.22-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/cyrus-sasl-libs_2.1.22-2_arm.ipk
Configuring cups
Configuring cyrus-sasl-libs
Configuring gdbm
Configuring libdb
Configuring libjpeg
Configuring libpng
Configuring libstdc++
Configuring libtiff
Configuring openldap-libs
Configuring openssl
Configuring zlib
Successfully terminated.
[root@nas ~]# /opt/bin/ipkg install cups-pdf
Installing cups-pdf (2.4.6-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/cups-pdf_2.4.6-2_arm.ipk
Installing ghostscript (8.61-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/ghostscript_8.61-1_arm.ipk
Installing fontconfig (2.5.0-0) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/fontconfig_2.5.0-0_arm.ipk
Installing expat (2.0.1-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/expat_2.0.1-1_arm.ipk
Installing freetype (2.1.10-4) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/freetype_2.1.10-4_arm.ipk
Installing gconv-modules (2.2.5-7) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/gconv-modules_2.2.5-7_arm.ipk
Configuring cups-pdf
Configuring expat
Configuring fontconfig
Configuring freetype
Configuring gconv-modules
Configuring ghostscript
Successfully terminated.
[root@nas ~]# /opt/bin/ipkg install cups-doc
Installing cups-doc (1.3.5-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/cups-doc_1.3.5-1_arm.ipk
Configuring cups-doc
Successfully terminated.
[root@nas ~]# /opt/bin/ipkg install cups-driver-gutenprint
Installing cups-driver-gutenprint (5.1.3-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/gumstix1151/cross/unstable/cups-driver-gutenprint_5.1.3-1_arm.ipk
Configuring cups-driver-gutenprint
Successfully terminated.
Make the following configuration changes to /opt/etc/cups/cupsd.conf
| Line | Old Value | New Value | Reason |
| 219 | # MaxJobs 500 | MaxJobs 50 | Reduce overheads on an embedded system! |
| ?? | # User lp | User sys | Swap the user and group, then uncomment the lines (we don't have an 'lp' user) |
| # Group sys | Group lp | ||
| 456 | # MaxClients 100 | MaxClients 10 | As above |
| 838 | AuthType Basic | Require valid-user | Obsolete configuration values |
| 839 | AuthClass System | ||
| 844 | Allow From 192.168.1.0/24 | Allow From 192.168.0.0/16 | Fix for wider range of home networks |
| 846 | # Encryption Required | Encryption Never | Temporary fix for SSL issue (see above) |
Create SSL Certificates
Before allowing 'Administrative' actions, the default CUPS configuration requires the web session between the user and CUPS to be encrypted (HTTPS). This is to secure the root password, which we need to present to CUPS.
Normally platform init.d scripts would create the SSL key if it is missing, but to keep out init scripts simple we will do it manually. You will get the odd security warning since this certificate has not been signed by any root hosts, but you can keep warnings to a minimum by ensuring the 'Common Name' matches the hostname of your device.
[root@nas ~]# chown sys:lp /opt/etc/ssl/
[root@nas ~]# openssl req -new -x509 -keyout /opt/etc/cups/ssl/server.key -out /opt/etc/cups/ssl/server.crt -days 365 -nodes -config /opt/share/openssl/openssl.cnf
Generating a 1024 bit RSA private key
.........................++++++
....................++++++
writing new private key to '/opt/etc/cups/ssl/server.key'
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [AU]:UK
State or Province Name (full name) [Some-State]:London
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]: MyBook World
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []: nas
Email Address []:
[root@nas cups]#
Bring up the server and check logs
[root@nas ~]# ldconfig
[root@nas ~]# /opt/sbin/cupsd
[root@nas ~]# tail -n 100 /opt/var/log/cups/error_log
Then visit the CUPS web-page in your regular web browser. The address is the same as your MyBook, but use port 631 and HTTPS, e.g.
https://nas:631

Adding a Printer
We can now Go to 'Administration' -> 'Find New Printers'. This page interrogates all of the 'backend' providers in cups for new devices and is fairly reliable for USB printers. I recommend you accept the default naming of the printer then click Next.

Rather than use any manufactures printer driver, it is best to pull apart any download they offer (windows or linux) to locate the "PPD file". This one file usually contains all the info CUPS needs to print. I downloaded the driver and extracted the ML-1610 PPD file. Provide this to the wizard like so:

Most of the options should be left at default. It is important for European users to set the paper size to A4 here!
Init scripts
symlink from /etc/init.d to /opt/doc/cups/Sxxxxxx and Kxxxxxx scripts
Is this best?
Troubleshooting
If the SSL certificate generation has failed you will have problems with the SSL transport for the CUPS website on the My Book, watch out for these messages in the logs:
I [05/Feb/2008:23:31:50 +0000] Generating SSL server key and certificate…
E [05/Feb/2008:23:31:50 +0000] Unable to create SSL server key and certificate - the openssl command stopped with status 1!
I [05/Feb/2008:23:31:50 +0000] Generating SSL server key and certificate…
E [05/Feb/2008:23:31:50 +0000] Unable to create SSL server key and certificate - the openssl command stopped with status 1!
Bugs in the ox-nas USB driver?
$ dmeg
<6>usb 1-1: new full speed USB device using oxnas-ehci and address 3
<3>usb 1-1: device descriptor read/64, error -110
<3>usb 1-1: device descriptor read/64, error -110
<6>usb 1-1: new full speed USB device using oxnas-ehci and address 4
<3>usb 1-1: device descriptor read/64, error -110
<3>usb 1-1: device descriptor read/64, error -110
<6>usb 1-1: new full speed USB device using oxnas-ehci and address 5
<3>usb 1-1: device not accepting address 5, error -110
<6>usb 1-1: new full speed USB device using oxnas-ehci and address 6
<3>usb 1-1: device not accepting address 6, error -110


























