WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Install Printer  (Read 310 times)

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Install Printer
« on: October 30, 2017, 12:01:36 PM »
In my case I have a Brother HL-2250DN Laser Printer

So far I've installed CUPS and it see's my printer, but does not print.  I presume I need drivers or something, hence I downloaded the files:

hl2250dnlpr-2.1.0-1.i386.rpm
cupswrapperHL2250DN-2.0.4-2.i386.rpm

Also available as deb files... either way how does one install on tinycore?

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #1 on: October 30, 2017, 12:43:41 PM »
Okay I have sudo su in terminal and done rpm -i packagename to install it, as to whether there's more to this I don't know.

Alas my printer still doesn't work from tinycore, can someone walk me through the setup of CUPS for a brother printer?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Install Printer
« Reply #2 on: October 30, 2017, 09:40:51 PM »
So far I've installed CUPS and it see's my printer, but does not print.
When cups browser interface sees your printer, does it propose a driver? When you try to print, does the cups log show any errors and, if so, what are they?

Quote
I presume I need drivers or something, hence I downloaded the files:

hl2250dnlpr-2.1.0-1.i386.rpm
cupswrapperHL2250DN-2.0.4-2.i386.rpm

Also available as deb files... either way how does one install on tinycore?
It might be a good idea to unpack the rpm/deb in a temporary location and examine the files they contain to see if they are required and, if so, whether they have dependencies on bash, perl, python, etc.

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #3 on: October 31, 2017, 12:53:59 AM »
How do I unpack them?

When I go in through CUPS it recognizes I have a network printer, but there is no make for brother, so far I tried generic and raw.  Neither of them work.

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #4 on: October 31, 2017, 01:41:18 AM »
Okay I found the command to unpack:

rpm2cpio packagename.rpm | cpio -idmv

tc@box:~/Downloads$ rpm -qlp hl2250dnlpr-2.1.0-1.i386.rpm
/usr/local/Brother
/usr/local/Brother/Printer
/usr/local/Brother/Printer/HL2250DN
/usr/local/Brother/Printer/HL2250DN/inf
/usr/local/Brother/Printer/HL2250DN/inf/brHL2250DNfunc
/usr/local/Brother/Printer/HL2250DN/inf/brHL2250DNrc
/usr/local/Brother/Printer/HL2250DN/inf/braddprinter
/usr/local/Brother/Printer/HL2250DN/inf/brprintconflsr3
/usr/local/Brother/Printer/HL2250DN/inf/paperinf
/usr/local/Brother/Printer/HL2250DN/inf/setupPrintcap2
/usr/local/Brother/Printer/HL2250DN/lpd
/usr/local/Brother/Printer/HL2250DN/lpd/filterHL2250DN
/usr/local/Brother/Printer/HL2250DN/lpd/psconvert2
/usr/local/Brother/Printer/HL2250DN/lpd/rawtobr3
/var/spool/lpd/HL2250DN
tc@box:~/Downloads$

tc@box:~/Downloads/cups_wrapper$ rpm -qlp cupswrapperHL2250DN-2.0.4-2.i386.rpm
/usr/local/Brother/Printer/HL2250DN
/usr/local/Brother/Printer/HL2250DN/cupswrapper
/usr/local/Brother/Printer/HL2250DN/cupswrapper/brcupsconfig4
/usr/local/Brother/Printer/HL2250DN/cupswrapper/cupswrapperHL2250DN-2.0.4


« Last Edit: October 31, 2017, 01:52:06 AM by archerbob »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Install Printer
« Reply #5 on: October 31, 2017, 03:44:27 AM »
..so it looks like you copy the contents of both rpm's to the root file system and then run the script cupswrapperHL2250DN-2.0.4 to install the cups wrapper/ppd driver.

Note that you might need to adjust /etc -> /usr/local/etc in the script.

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #6 on: October 31, 2017, 08:28:44 AM »
So instead of /usr/local/Brother drop the files into /root/usr/local/etc/Brother and so on?
« Last Edit: October 31, 2017, 08:45:36 AM by archerbob »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Install Printer
« Reply #7 on: October 31, 2017, 09:03:52 AM »
No, installl the files as you listed them - I assumed that you had expanded the rpm in /tmp or similar.

I would guess that the script /usr/local/Brother/Printer/HL2250DN/cupswrapper/cupswrapperHL2250DN-2.0.4 assumes the cups daemon is in /etc/init.d rather than /usr/local/etc/init.d - if tihs is the case, you will need to correct for it.

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #8 on: November 01, 2017, 10:04:46 PM »
I copied all files where they had to go as root and then did:

