maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Printing with N900 (https://talk.maemo.org/showthread.php?t=56932)

mase 2010-06-23 15:12

Printing with N900
 
Hi!
I got cups-client compiled for the N900. I was able to print via a network
printer. That are just the original Debian package sources compiled
for Maemo.
I have uploaded the required packages to rapidshare. The rest of the
dependencies is available by the extras-devel repository. However there is
no application for the N900, which supports printing, so you have to use
the lp command. You also need lpadmin to add a network printer. A ppd
is required. I used Generic-PostScript_Level_1_Printer-Postscript1.ppd.
It is still highly experimental. Maybe someone can host these packages.
It was a hard way to these packages, because there were many
dependencies. But at the end, there are only 6 packages outside the
repos to install.
Here' s the link:
http://rapidshare.com/files/40201754...o.tar.bz2.html
Create a file /etc/cups/client.conf with the following entry:
Code:

ServerName <your-server-name>
Then /etc/cups/lpotions with:
Code:

Default <queue-name>
Then use the following command to add a printer:
Code:

lpadmin -p ps -v socket://192.168.1.0:9100/ -P /usr/share/cups/model/Generic-PostScript_Level_1_Printer-Postscript1.ppd -E
Replace socket... by the URI shown in the cups webinterface.
Be sure to copy the ppd file to the right path. Maybe you can use
some other ppd file.
Now you are able to print with
Code:

lp <filename>
Give it a try!

ToJa92 2010-06-23 15:15

Re: Printing with N900
 
Fennec supports printing, IIRC. Just go to a site which has a print option and you can print it, I think. Nice work!

mase 2010-06-23 18:06

Re: Printing with N900
 
I have compiled the gtklp package for Maemo.
Now you have easier access to the printing system and the driver.
http://rapidshare.com/files/40207138...armel.deb.html
The gui doesn't fix exactly to the device. I don't know much about gtk.
Maybe someone could fix the gui.
I could not reach "File" in the gui, so I could not add any files within. But if
I start gtklp <filename> the file is already added when the gui opens.
It is going forward!

I was able to use the turboprint ppd for my printer instead of the generic
postscript. So it seems I have full access to the driver functions.

mase 2010-06-25 04:59

Re: Printing with N900
 
No more feedback? Did nobody try it?

F2thaK 2010-06-25 05:02

Re: Printing with N900
 
hmmmmmmm sounds cool, and a bit to advanced for me

will wait for GUI

thanks, nice work MASE

mase 2010-06-25 05:11

Re: Printing with N900
 
There's a GUI called gtklp. I just uploaded to RS, because I still have no
permission to maemo-garage. I am waiting for a reply from the webmasters
to upload it to the repos.
But you still have to create the client.conf with the Servername.

ToJa92 2010-06-25 13:20

Re: Printing with N900
 
Unfortunately I'm not at home, otherwise I could have tried it(we have a Wifi printer at home).

mase 2010-06-28 12:25

Re: Printing with N900
 
I have uploaded the packages to extras-devel.
But be careful, if you wanna use the whole cups-system.
There could be missing dependencies with the package cups.
I have only tested cups-client. That is enough to print with
a network printer. I also uploaded gtklp-1.2.3. This version has
no file open dialog, so you have to open it in the console with
gtklp <filename>. Version 1.2.7 has such a dialog and would be
better to use on the phone, but I was not able to compile it in
scratchbox. I think, that is because libtool2 is missing in scratchbox.
Maybe someone could try to package it.

mase 2010-06-28 16:18

Re: Printing with N900
 
The howto is here:
https://garage.maemo.org/my/diary.php?diary_id=292

BruceL 2010-06-29 04:18

Re: Printing with N900
 
There should also be a native gui; use the web browser to go to http://localhost:631

The command line utilities like lp and lpadmin actually call the http server, not the other way around so the web interface is actually lower-level than the CLI utilities.

mase 2010-06-29 04:47

Re: Printing with N900
 
Right, but the cups server is not yet
installable with my packages. So you
don't have a webinterface on the phone.
Only installing cups-client works with my
packages.

borghal 2010-06-29 04:52

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 732852)

I get an error following your link: Entry not found or does not belong to you.
Thanks for your work!

mase 2010-06-29 05:12

Re: Printing with N900
 
The entry belongs to me and is public. But I repeated only, what I wrote above.

I am thinking about, removing the server-parts out of the build process. For me
there's no sense to install the server on the phone, while you cannot connect
a printer directly. I also think, a running server would decrease battery time.
With not installable parts, it can never move to testing or stable. There are
only the libraries needed of the following packages I made:
cracklib2, keyutils, krb5, libselinux, libsepol, openslp and pam.
But the other packages of these are installable. Do you think, they could
be usable for other projects?
The packages cups and cups-bsd can be removed.
What do you think?

woody14619 2010-06-29 21:02

