Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: OldAdamUser2 on March 11, 2011, 08:31:29 PM
-
Has anyone had any luck getting a Brother HL-2040 printer to work using Cups or Cups1311 in Tiny Core? I've tried everything I can think of--following the advice on the wiki, downloading gutenprint, foomatic, ghostprint, etc. I always get some sort of error--though occasionally the printer whirrs into a brief sign of life without printing anything.
I don't want to go into the whole horrible litany of errors since I can easily print my documents by booting Xandros or PupEee. I'm just curious to see if there is any likelihood of success if I start to dig more deeply into details.
-
Perhaps this post (& thread)
http://forum.tinycorelinux.net/index.php?topic=3373.msg17639#msg17639
could be helpful for diagnostics.
-
This has now been updated and you can find it at
http://wiki.tinycorelinux.com/Printer+Setup+Using+Cups
==========================================
Original message:
This is something I wrote in 2009 for the HL-6050D printer. I should update and simplify it sometime.
I think setting up your printer should be the same.
I have noticed there have been some updates/changes since 2009. I am trying to get these clear myself. This information is a good starting point. Also read the following posts.
Things You Need
You need a printer.
You need Tiny Core installed on the computer.
You need an internet browser installed in Tiny Core.
You need Cups installed in Tiny Core.
You need Cups in On Boot.
To make an extension for your printer set up, which is recommended, the squashfs-tools-4.0 extension needs to be installed.
You need an internet connection to download the printer driver (some printers may have Linux drivers on a CD).
Download the Printer Driver
Download the driver for the make and model of the printer from http://www.openprinting.org/printers
There may be two different files containing the printer driver, a "deb" file and an "rpm" file. Download whichever is appropriate for the Linux distribution you will use to extract it.
Extract the Printer Driver
See following posts for how to extract this using Tiny Core.
In this example, a Debian operating system was used to extract the "deb" file.
Using the Debian operating system, create a new directory. In this example it is called "printertemp."
Copy and paste the printer driver to "printertemp."
Using the Root File Manager click on the file containing the printer driver. You will get a new window. Click "Extract." You will get a new window. Click "Extract" again.
After extraction, you will see two tar.gz directories called "control.tar.gz" and "data.tar.gz." Extract data.tar.gz using the same method.
You may delete the original compressed files, or leave them there.
The printer drivers are also tar.gz files. Leave them as they are, they do not need to be extracted.
Copy the directory "printertemp," with the files in it, to Tiny Core. Use Tiny Core for the rest of the setup.
Start Cups Automatically
So that Cups starts automatically each time Tiny Core is started, add
/usr/local/bin/cups_start.sh
to /opt/bootlocal.sh.
This seems to have changed with the latest update.
I think now you add
sudo /usr/local/etc/init.d/cups start
to /opt/bootlocal.sh.
To check, open the terminal and type:
/usr/local/etc/init.d/cups status
after restarting the computer.
If you don't have persistent /opt, to save settings, you must Backup when shutting down Tiny Core.
Before setting up the printer, turn the computer off and restart, so Cups is running.
If not already connected, connect the printer to the computer and turn it on before restarting.
Root Password
If you don't already have a root password, set one up. To do this, open the Root Terminal and type:
sudo passwd
Enter the root password when prompted. You need to enter it twice.
You need the root password for setting up the printer. After it is set up, you do not need it, unless you make changes.
So it is not necessary to save it.
If you want to save the root password when the computer is turned off, add the following line to /opt/.filetool.lst.
etc/shadow
Or make a new extension for the root password, using the same method as shown below.
If the printer is connected to a USB port, Cups will automatically detect it. Older printers may not be automatically detected.
Copy the Printer Driver to Tiny Core
Using a Root File Manager, copy and paste all of the files and directories in "printertemp," which you extracted previously, to the / directory in Tiny Core.
You may get several messages like, "'/opt' already exists - merge contents?" Click "yes" each time. (In this example Rox was used)
It may be easier to copy and paste the "OpenPrinting-Brother" directory to the "/opt" directory.
In this example PPR was used, so these files are automatically deleted when the computer is turned off.
Set Up the Printer
Start the internet browser.
Where you see the web site address in the web browser, normally in the middle near the top, starting with "http://," type:
http://localhost:631
Press "Enter."
You will see a new window. Click "Add Printer."
You will see a new window. Type a name and description for the printer. Click "Continue."
You will see a new window. Select your printer. Click "Continue."
You will see a new window. Click "Choose..." or "Browse..." (depending on which web browser you are using). You will see a new window. Go to the location of the printer driver and click on the driver for your make and model of printer. The Brother driver is in /opt/OpenPrinting-Brother/ppds/Brother/, with drivers for other brother printers. Click "Open." This window will close, and you will go back to the previous one. Click "Add Printer." You need to enter the username and password. The username is "root." Use the root password you selected earlier. Click "OK."
You will see a new window. If you want to change printer options, do it here. Click "Set Printer Options."
You will see a new window. Click "Set As Default."
The printer should work now. Print a test page.
Save Settings
At this stage, when the computer is turned off, the settings will be lost. Following are two different methods to save settings.
Method 1: Save Settings in Backup
To save settings in backup, add the following line to /opt/.filetool.lst.
etc/cups
It seems in the latest version it is usr/local/etc/cups
To save settings, you must Backup when shutting down Tiny Core.
Method 2: Make an Extension for the Printer - Recommended
As more files are added to backup, it takes longer. If you make extensions for things which don't need to be in backup, it will be a little quicker.
Begin by creating directories. Open the Root Terminal and type:
mkdir -p /home/myext/printer/etc/cups/ppd
It seems in the latest version you need /usr/local/etc/cups. Change this in all of these commands.
You can use different directories, but "/etc/cups/ppd" must be used.
If you use different directories, also use them in the following commands.
Copy and paste files.
cp -p /etc/cups/* /home/myext/printer/etc/cups/
cp -p /etc/cups/ppd/* /home/myext/printer/etc/cups/ppd/
Make an Extension
To make a extension called "myprinter.tcz," open the Terminal, and type:
sudo su
cd /home/myext
mksquashfs printer/ myprinter.tcz
Copy and paste the new extension to the "/tce/optional" directory.
Add the new extension to On Boot.
Keep a copy of your new extension somewhere else. If you update extensions, it may be deleted.
-------------------------------------
Note: Saving the entire /usr/local/etc/cups directory in backup or a new extension, is simple, and works.
Probably, only certain files in /usr/local/etc/cups, need to be saved, not all of them.
You could see which files remain unchanged when setting up the printer, and leave them out.
-
Can somebody explain what extension(s) need to be installed, and what commands need to be used to extract .deb and .rpm files in TinyCore.
-
OldAdamUser2
If you find anything different needs to be done with your model, or as a result of updates since that was written, share this so others may benefit.
-
Can somebody explain what extension(s) need to be installed, and what commands need to be used to extract .deb and .rpm files in TinyCore.
deb files are ar archives, which contain three files:
* debian-binary
* control.tar.gz
* data.tar.gz
The needed archived files exist in data.tar.gz.
First, extract the aforementioned three files from the deb file (ar archive):
ar vx mypackage.deb
Then extract the contents of data.tar.gz using tar:
tar -xzvf data.tar.gz
..or the contents of data.tar.gz can be extracted from the deb package in a one step process as shown below:
ar p mypackage.deb data.tar.gz | tar zx
-
Regarding exctraction of .rpm archives:
http://forum.tinycorelinux.net/index.php?topic=7681.msg41339#msg41339
EDIT: This is no longer necessary, for recent versions of busybox see #Reply 8.
-
In 2009, to start cups each time Tiny Core was started, it was necessary to add
/usr/local/bin/cups_start.sh
to /opt/bootlocal.sh.
I noticed cups has been updated.
To start cups automatically now, is it necessary to add anything to /opt/bootlocal.sh. If so what?
-
Explained simply, to extract an .rpm file, use:
rpm2cpio mypackage.rpm | cpio -vid
-
Thanks, Guy (and everybody else)--
This gives me a starting point. I'll give it some attention in the next few days and report back if I get it working.
-
Explained simply, to extract an .rpm file, use:
rpm2cpio mypackage.rpm | cpio -vid
Right, as simple as that...
I wasn't aware that this would work with recent busybox versions when I wrote last post (edited).
-
I played around with this a bit this morning without much progress. Following Guy's advice I tried to find a printer driver to download, but the web page seemed to direct me to download only the .ppd file. This makes sense to me because my printer uses the hpijs-pcl5e driver which is about the most common laser printer driver there is. As far as I can tell, it is already built in to cups1311 or foomatic-rip.
When I try to follow the advice for adding a printer on loaclhost:631, I can easily add my printer and select the appropriate .ppd file. At that point everything seems fine and Cups will report my printer default settings and change them if I wish. But I end up with the following error log--
E [14/Mar/2011:11:14:37 +0000] Filter "/usr/local/lib/cups/filter/foomatic-rip" for printer "Brother_HL-2040_series" not owned by root
E [14/Mar/2011:11:14:37 +0000] Filter "/usr/local/lib/cups/filter/foomatic-rip" for printer "Brother_HL-2040_series" not owned by root
E [14/Mar/2011:11:14:37 +0000] Filter directory "/usr/local/lib/cups/filter" for printer "Brother_HL-2040_series" not owned by root
E [14/Mar/2011:11:15:02 +0000] [CGI] smbclient not found!
E [14/Mar/2011:11:15:02 +0000] [CGI] rpcclient not found!
Sure enough the permissions for those files are all set for tc:staff instead of root:root.. But if I change the file permissions and then try to set up my printer, I am tossed into trying to set up an scsi printer or a network printer.
So I am still stymied.
-
You could try using the cups extension (make sure the cups1311 extension is not loaded) and setting the root password
-
I removed cups1311 and rebooted. Then I fired up cups and got the same error log. This log occurs before I even try to print anything. My current theory is that the problem has to do with smbclient and rpcclient.. Is there some package I can download to make them available? A search of the root directory does show some samba stuff, but not smbclient.
Thanks again for all the help.
-
Hi OldAdamUser2
I'm not sure why it would want those two programs unless you are trying to network the printer.
You can find them in samba3.tcz but that's a big package (~28Mb).
-
Thanks, Rich. Only now do I remember what samba services are for! They have to do with that dreadful, annoying, continuous message broadcast by Windows machines about networked printers: "Here I am! I'm waiting! Here I am!" I don't use a networked printer so I guess that theory is out.
-
I was finally able to follow Guy's advice to the letter. I downloaded the printer driver here:
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html
The good news is that Guy's advice worked very well indeed--up to a point. First I installed the printer with cups (plus footmatic-rip and ghostscript). Once the printer was installed and set up, the error log showed the same problems and the test page would not print. Then I removed cups from my onbool.lst, and downloaded cups1311. I set everything up again and got the exact same problems (Iwith a slightly different cups interface web page).
I suppose I can try downloading gutenprint, but it didn't work before and I think the driver I downloaded from Brother was already built-in to cups and cups1311. Vexing . . . but kinda fun in a twisted way.