root@box:/usr/local/Brother/Printer/HL2250DN/cupswrapper# sh cupswrapperHL2250DN-2.0.4
cupswrapperHL2250DN-2.0.4: line 69: can't create /usr/share/ppd/HL2250DN.ppd: nonexistent directory
chmod: /usr/share/ppd/HL2250DN.ppd: No such file or directory
lpinfo: Transport endpoint is not connected
lpinfo: Transport endpoint is not connected
lpinfo: Transport endpoint is not connected
lpadmin: Unable to connect to server: Transport endpoint is not connected
root@box:/usr/local/Brother/Printer/HL2250DN/cupswrapper#

How do I correct for what you said?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Install Printer
« Reply #9 on: November 01, 2017, 10:26:11 PM »
In tinycore all extensions are compiled/installed to /usr/local - you can use the apps gui or look here to see where the cups extension files/folders are:

http://tinycorelinux.net/8.x/x86/tcz/cups.tcz.list

..this means that you will need to check the script cupswrapperHL2250DN-2.0.4 and edit it if/where required, for example:

/usr/share/ppd/ -> /usr/local/share/ppd/ [you may also need to create this directory]
/etc/init.d/cups -> /usr/local/etc/init.d/cups

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #10 on: November 01, 2017, 11:17:48 PM »
yeah the file is 566 lines, so I looked for an easier solution and found one at:

http://www.jnegre.org/news/2011/07/31/brother_HL_2250DN_ubuntu_linux.html

Quote

The Brother HL-2250DN is a laser printer with both a USB and an Ethernet interface. It understands PCL6, so I knew I could use it with my Ubuntu 10.10 box without too much troubles.

Here’s how to configure your computer to enjoy the Ethernet interface. One doesn’t buy a network printer to use USB, right?

First, one need to get the IP address of the printer. You could get it from your router, or you may just ask the printer. To print the settings of your printer, do the following:

    Switch on the printer;
    Wait till the printer is ready;
    Press “Go” three times in less than 2 seconds.

The IP address will be on the third page.

Now, on your Ubuntu box:

    Go to System / Administration / Printing;
    Click on the “Add” button;
    Select “LPD/LPR Host or Printer” on the left;
    On the right, enter the printer’s IP address;
    The name of the queue is “PCL_P1”;
    When asked for a driver, pick “Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v5.2.6 Simplified”.

And voilà!

I printed a test page and it seems to be working.  The only thing I did differently was to look up my printer IP in my modem/router instead of wasting 3 pages of paper pressing Go 3 times.

The only quirk I have noticed through this process is everytime I boot the cups service is not running and has to be started manually, the other quirk is that the root password is not static as I have to sudo su in terminal and passwd each time.

EDIT: I just added "sudo /usr/local/etc/init.d/cups start" into the bootlocal.sh file in the opt folder, I also just found the HL2250DN.ppd file in the /usr/local/etc/cups/ppd folder which I presume I could have used as well...

Thanks for your help Juanito, it's much appreciated!
« Last Edit: November 01, 2017, 11:42:52 PM by archerbob »

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #11 on: November 01, 2017, 11:56:50 PM »
Well I just did a reboot to see if eveything is still working, it's not...

CUPS now starts automatically.

All files I copied to /usr/local vanished, they aren't static

The root password I set still isn't static

The ppd file I found only appears after adding the printer, which the system forgets about upon next reboot requiring to be added again.  Adding a printer is not static and has to be added every boot.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Install Printer
« Reply #12 on: November 02, 2017, 01:12:04 AM »
Yes, that's the way tinycore works - you need to pack up the files you installed into your own personal extension or add them to your backup.

See the cups info file for more details

Offline archerbob

  • WikiUser
  • *
  • Posts: 21
Re: Install Printer
« Reply #13 on: November 02, 2017, 02:17:00 AM »
Is there a script I can add to bootlocal.sh that'll set the root password to my desired password at boot?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Install Printer
« Reply #14 on: November 02, 2017, 02:57:14 AM »
Why not do as per the cups info file:
Quote
...the root password needs to be set perform admin tasks with..
..the browser interface
$ sudo passwd
...
To persist across boots, add the following to your backup (remove leading "/"):
...
/etc/shadow (if you want to save to root password)