Re: Printing with N900
 
The problem is that without the server side, I can't print to network printers without a cups-server elsewhere. I would like (for example) to be able to setup a printer for home, one or two at work, and one at a friends house. They are all network printers, (HP/PS printers). The problem is I can't add the work/friends printers, because they have no cups server running. They're just stand alone printers....

mase 2010-06-30 04:53

Re: Printing with N900
 
You mean, the server is needed to use samba
printers?
I will see, what I can do to get the server to work.
I will also give a try to cups-pdf and bluez-cups.
But I can only package bluez-cups. I don't have a
bt printer.

Fumanchu 2010-06-30 13:06

Re: Printing with N900
 
Great!

I think leafpad can print also... ctrl + p.

will have a look at other applications.

BruceL 2010-06-30 15:02

Re: Printing with N900
 
@Mase, FYI, If you are going to build the server, the hardest problem I had was finding out that it will crash with some of the optimizations that are turned on. Here are my notes on that:

In Makedefs:
Line 143: remove '-pie -fPIE' and remove $(OPTIM)
Line 150: remove '-Os' and remove '-fPIC'

mase 2010-06-30 15:44

Re: Printing with N900
 
Because I have no windows server, someone could try
smb://workgroup/server/printersharename
as printer URI.
If this works, there is no need for the cups-server.
I took this from here:
http://serverfault.com/questions/108...or-cups-client

woody14619 2010-06-30 18:23

Re: Printing with N900
 
Not Windows/SMB, per say, but even direct printing (port 9100) doesn't work. You can't add a printer without a server being there. Using lpadmin to add a printer reports "can not connect to server"...

Is there another way to add a printer to the setup without using lpadmin?

mase 2010-06-30 18:38

Re: Printing with N900
 
I did not find another way. But what's the problem ading a printer when a server exists?
Or do you mean, you cannot add a printer, if no cups-server is there? Isn't it possible to
add a win shared printer?

mase 2010-06-30 18:42

Re: Printing with N900
 
leafpad has printing support. But I cannot select a printer.
I also packaged libgnomecups and libgnomeprint.
libgnomeprintui did not compile in scratchbox.

woody14619 2010-06-30 19:05

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 735905)
I did not find another way. But what's the problem ading a printer when a server exists?
Or do you mean, you cannot add a printer, if no cups-server is there? Isn't it possible to
add a win shared printer?

I can't add a printer without a cups server in any way that I can see. I don't have a cups server here right now, so I can't test anything. And I'm not talking about smb, no windows involvement at all. Just direct printing to a network attached postscript printer (via port 9100), which is very common these days. (Literally, you can cat filename.ps | telnet printer.ip.addr.here 9100 to print things.)

Just to be clear, at home I have a 192.168.* network, at work I have a 10.* network. You're saying I can configure an HP printer with a 10.* address while connected to the cups server on my 192.* home network, then later when I connect to my work network I would be able to print to the 10.* printer? If so, that's great, but if all the logic is there to print to a printer from the client, why do I need a server to configure that connection? If not, then I'm hosed without a cups server setup on every network I want to print on.

My understanding is that the cups client sends all it's work to the cups server, which then does the actual printing. If that's the case, then you can't reliably print on a network unless that network has a central cups server.

mase 2010-07-01 04:43

Re: Printing with N900
 
I did not test to configure multiple printers.
To install the cups-server I have to install
the inet superserver. If this doesn't make
problems on the phone, I will give it a try.
My fear is, that this could take much battery.

mase 2010-07-01 18:35

Re: Printing with N900
 
I have updated the cups packages and uploaded its dependencies.
Now all cups-packages, cups and cups-bsd included, should be
installable. However I did not test it on the device yet, so feedback
is welcome.

woody14619 2010-07-02 01:01

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 737625)
I have updated the cups packages and uploaded its dependencies.
Now all cups-packages, cups and cups-bsd included, should be
installable. However I did not test it on the device yet, so feedback
is welcome.

I seem to have some issue with ghostscript. Is there a specific repository I need to enable to get it? The one in devel appears to be broken in some way. :( I tried following it down the rabbit hole a bit by pulling the ghostscript deb from the repository and seeing where it breaks, but it started veering into the generic armel repositories and/or foreign debian repositories that I wasn't comfortable pulling from without knowing what I'm doing. cups-bsd pulled fine though. :)

Code:

Nokia-N900-42-11:~# apt-get  install cups
The following packages have unmet dependencies:
  cups: Depends: ghostscript but it is not going to be installed
E: Broken packages
Nokia-N900-42-11:~# apt-get  install ghostscript
The following packages have unmet dependencies:
  ghostscript: Depends: debianutils (>= 1.6)
E: Broken packages
Nokia-N900-42-11:~# apt-get  install debianutils
The following packages have unmet dependencies:
  debianutils: PreDepends: coreutils (>= 4.5.8-1)
              PreDepends: mktemp
  upstart: PreDepends: sysvinit-utils (>= 2.86.ds1-23) or
                      busybox (>= 3:1.6.1.legal-1osso8) but it is not going to be installed
E: Broken packages


woody14619 2010-07-02 02:39

Re: Printing with N900
 
after some hacking with dpkg, I got enough installed to get cupsd operational. ghostscript is still not operational (or installed), and libpam0 won't configure. But after fixing the broken dpkg listings (and manually linking a bit) I've gotten it up and running enough to add printers and printed a few test pages!

It's not pretty (and apt-get / dpkg still complain about busted packages) but it's working! :)

bandora 2010-07-02 03:31

Re: Printing with N900
 
THANK YOU MASE!!!!!!!!!!! I've been waiting for this for ever!!!!

mase 2010-07-02 04:52

Re: Printing with N900
 
I did not have any dpkg problems in
scratchbox. However I did not test it
on the device. But it should be the same.
Anybody else having dpkg problems?

mase 2010-07-03 05:42

Re: Printing with N900
 
You were right! There were problems with ghostscript.
I fixed this. I also had to remove the ssl-cert dependency
from the server, because it was not possible for me to let
it configure correctly. But I uploaded ssl-cert. Maybe someone
can find the problem. It failes with the creation of ssl-cert-snakeoil.pem.

I could watch, that the internet connection is established very often.
I don't know, if it was before installing cups-client.

mase 2010-07-03 21:54

Re: Printing with N900
 
I also upoaded cups-pdf and bluez-cups.
I have no BT printer, so please test and report!

mase 2010-07-03 22:53

Re: Printing with N900
 
I had problems, authenticating to the server.
I got it doing this:

lppasswd -g lpadmin -a <username>

In /etc/cups/cupsd.conf enter this:

<Location /admin>
* AuthType BasicDigest
* AuthClass Group
* AuthGroupName cupsadm
* Encryption Required
* Order allow,deny
* Allow @LOCAL
</Location>

By the way: How can I print with fennec? I was told, that this is possible.

filologen 2010-07-05 09:20

Re: Printing with N900
 
Quote:

Originally Posted by mase (Post 739857)
I also upoaded cups-pdf and bluez-cups.
I have no BT printer, so please test and report!

Just tried to install cups-pdf, but there are dependency problems since libpaper-utils is missing, cf. http://maemo.org/packages/package_in...s-pdf/2.4.8-3/

lucas777 2010-07-05 10:22

Re: Printing with N900
 
Hey guys im totally lost with this now, First of all i did this

root

then apt get install cups

so it installs all this stuff, now im lost ive been over the thread but ive just confused myself any ideas?

mase 2010-07-05 11:54

Re: Printing with N900
 
Edit /etc/cups/cupsd.conf like above,
Then open http://localhost:631 in your browser.
Then add your printer.

narcisgarcia 2010-07-07 12:25

Maemo CUP howto
 
Quote:

Originally Posted by mase (Post 732852)

Could you copy this howto to a public page?

narcisgarcia 2010-07-09 19:56

Re: Printing with N900
 
Having installed cups and cups-client packages, I get the error "can not connect to server" when adding the printer with lpadmin.

Can somebody make a single how-to?

mase 2010-07-10 03:27

Re: Printing with N900
 
What should I write more?
I wrote everything in this thread. It's the same as it is on a normal linux system.
If you want to use multiple printers, I think you have to install the server components.
Maybe using the server with its webinterface will me easier to configure.

@narcisgarcia
Did you create a client.conf?

narcisgarcia 2010-07-10 09:09

Re: Printing with N900
 
I've done everything in the first pages of this thread.
I've also tried with the web interface (asks for an unknown password when applying changes)

I ask for a "single how-to" because I see talking about different solutions in this thread.

mase 2010-07-10 13:28

Re: Printing with N900
 
For the PW problem look at post #31 of this thread, a few posts above.

asys3 2010-07-10 20:54

Re: Printing with N900
 
I just tried a fresh installation of cups and its dependancy.

But at the end cups couldn't be configured because of libpam0g not fine configured, too:

Code:

/home/user # apt-get install cups   
Reading package lists... Done
Building dependency tree     
Reading state information... Done
cups is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up libpam0g (1.0.1-maemo1) ...
dpkg (subprocess): unable to execute post-installation script: No such file or directory
dpkg: error processing libpam0g (--configure):
 subprocess post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of cups:
 cups depends on libpam0g (>= 0.99.7.1); however:
  Package libpam0g is not configured yet.
dpkg: error processing cups (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libpam0g
 cups
E: Sub-process /usr/bin/dpkg returned an error code (1)
/home/user #

Any ideas how to get this configured?

Thanks in advance...
asys3


All times are GMT. The time now is 01:08.

vBulletin® Version 3.8.8