Re: To access IPP-over-USB printer: Emulate remote machine in the network

2017-03-20 Thread Till Kamppeter

On 02/23/2017 12:47 AM, Seth Arnold wrote:

On Wed, Feb 22, 2017 at 04:42:46PM -0300, Till Kamppeter wrote:

So it looks like that we need to work with an extra interface (dummy0 with
IPv6) and find a way to let Avahi broadcast the interface's own host name or


Would you mind changing the name to something that would more clearly
reflect the reason why this dummy interface exists?

e.g., cups0 or cupsbrowser or cupslocal.

Ideally it'd be unique enough that searching the web for the name would
return our documentation about it and nothing else. 'dummy0' would easily
fail that test.


I also came already to this idea and in my most recent tests I called 
the interface "ippusbxd". I set up the interface for testing with the 
following commands:


sudo ip link add ippusbxd type dummy
sudo ip link set ippusbxd up
sudo ip link set ippusbxd multicast on
sudo ip -6 addr add 'fd00:1:1::1/64' dev ippusbxd

Note that for the testing I use a fixed IP address. For production a 
random one should be chosen.


   Till






--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: To access IPP-over-USB printer: Emulate remote machine in the network

2017-02-22 Thread Till Kamppeter

On 01/21/2017 09:56 AM, TJ wrote:

On 16/01/17 18:05, Till Kamppeter wrote:

In the beginning I used localhost:6 which makes polling capabilities
and status, printing, and web interface work, but the printer could not
be Avahi-broadcasted and so CUPS and cups-browsed could not discover it.


Possibly not the ideal solution but did you test whether using
avahi-daemon.conf's "deny-interfaces=" with a single interface name that
it is safe to ignore (a throw-away dummy interface) would work?

I ask because the man-page for avahi-daemon.conf seems to imply that the
interface default action is to ignore 'lo' and any point-to-point
interfaces, but if using "deny-interfaces=" without any
"allow-interfaces=" it will use all interfaces not specified - which
implies that it would then use 'lo'. E.g:

# allow-interfaces=
deny-interfaces=dummy0
# implication is that 'lo' will be used

If the functionality is only required for the localhost's CUPS service
this might be sufficient.





I have done some testing, modifying the avahi-daemon.conf as described, 
restarting avahi-daemon, and running avahi-discover to see which 
services get broadcasted on which interfaces. The "lo" interface did not 
appear, also not after running


sudo ip link set lo multicast on

This should activate multicast support on lo if this is possible (at 
least "ifconfig" shows the activated multicast flag).


It seems that lo does definitively not have broadcasting support, as

sudo ip link set lo broadcast 127.255.255.255

errors with "Invalid argument".

See also

http://serverfault.com/questions/554503/how-do-i-add-a-broadcast-ip-to-the-loopback-interface-under-os-x-using-ifconfig

http://serverfault.com/questions/421389/how-to-add-a-broadcast-address-to-loopback-with-ifconfig-on-a-os-x

So it looks like that we need to work with an extra interface (dummy0 
with IPv6) and find a way to let Avahi broadcast the interface's own 
host name or the interface's IP address instead of the system's host 
name or we need a way to make ippusbxd emulate a remote host with its 
own host name and IP address but not creating a virtual machine, if this 
would be possible.


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: To access IPP-over-USB printer: Emulate remote machine in the network

2017-02-21 Thread Till Kamppeter

On 01/21/2017 09:56 AM, TJ wrote:

On 16/01/17 18:05, Till Kamppeter wrote:

In the beginning I used localhost:6 which makes polling capabilities
and status, printing, and web interface work, but the printer could not
be Avahi-broadcasted and so CUPS and cups-browsed could not discover it.


Possibly not the ideal solution but did you test whether using
avahi-daemon.conf's "deny-interfaces=" with a single interface name that
it is safe to ignore (a throw-away dummy interface) would work?

I ask because the man-page for avahi-daemon.conf seems to imply that the
interface default action is to ignore 'lo' and any point-to-point
interfaces, but if using "deny-interfaces=" without any
"allow-interfaces=" it will use all interfaces not specified - which
implies that it would then use 'lo'. E.g:

# allow-interfaces=
deny-interfaces=dummy0
# implication is that 'lo' will be used

If the functionality is only required for the localhost's CUPS service
this might be sufficient.





I doubt that this will actually work. The loopback interface "lo" is not 
multicast-capable whereas the Avahi/DNS-SD broadcasting works only with 
multicast interfaces.


Did you already try something like that? Were you actually able to do 
DNS-SD broadcasts on "lo"?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


To access IPP-over-USB printer: Emulate remote machine in the network

2017-01-16 Thread Till Kamppeter
tl;dr: Creating an emulated remote machine representing a USB printer as 
it was a network printer, without VM with it's own kernel


Hi,

I am developing the ippusbxd daemon to support IPP-over-USB printers:

https://github.com/tillkamppeter/ippusbxd/

Modern network printers use IPP (Internet Printing Protocol) for clients 
communicating with them. Also CUPS uses this protocol. In contrary 
toolder, simpler protocols one cannot only simply send jobs (and pray) 
but also request status info and, very important for driverless 
printing, request information about the printer's capabilities.


To make all this possible on a USB printer (and even accessing the 
printer's web admin interface) IPP-over-USB was introduced:


ftp://ftp.pwg.org//pub/pwg/ipp/whitepaper/draft-ippusbspecification-20110510.pdf

ippusbxd mirrors the IPP printer into the network, so that it can be 
handled like a network printer, espocially to access the web interface 
with a browser and to make CUPS and cups-browsed handle the printer like 
a network printer.


In the beginning I used localhost:6 which makes polling capabilities 
and status, printing, and web interface work, but the printer could not 
be Avahi-broadcasted and so CUPS and cups-browsed could not discover it.


Then I tried the "dummy" network device with an IPv6 ULA IP address. 
This I could broadcast with Avahi and the broadcasts only appeared on 
the local machine, as I wanted to have it, but I could only work with th 
(awkward) IP address and not with host names, as Avahi broadcasts only 
the one host name of the system and this hostname resolves only into the 
system's network IP, not the IP of the dummy interface. Printing and 
capability/status polling works IP-based, but not the web admin 
interface of the printer.


See also my earlier discussion about this here on the list in the "Using 
the dummy0 interface for a local-only service to be broadcasted by 
Avahi" thread.


Now my new idea would be the following:

Is it possible to emulate a remote machine in the network, without 
creating a virtual machine (with its own Linux kernel)?


The emulated remote machine should have its own IP (can be IPv6) and 
host name (and ideally its own ports) and it should be on an interface 
which supports multicast (like dummy, so that one can Avahi-broadcast 
the emulated machine to the local machine). The emulation should by 
fired up by ippusbxd and the printer be cuoled to that machine, so that 
one can access the IPP-over-USB printer like a remote network printer, 
ideally via hostname:631 for printing and hostname:80 for the web interface.


Is this possible?

   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2017-01-10 Thread Till Kamppeter

On 01/10/2017 02:10 AM, Mathieu Trudel-Lapierre wrote:

On Fri, Dec 30, 2016 at 2:44 PM, Till Kamppeter
mailto:till.kamppe...@gmail.com>> wrote:
[...]

I also get:

till@till-x1carbon:~$ hostname -I
192.168.0.15 192.168.122.1 2804:14c:5ba8:8b97::1
2804:14c:5ba8:8b97:205:1bff:feb0:7395 fd00:1:1::1
till@till-x1carbon:~$ hostname -A
till-x1carbon till-x1carbon till-x1carbon till-x1carbon
ippusbxd-printers
till@till-x1carbon:~$

Does this mean that the first 4 IPs have the host name till-x1carbon
and the address fd00:1:1::1 has the host name ippusbxd-printers?

"ping ippusbxd-printers" pings the address fd00:1:1::1.


The man page states for -A:  "Do not make any assumptions about the
order of the output."

It simply means that there are a few names you can use *locally* to
refer to this system; one of which being "ippusbxd-printers"; as
discovered by looking at each configured interface and resolving the
address. Nothing more.

Any service that needs to listen to things and care about hostname will
need to ask the system on its own what the hostname should be. This is
typically done using gethostname() (and it looks like that's what avahi
is doing), or looking at files such as /etc/hostname, or asking a daemon
like systemd-hostnamed. The closer approximation on the command-line
would probably be "getent hosts fd00:1:1::1", but it won't help you if
that's not what avahi cares about.


Problems:

1. I would like to assign the name by Zeroconf and not by modifying
/etc/hosts. How can I do this.

2. Bonjour/Avahi broadcasting still does not work correctly.

I still register via

error =
avahi_entry_group_add_service_strlst(bonjour_data->ipp_ref,
(int)if_nametoindex("ippusbxd"),
AVAHI_PROTO_UNSPEC, 0,
dnssd_name,
"_ipp._tcp", NULL, NULL, 6,
ipp_txt);


Set something other than NULL as the "host" parameter? (the second NULL
in that call)



but the "Address:" entry in the Bonjour record visible in
avahi-discover (Interface: ippusbxd -> local -> Internet Printer)
still uses the wrong host name:

Address: till-x1carbon.local/fd00:1:1::1:6

It should be

Address: ippusbxd-printers/fd00:1:1::1:6

How can I fix this?


I expect that will be fixed when you specify a hostname as you register
the service. Otherwise, NULL just tells avahi to use the hostname it
already knows, which will be what gethostname() returns.


I have tried this one

error =
 avahi_entry_group_add_service_strlst(bonjour_data->ipp_ref,
 (int)if_nametoindex("ippusbxd"),
 AVAHI_PROTO_UNSPEC, 0,
 dnssd_name,
 "_ipp._tcp", NULL, "ippusbxd-printers", 6,
 ipp_txt);

end it returns error code -3.

As I told already earlier, I have assigned the host name 
"ippusbxd-printers" to the IPP address fd00:1:1::1 in /etc/hosts and 
Firefox and CUPS resolve this host name correctly.


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2017-01-09 Thread Till Kamppeter

Someone can help me on the problem I have posted some days ago? See below.

   Till


On 12/30/2016 05:44 PM, Till Kamppeter wrote:

On 12/30/2016 12:15 PM, Till Kamppeter wrote:

If dealing with IPv6 link-local becomes too much of a pain, you can
still go the ULA way and generate a random ULA address that you add to
your ippusbxd interface which will then work without needing the
interface name or interface id suffix.



Thank you very much, I will look into the random ULA address solution.



I am now using a fixed ULA for testing:

Setup:

sudo ip link add ippusbxd type dummy
sudo ip link set ippusbxdq up
sudo ip link set ippusbxd multicast on
sudo ip -6 addr add 'fd00:1:1::1/64' dev ippusbxd

The new forth line assigns the fixed ULA fd00:1:1::1.

ULA does not need interface specification:

Print queue also works with

ipp://[fd00:1:1::1]:6/ipp/print

Web browser and wget accept

http://[fd00:1:1::1]:6/

but interface does not get loaded completely by browser.

Added

fd00:1:1::1ippusbxd-printers

to /etc/hosts

and firefox loads web admin interface of the printer completely via

http://ippusbxd-printers:6/

and the printer URI

ipp://ippusbxd-printers:6/ipp/print

prints correctly.

I also get:

till@till-x1carbon:~$ hostname -I
192.168.0.15 192.168.122.1 2804:14c:5ba8:8b97::1
2804:14c:5ba8:8b97:205:1bff:feb0:7395 fd00:1:1::1
till@till-x1carbon:~$ hostname -A
till-x1carbon till-x1carbon till-x1carbon till-x1carbon ippusbxd-printers
till@till-x1carbon:~$

Does this mean that the first 4 IPs have the host name till-x1carbon and
the address fd00:1:1::1 has the host name ippusbxd-printers?

"ping ippusbxd-printers" pings the address fd00:1:1::1.


Problems:

1. I would like to assign the name by Zeroconf and not by modifying
/etc/hosts. How can I do this.

2. Bonjour/Avahi broadcasting still does not work correctly.

I still register via

error =
avahi_entry_group_add_service_strlst(bonjour_data->ipp_ref,
(int)if_nametoindex("ippusbxd"),
AVAHI_PROTO_UNSPEC, 0,
dnssd_name,
"_ipp._tcp", NULL, NULL, 6,
ipp_txt);

but the "Address:" entry in the Bonjour record visible in avahi-discover
(Interface: ippusbxd -> local -> Internet Printer) still uses the wrong
host name:

Address: till-x1carbon.local/fd00:1:1::1:6

It should be

Address: ippusbxd-printers/fd00:1:1::1:6

How can I fix this?

   Till




--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-30 Thread Till Kamppeter

On 12/30/2016 12:15 PM, Till Kamppeter wrote:

If dealing with IPv6 link-local becomes too much of a pain, you can
still go the ULA way and generate a random ULA address that you add to
your ippusbxd interface which will then work without needing the
interface name or interface id suffix.



Thank you very much, I will look into the random ULA address solution.



I am now using a fixed ULA for testing:

Setup:

sudo ip link add ippusbxd type dummy
sudo ip link set ippusbxdq up
sudo ip link set ippusbxd multicast on
sudo ip -6 addr add 'fd00:1:1::1/64' dev ippusbxd

The new forth line assigns the fixed ULA fd00:1:1::1.

ULA does not need interface specification:

Print queue also works with

ipp://[fd00:1:1::1]:6/ipp/print

Web browser and wget accept

http://[fd00:1:1::1]:6/

but interface does not get loaded completely by browser.

Added

fd00:1:1::1 ippusbxd-printers

to /etc/hosts

and firefox loads web admin interface of the printer completely via

http://ippusbxd-printers:6/

and the printer URI

ipp://ippusbxd-printers:6/ipp/print

prints correctly.

I also get:

till@till-x1carbon:~$ hostname -I
192.168.0.15 192.168.122.1 2804:14c:5ba8:8b97::1 
2804:14c:5ba8:8b97:205:1bff:feb0:7395 fd00:1:1::1

till@till-x1carbon:~$ hostname -A
till-x1carbon till-x1carbon till-x1carbon till-x1carbon ippusbxd-printers
till@till-x1carbon:~$

Does this mean that the first 4 IPs have the host name till-x1carbon and 
the address fd00:1:1::1 has the host name ippusbxd-printers?


"ping ippusbxd-printers" pings the address fd00:1:1::1.


Problems:

1. I would like to assign the name by Zeroconf and not by modifying 
/etc/hosts. How can I do this.


2. Bonjour/Avahi broadcasting still does not work correctly.

I still register via

error =
avahi_entry_group_add_service_strlst(bonjour_data->ipp_ref,
(int)if_nametoindex("ippusbxd"),
AVAHI_PROTO_UNSPEC, 0,
dnssd_name,
"_ipp._tcp", NULL, NULL, 6,
ipp_txt);

but the "Address:" entry in the Bonjour record visible in avahi-discover 
(Interface: ippusbxd -> local -> Internet Printer) still uses the wrong 
host name:


Address: till-x1carbon.local/fd00:1:1::1:6

It should be

Address: ippusbxd-printers/fd00:1:1::1:6

How can I fix this?

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-30 Thread Till Kamppeter

On 12/30/2016 12:15 PM, Till Kamppeter wrote:

If dealing with IPv6 link-local becomes too much of a pain, you can

still go the ULA way and generate a random ULA address that you add to
your ippusbxd interface which will then work without needing the
interface name or interface id suffix.



Thank you very much, I will look into the random ULA address solution.



On the page

https://en.wikipedia.org/wiki/Unique_local_address

it is said one should create a ULA address space with a pseudo-random 
prefix according to RFC 4193 (https://tools.ietf.org/html/rfc4193, 
section 3.2.2). Is there readily available C code for this, for example 
a library function?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-30 Thread Till Kamppeter

On 12/30/2016 12:01 PM, Stéphane Graber wrote:

- Is there any replacement for the third line using the "ip" instead of the
"ifconfig" command?


sudo ip link set ippusbxd multicast on


- How can I implement these three lines in C?


I think the recommended way to do so nowadays in C (and what iproute2
itself uses) is through the kernel's netlink interface, possibly through
the use of libnl or another binding.

You should be able to find some example code out there, though note that
netlink certainly isn't the most developer friendly kernel API (but is
unfortunately the only real one for networking) :)



Thanks, I will look into this.


And now to the real problem:


[...]


- cups-browsed adding "%25ippusbxd". To implement this I would need a method
(in C) which finds out that the IP belongs to the "ippusbxd" interface.


Should be reasonably easy to iterate through all interfaces and find
which has the matching address (that would be done through netlink too).


If dealing with IPv6 link-local becomes too much of a pain, you can
still go the ULA way and generate a random ULA address that you add to
your ippusbxd interface which will then work without needing the
interface name or interface id suffix.



Thank you very much, I will look into the random ULA address solution.

   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-30 Thread Till Kamppeter

On 12/29/2016 10:29 PM, Till Kamppeter wrote:

do you (does someone) know how to set up the dummy-based interface named
"ippusbxd" so that it does multicast?

   Till



The multicast problem I have solved now. I set up the interface via

sudo ip link add ippusbxd type dummy
sudo ip link set ippusbxd up
sudo ifconfig ippusbxd multicast

The first two lines are Stephane Graber's original suggestion, the third 
I have added and this added the multicast support making ippusbxd 
registering the printer for Avahi/Bonjour broadcast.


For this setup I would also like to know

- Is there any replacement for the third line using the "ip" instead of 
the "ifconfig" command?


- How can I implement these three lines in C?

And now to the real problem:

I register the printer with an Avahi function call like this:

error =
avahi_entry_group_add_service_strlst(bonjour_data->ipp_ref,
(int)if_nametoindex("ippusbxd"),
AVAHI_PROTO_UNSPEC, 0,
dnssd_name,
"_ipp._tcp", NULL, NULL, 6,
ipp_txt);

This makes my printer being advertised as an "Internet Printer" on the 
"ippusbxd" interface, IPv6-only, with the IPv6 IP address of the 
"ippusbxd" interface on port 6.


avahi-discover shows the following record on the local machine:

Service Type: _ipp._tcp
Service Name: Deskjet 2540 series [BR54BFB02C05XK]
Domain Name: local
Interface: ippusbxd IPv6
Address: till-x1carbon.local/fe80::24bb:2ff:fe83:ca22:6
TXT URF = CP1,IS1-5-7,MT1-2-3-4-5-6-8-9-10-11-12-13,RS300,SRGB24,V1.4,W8,DM1
TXT rp = ipp/print
TXT usb_MDL = Deskjet 2540 series
TXT qtotal = 1
TXT usb_MFG = HP
TXT ty = HP Deskjet 2540 series
TXT product = (Deskjet 2540 series)
TXT priority = 60
TXT Duplex = U
TXT pdl = image/urf,image/jpeg
TXT Color = U
TXT adminurl = http://localhost:6/
TXT txtvers = 1

The problem is the advertised address ("Address:" line). First, the host 
name of the local box is advertised and, second, the IPv6 IP address has 
no interface specification ("%ippusbxd" or "%25ippusbxd").


A client (like ippfind) picking up this record would create a printer 
URI with the host name, "ipp://till-x1carbon.local:6/ipp/print" in 
this case ("ipp;//" +  + ":" +  + "/" + ).


If a print queue would get set up and printed on it, the host name 
"till-x1carbon.local" would get resolved to the default IPv4 IP address 
of the eth0 interface, 192.168.0.11 for example, and not to the IP of 
the ippusbxd interface. The record even does not have any mention of the 
"ippusbxd" interface.


So first, I would like to know how to assign another host name to the 
fe80::24bb:2ff:fe83:ca22 IPv6 address of the "ippusbxd" interface, like 
for example "ippusbxd-printers", preferably via Zeroconf/Avahi, 
especially as ippusbxd could more easily set it up this way than 
manipulate /etc/hosts. I tried also /etc/hosts, like it is done with 
"localhost" for 127.0.0.1 and ::1, but this did not work for me.


cups-browsed sets up the queues with IP addresses and not with host 
names, but the tools of CUPS itself all use host names.


I tried to set up a CUPS queue manually, using the IP (as I do not have 
a working host name) and the URI (pure IP)


ipp://[fe80::e828:7eff:fe19:9962]:6/ipp/print

does not work whereas the URI (IP with specification of interface)

ipp://[fe80::e828:7eff:fe19:9962%25ippusbxd]:6/ipp/print

works perfectly.

So I would need:

- A host name assigned to the "ippusbxd" IP being resolved to 
"[fe80::e828:7eff:fe19:9962%25ippusbxd]" and not only 
"[fe80::e828:7eff:fe19:9962]". This would be required for CUPS' own 
tools to work.


- cups-browsed adding "%25ippusbxd". To implement this I would need a 
method (in C) which finds out that the IP belongs to the "ippusbxd" 
interface.


Any help here is highly appreciated

   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 09:28 PM, Philipp Kern wrote:

On 12/29/2016 11:53 PM, Till Kamppeter wrote:

so that means then that via an IPv6 link-local address there is no way
to access the admin interface of the printer with a web browser?

So one can only access via CUPS?


I think the answer here is: If an application speaks Zeroconf/Bonjour
natively, it can do everything correctly (which is true for instance
with CUPS itself). This is because avahi will expose the interface where
the device was discovered to the application. If you want to rely on
just mDNS names using NSS, it won't be sufficient to access devices via
IPv6 link-local addresses.

Of course devices usually broadcast all of their addresses, of which
some will be routable anyway.

Kind regards
Philipp Kern




OK,

do you (does someone) know how to set up the dummy-based interface named 
"ippusbxd" so that it does multicast?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter
so that means then that via an IPv6 link-local address there is no way 
to access the admin interface of the printer with a web browser?


So one can only access via CUPS?

   Till

On 12/29/2016 08:16 PM, Philipp Kern wrote:

On 12/29/2016 10:33 PM, Till Kamppeter wrote:

Is there a way to make a local Zeroconf host name get assigned to this
IPv6 IP address?


This feels impossible to me as no-one added scope IDs to DNS. There is
no way for the stack to pick the right interface to use without that
information. Note that ::1 would not be affected by this[0].

I thought with the introduction of %25 as the canonical separator the
issue was settled on how to address link-local addresses. Turns out
that's not the case and browsers intentionally do not support it
(Firefox bug[0], Chrome bug[1], WHATWG URL spec bug[2]).

Kind regards
Philipp Kern

[0] I understand the need for differences between IPv4 and IPv6 but I
still don't understand why - of all the things - localhost was limited
to a single /128 address, whereas it's a /8 on IPv4. Which means that
there's also a port conflict gamble going on there.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=700999
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=70762
[3] https://www.w3.org/Bugs/Public/show_bug.cgi?id=27234





--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

[ Posting back to the ubuntu-devel mailing list ]

On 12/29/2016 07:42 PM, Thomas Ward wrote:

You could use /etc/hosts to define a dummy host name that Firefox could 
recognize.



I have added this line to /etc/hosts and it did not work:

fe80::e828:7eff:fe19:9962%ippusbxd  ippusbxd-printers

I have also tried

fe80::e828:7eff:fe19:9962%25ippusbxdippusbxd-printers

and also put "[...]" around the IP address. When I try to resolve the 
name ippusbxd-printers (for example with "wget") I get something like


Dec 29 20:18:38 till-x1carbon systemd-resolved[1462]: Address 
'fe80::e828:7eff:fe19:9962%ippusbxd' is invalid, in line /etc/hosts:10.


in /var/log/syslog.

If I add the line

fe80::e828:7eff:fe19:9962   ippusbxd-printers

wget can resolve the IP address from the name, but it cannot access as 
the interface is not specified:


till@till-x1carbon:~$ wget ippusbxd-printers:6
--2016-12-29 20:24:11--  http://ippusbxd-printers:6/
Resolving ippusbxd-printers (ippusbxd-printers)... fe80::e828:7eff:fe19:9962
Connecting to ippusbxd-printers 
(ippusbxd-printers)|fe80::e828:7eff:fe19:9962|:6... failed: Invalid 
argument.

till@till-x1carbon:~$

Specifying the interface is not accepted by wget, wget considers the 
interface as a part of the name:


till@till-x1carbon:~$ wget ippusbxd-printers%ippusbxd:6
--2016-12-29 20:45:52--  http://ippusbxd-printers%25ippusbxd:6/
Resolving ippusbxd-printers%ippusbxd (ippusbxd-printers%ippusbxd)... 
failed: Name or service not known.

wget: unable to resolve host address ‘ippusbxd-printers%ippusbxd’
till@till-x1carbon:~$ wget ippusbxd-printers%25ippusbxd:6
--2016-12-29 20:45:59--  http://ippusbxd-printers%25ippusbxd:6/
Resolving ippusbxd-printers%ippusbxd (ippusbxd-printers%ippusbxd)... 
failed: Name or service not known.

wget: unable to resolve host address ‘ippusbxd-printers%ippusbxd’
till@till-x1carbon:~$

In Firefox it is even worse. The name, either with and without 
specification of the interface is not resolved at all and Firefox tries 
to add "www." and ".com".


   Till







*Sent from my iPhone.  Please excuse any typos, as they are likely to happen by 
accident.*


On Dec 29, 2016, at 16:33, Till Kamppeter  wrote:


On 12/29/2016 05:27 PM, Philipp Kern wrote:

On 12/29/2016 08:16 PM, Till Kamppeter wrote:
This would especially mean that I can access the printer's web admin
interface by pointing a browser to this address so I try the simple
command line browser wget:


curl seems to work:

$ curl "http://[fe80::3664:a9ff:fe9a:f5b8%25br0]/";
No such site at :80
$ curl "http://[fe80::3664:a9ff:fe9a:f5b8%br0]/";
No such site at :80

If only we had universal support for interface scopes by having a
unified function that parses IP addresses...

Kind regards
Philipp Kern



Thank you very much.

curl 'http://[fe80::e828:7eff:fe19:9962%25ippusbxd]:6/' > testfile.gz
gunzip testfile.gz

gives an actual HTML file.

I am not able to open this URL with Firefox, as this browser does not seem to 
understand the syntax of the IPv6 URL.

Is there a way to make a local Zeroconf host name get assigned to this IPv6 IP 
address?

  Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 05:27 PM, Philipp Kern wrote:

On 12/29/2016 08:16 PM, Till Kamppeter wrote:

This would especially mean that I can access the printer's web admin
interface by pointing a browser to this address so I try the simple
command line browser wget:


curl seems to work:

$ curl "http://[fe80::3664:a9ff:fe9a:f5b8%25br0]/";
No such site at :80
$ curl "http://[fe80::3664:a9ff:fe9a:f5b8%br0]/";
No such site at :80

If only we had universal support for interface scopes by having a
unified function that parses IP addresses...

Kind regards
Philipp Kern



A success message:

When I run

driverless 
'ipp://[fe80::e828:7eff:fe19:9962%25ippusbxd]:6/ipp/print' > test.ppd


on a current, fully up-to-date Zesty, the file test.ppd contains a valid 
PPD file for my printer, meaning that the "driverless" utility (of the 
cups-filters package) queried the printer via IPP, talking to it via the 
IPv6-based IP address with explicit selection of the interface.


As "driverless" talks to the network using the CUPS library libcups, it 
seems that I have found out how to talk IPv6 to CUPS.


Also

ipptool -tv 
'ipp://[fe80::e828:7eff:fe19:9962%25ippusbxd]:6/ipp/print' 
get-printer-attributes.test > out.txt


works (needs cups-ipp-tools installed). out.txt contains the IPP 
attributes record of the printer after this command.


I can even create a driverless print queue

lpadmin -p DJ2540IPv6 -E -v 
'ipp://[fe80::e828:7eff:fe19:9962%25ippusbxd]:6/ipp/print' 
-meverywhere -o PageSize=A4


and actually print on my printer:

lp -d DJ2540IPv6 ~/.quiltrc

So the IPv6 URI works perfectly well with CUPS, problems are now:

- The IPv6 IP does not work with web browsers (Firefox, Chrome; for the 
printer's admin interface) and wget.


- I am not able to Bonjour-broadcast my printer with this URI. Probably 
one only needs to make this dummy-based "ippusbxd" interface do multicast.


   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 05:27 PM, Philipp Kern wrote:

On 12/29/2016 08:16 PM, Till Kamppeter wrote:

This would especially mean that I can access the printer's web admin
interface by pointing a browser to this address so I try the simple
command line browser wget:


curl seems to work:

$ curl "http://[fe80::3664:a9ff:fe9a:f5b8%25br0]/";
No such site at :80
$ curl "http://[fe80::3664:a9ff:fe9a:f5b8%br0]/";
No such site at :80

If only we had universal support for interface scopes by having a
unified function that parses IP addresses...

Kind regards
Philipp Kern



Thank you very much.

curl 'http://[fe80::e828:7eff:fe19:9962%25ippusbxd]:6/' > testfile.gz
gunzip testfile.gz

gives an actual HTML file.

I am not able to open this URL with Firefox, as this browser does not 
seem to understand the syntax of the IPv6 URL.


Is there a way to make a local Zeroconf host name get assigned to this 
IPv6 IP address?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 04:53 PM, Stéphane Graber wrote:

On Thu, Dec 29, 2016 at 04:38:05PM -0200, Till Kamppeter wrote:

Thank you. I want to bind with the bind(2) function in C. How do I supply
the interface here or what function do I need to call instead?

   Till


#include 
#include 

int main(int argc, char *argv[])
{
   int s;
   struct sockaddr_in6 ip6;

   // Basic inet6 socket
   s = socket(AF_INET6, SOCK_DGRAM, 0);

   // Initialize the ip6 struct
   ip6.sin6_family=AF_INET6;
   ip6.sin6_addr=in6addr_any;
   ip6.sin6_port=htons(1234);
   ip6.sin6_scope_id=if_nametoindex("ippusbxd");
   inet_pton(AF_INET6, "fe80::3004:2dff:feb6:b5c7", (void 
*)&ip6.sin6_addr.s6_addr);

   // Bind
   bind(s, (struct sockaddr *)&ip6, sizeof(struct sockaddr_in6));
}




This works now (had to add the 
"ip6.sin6_scope_id=if_nametoindex("ippusbxd");"). So ippusbxd is running 
now mirroring the printer onto fe80::e828:7eff:fe19:9962, port 6 on 
the ippusbxd interface.


This would especially mean that I can access the printer's web admin 
interface by pointing a browser to this address so I try the simple 
command line browser wget:


--
till@till-x1carbon:~$ wget 
http://[fe80::e828:7eff:fe19:9962%ippusbxd]:6/


http://[fe80::e828:7eff:fe19:9962%ippusbxd]:6/: Invalid IPv6 numeric 
address.


till@till-x1carbon:~$ wget http://[fe80::e828:7eff:fe19:9962]:6/

--2016-12-29 17:07:43--  http://[fe80::e828:7eff:fe19:9962]:6/
Connecting to [fe80::e828:7eff:fe19:9962]:6... failed: Invalid argument.

till@till-x1carbon:~$ wget 
http://[fe80::e828:7eff:fe19:9962]%ippusbxd:6/


http://[fe80::e828:7eff:fe19:9962]%ippusbxd:6/: Invalid host name.

till@till-x1carbon:~$ wget 
http://[fe80::e828:7eff:fe19:9962]:6%ippusbxd/


http://[fe80::e828:7eff:fe19:9962]:6%ippusbxd/: Bad port number.

till@till-x1carbon:~$ wget http://fe80::e828:7eff:fe19:9962:6/

http://fe80::e828:7eff:fe19:9962:6/: Bad port number.

till@till-x1carbon:~$ wget http://fe80::e828:7eff:fe19:9962%ippusbxd:6/

http://fe80::e828:7eff:fe19:9962%ippusbxd:6/: Bad port number.

till@till-x1carbon:~$
--

   Till




--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 04:31 PM, Stéphane Graber wrote:

On Thu, Dec 29, 2016 at 04:14:52PM -0200, Till Kamppeter wrote:

On 12/29/2016 02:37 PM, Stéphane Graber wrote:

How can I assign a different name to a dummy interface? Can I freely choose
a name somehow, for example "ippusbxd"? Or have I to use "dummy1", "dummy2",
... (loading the dummy kernel module with an option to support more than one
interface)?


root@castiana:~# ip link add ippusbxd type dummy
root@castiana:~# ip link set ippusbxd up
root@castiana:~# ifconfig ippusbxd
ippusbxd: flags=195  mtu 1500
inet6 fe80::3004:2dff:feb6:b5c7  prefixlen 64  scopeid 0x20
ether 32:04:2d:b6:b5:c7  txqueuelen 1000  (Ethernet)
RX packets 0  bytes 0 (0.0 B)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 2  bytes 140 (140.0 B)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Which gets you your own dummy device with its IPv6 link-local address.


Thank you very much. I copied and pasted the commands and got an ifconfig
output similar to yours, only with different IP and MAC addresses and
different values in the statistics.

Then I tried to bind to the IPv6 IP address of this entry, on port 6 and
this did not work.

Do I have to create an additional IP address? If yes, how? Do I have to run
additional commands (route?)? Which ones?

   Till


Link-local addresses are slightly special in that they are indeed link local.

So you can't bind fe80::3004:2dff:feb6:b5c7 as you could in theory have
the same address on multiple interfaces. Instead, you need to tell
bind() what interface to bind on. This is typically indicated as
fe80::3004:2dff:feb6:b5c7%ippusbxd.


For example:

stgraber@castiana:~$ nc -l fe80::3004:2dff:feb6:b5c7 1234
nc: Invalid argument

^ Fails because the kernel doesn't know what interface you want.

stgraber@castiana:~$ nc -l fe80::3004:2dff:feb6:b5c7%ippusbxd 1234

^ Works



Thank you. I want to bind with the bind(2) function in C. How do I 
supply the interface here or what function do I need to call instead?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 02:37 PM, Stéphane Graber wrote:

How can I assign a different name to a dummy interface? Can I freely choose
a name somehow, for example "ippusbxd"? Or have I to use "dummy1", "dummy2",
... (loading the dummy kernel module with an option to support more than one
interface)?


root@castiana:~# ip link add ippusbxd type dummy
root@castiana:~# ip link set ippusbxd up
root@castiana:~# ifconfig ippusbxd
ippusbxd: flags=195  mtu 1500
inet6 fe80::3004:2dff:feb6:b5c7  prefixlen 64  scopeid 0x20
ether 32:04:2d:b6:b5:c7  txqueuelen 1000  (Ethernet)
RX packets 0  bytes 0 (0.0 B)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 2  bytes 140 (140.0 B)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0




Another thing which I have seen is that it has no netmask and no 
broadcast address (does this exist in IPv6?) and there is also MULTICAST 
under the flags.


Is this the problem why I cannot bind to port 6 of this interface?

How can I make this a Bonjour-broadcastable interface?

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 02:37 PM, Stéphane Graber wrote:

How can I assign a different name to a dummy interface? Can I freely choose
a name somehow, for example "ippusbxd"? Or have I to use "dummy1", "dummy2",
... (loading the dummy kernel module with an option to support more than one
interface)?


root@castiana:~# ip link add ippusbxd type dummy
root@castiana:~# ip link set ippusbxd up
root@castiana:~# ifconfig ippusbxd
ippusbxd: flags=195  mtu 1500
inet6 fe80::3004:2dff:feb6:b5c7  prefixlen 64  scopeid 0x20
ether 32:04:2d:b6:b5:c7  txqueuelen 1000  (Ethernet)
RX packets 0  bytes 0 (0.0 B)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 2  bytes 140 (140.0 B)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Which gets you your own dummy device with its IPv6 link-local address.


Thank you very much. I copied and pasted the commands and got an 
ifconfig output similar to yours, only with different IP and MAC 
addresses and different values in the statistics.


Then I tried to bind to the IPv6 IP address of this entry, on port 6 
and this did not work.


Do I have to create an additional IP address? If yes, how? Do I have to 
run additional commands (route?)? Which ones?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 01:12 PM, Stéphane Graber wrote:

On Thu, Dec 29, 2016 at 01:02:29PM -0200, Till Kamppeter wrote:

Is there no way to dynamically (with checking what is currently in use)
select a small free IPv4 address space? For example in the 10.0.0.0/8 range
there are probably only some 10.X.Y.0/24 subranges used. If not, which IPv6
range is free for such a dummy0 interface? As it is local only and current
Linux supports IPv6 by default it would be no problem to be IPv6-only. It
would also need a host name as IPv6 IP addresses are awkward.


There is no way to do so for IPv4 as even if you check your local
interfaces and routing tables, you can't know what subnets are hidden
behind your router.



Are addresses in the 169.254.0.0/16 not suitable?


For IPv6, you can generate a random ULA subnet which is near guaranteed
to be unique and conflict free.



How does one do this? Which interface will it use, can I 
Bonjour-broadcast it only on the local machine?



Depending on exactly what you want to do, a link-local IPv6 address may
also be a better fit as it then absolutely cannot conflict with
anything.



Also how does one do this? Which interface will it use, can I 
Bonjour-broadcast it only on the local machine?



Making avahi work on 'lo' certainly sounds even nicer.



Would this be very complicated (would need upstream work on Avahi probably)?
It is said that multicast is needed and "lo" does not support multicast. Is
that true?


I sure wouldn't recommend using "dummy0". Using a differently named
device using the dummy driver would probably be fine though.

The reason to stay away from the "dummy0" name is that it's used in test
suites and other networking tools that simply call to "ip link add
dummy" and then (and that's the problem), call "ip link del dummy"
afterwards.



How can I assign a different name to a dummy interface? Can I freely 
choose a name somehow, for example "ippusbxd"? Or have I to use 
"dummy1", "dummy2", ... (loading the dummy kernel module with an option 
to support more than one interface)?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-29 Thread Till Kamppeter

On 12/29/2016 09:42 AM, Martin Pitt wrote:

lxc/lxd used to hardcode an IP range like this, and it had to be dropped
because it caused conflicts on "real" existing networks. The 10.0.0.0/8 range
is reserved and very actively being used for local networks, including
Canonical's own VPN, and thus prone to create conflicts. If you need to do
something like that, I don't see a way to get away with a static IPv4 address.
Maybe IPv6 has some clever address schema that makes conflicts improbable.



Is there no way to dynamically (with checking what is currently in use) 
select a small free IPv4 address space? For example in the 10.0.0.0/8 
range there are probably only some 10.X.Y.0/24 subranges used. If not, 
which IPv6 range is free for such a dummy0 interface? As it is local 
only and current Linux supports IPv6 by default it would be no problem 
to be IPv6-only. It would also need a host name as IPv6 IP addresses are 
awkward.



Does it cause any problems using "dummy0" for a production purpose? Is there
any better way? Perhaps even one which would allow me to work with
localhost?


Making avahi work on 'lo' certainly sounds even nicer.



Would this be very complicated (would need upstream work on Avahi 
probably)? It is said that multicast is needed and "lo" does not support 
multicast. Is that true?



How should I implement this? Simply run above commands from maintainer
scripts of ippusbxd? Get them run when the first IPP-over-USB printer is
detected via UDEV? Or implementation in network-manager or so?


Creating the interface in postinst is a no-go. It won't survive a reboot and it
can't/must not be done when installing into chroots. It could ship or generate
an ifupdown/netplan/systemd-networkd configuration file, though.


OK.

Are there packages which I could take as an example?

Another thought is an architecture extension to cups-browsed (which I 
already plan for the phone):


cups-browsed will open a socket (only root can access) to receive commands.

The client which sends the commands will also be cups-browsed.

When cups-browsed is started (as root) and there is already a 
cups-browsed running, it will send its command line options through the 
socket to the already running cups-browsed and exit (so that only one 
daemon instance is running at any time).


When cups-browsed is started (as root) and there is no cups-browsed 
already running it keeps running as the current daemon instance, also 
applying all its command line options.


On the Ubuntu phone this way the print dialog could tell to cups-browsed 
to create a print queue to a given Bonjour service (printer) which the 
user has selected, instead of cups-browsed creating automatically queues 
for all printers and waking up all these printers.


For an IPP-over-USB printer UDEV would not directly call the systemd 
service of ippusbxd and then cups-browsed be informed by a Bonjour 
broadcast from ippusbxd, but instead, UDEV calls the systemd service o 
cups-browsed with the info about the USB printer and cups-browsed calls 
ippusbxd, this way knowing the printer's data and the fact that the 
printer is there and so it also creates the queue. With the socket 
architecture UDEV does not need to take care whether cups-browsed is 
already running.


WDYT?

My favorite is clearly that UDEV creates ippusbxd and ippusbxd does a 
local-only Bonjour broadcast so that we get a complete emulation of a 
network printer. This does not require changes in cups-browsed and it 
allows the use of the printer also without cups-browsed.


So I would very much like to get the local-only Bonjour broadcast 
somehow working.


Best would be to be able to broadcast localhost. If not a dummy0 with a 
reliable way to obtain an IP address (IPv4 or IPv6) would be great.


Thanks in advance for any suggestion.

   Till




--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Call for testing : Driverless printing on Zesty

2016-12-29 Thread Till Kamppeter

[ Posted back to the ubuntu-devel list, please "Reply to List" or
  "Reply to All" when answering. Thanks. ]

On 12/29/2016 08:12 AM, Gérard BIGOT wrote:

Hi,

I have a brother HL-2135W (reporting as HL-2130)

gerard@:~$ driverless

gerard@:~$ ippfind
ipp://BRN008092C39747.local:631/duerqxesz5090


This usually already shows that your printer is an IPP printer but does 
not support driverless (IPP Everywhere or AirPrint) printing.



gerard@:~$ avahi-discover



Host BRN008092C39747.local (192.168.1.111), port 631, TXT data:
['TBCP=F', 'Transparent=T', 'Binary=T', 'PaperCustom=T', 'Duplex=F',
'Copies=T', 'Color=F', 'usb_MDL=HL-2130 series', 'usb_MFG=Brother',
'priority=50', 'adminurl=http://BRN008092C39747.local./',
'product=(Brother HL-2130 series)', 'ty=Brother HL-2130 series',
'rp=duerqxesz5090', 'qtotal=1', 'txtvers=1']



The Bonjour record does not even have a "pdl=..." field, so it seems to 
be an older IPP version (1.0 or 1.1) and especially there is no 
driverless printing. How old is this printer?



gerard@:~$ lpstat -v



Due to the fact that it does not support driverless printing and it even 
does not tell at all which page description languages (PDL) it supports, 
cups-browsed is not able to automatically create a print queue for this 
printer.




The webui says ipp is activated. In fact everything is activated.

No PPD generation obviously.



Thank you very much for testing anyway.

   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Call for testing : Driverless printing on Zesty

2016-12-28 Thread Till Kamppeter

On 12/28/2016 06:32 PM, Bernard Tremblay wrote:

Here are the results from "ipptool -tv
ipp://BRW3C77E657AB52.local:631/ipp/print get-printer-attributes.test >
out.txt" in attached file



Thank you very much. I have forwarded this file to the people of the PWG 
now.


Your printer does not fulfill all criteria for an IPP Everywhere printer 
but enough for driverless printing with fully automatic printer setup.



I cannot see any scanner from SimpleScan and haven't find any way to use
the web interface for the scanner yet.

I will install the scan driver from Brother and retry to scan.



OK.


I have started the debug mode and print 4 documents that all printed OK:

 1. firefox
 2. libreoffice writer
 3. atril (pdf viewer)
 4. gimp

I have my cups error_log attached too.



Thank you very much. The jobs are, as expected, converted into the PWG 
Raster format and sent off to the printer, with the option settings as 
IPP attributes.


Another test I want to ask you for is to change option settings, like 
turning on and off duplex, switching between grayscale and color, 
changing print quality, ... Are these changes obeyed in the printouts?


   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Call for testing : Driverless printing on Zesty

2016-12-28 Thread Till Kamppeter
I also want to ask you for another test. With the printer turned on, 
please run the command


ipptool -tv ipp://BRW3C77E657AB52.local:631/ipp/print 
get-printer-attributes.test > out.txt


(Note that "get-printer-attributes.test" is one word, but this cannot 
get reproduced in an e-mail)


and attach the file out.txt to your answer.

Thanks in advance

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Call for testing : Driverless printing on Zesty

2016-12-28 Thread Till Kamppeter

On 12/28/2016 03:00 PM, Bernard Tremblay wrote:

Yes, after turning off/on the printer, the lpstat -v returns this:
---
bt@ungava:~$ lpstat -v
device for Brother-MFC-J650DW: ipp://BRW3C77E657AB52.local:631/ipp/print
-

I have checked and I have only one print queue.



I have checked the attached PPD and it shows that your printer is not 
only an AirPrint printer but an IPP Everywhere printer, so it fulfills 
the newest standard for driverless printing.


Now please activate CUPS' debug logging using the command

cupsctl --debug-logging

After that please print on this print queue with different settings and 
from different applications. Please tell what works and what does not work.


Indpendent of whether everything works or not, please attach your 
/var/log/cups/error_log file to your answer to this mail right after 
your printing tests.


This is to make absolutely sure that correct IPP Everywhere printing 
happens on your printer (and I can ask the Brother guys in the PWG that 
they should do their homework of adding their printers to 
http://www.pwg.org/dynamo/eveprinters.php).



I did not install any proprietary Brother drivers. I will install the
scanner driver asap and tell you what happens.



If the scanner works without installing anything, then all is fine and 
you do not need to install any driver.


Perhaps you can scan also using the web admin interface (on my HP this 
works).


If you need a scanner driver, please install only the SCANNER drivers 
from Brother, as the PRINTER drivers are not needed any more for you. 
Try whether you can scan now.


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Call for testing : Driverless printing on Zesty

2016-12-28 Thread Till Kamppeter

On 12/28/2016 02:37 AM, Bernard Tremblay wrote:

Thanks for the quick reply.

I had to install cups-ipp-util first, then avahi-discover.


avahi-discover is only for debugging, therefore it is not installed by 
default. For actual printer setup and printing it is not needed. But 
keep it installed, perhaps we need it again.


cups-ipp-utils is actually needed by the driverless utility, we will add 
an appropriate dependency to the package containing driverless.




Here are the output of the commands:
-
bt@ungava:~$ driverless list
DEBUG: Started ippfind (PID 1317)
DEBUG: Started post-processing (PID 1318)
"driverless:ipp://BRW3C77E657AB52.local:631/ipp/print" en "Brother"
"Brother MFC-J650DW, driverless, cups-filters 1.13.1"
"MFG:Brother;MDL:MFC-J650DW;CMD:PWG,URF,JPEG;"
DEBUG: PID 1317 (ippfind) exited with no errors.
DEBUG: PID 1318 (Post-processing) exited with no errors.
-


Your printer is actually an AirPrint printer and therefore the 
"driverless" utility is listing it.



avahi-discover

I selected entry Brother MFC-J650DW from the Internet Printer list:

Type de service : _ipp._tcp
Nom du service : Brother MFC-J650DW
Nom de domaine : local
Interface : enp1s0 IPv4
Adresse : BRW3C77E657AB52.local/192.168.179.107:631

TXT Binary = T
TXT Duplex = T
TXT Copies = F
TXT product = (Brother MFC-J650DW)
TXT priority = 25
TXT Fax = T
TXT rp = ipp/print
TXT ty = Brother MFC-J650DW
TXT PaperCustom = T
TXT note = Bureau
TXT adminurl = http://BRW3C77E657AB52.local./net/net/airprint.html
TXT print_wfds = T
TXT txtvers = 1
TXT Transparent = T
TXT usb_CMD = HBP,BRPJL,URF
TXT URF = SRGB24,W8,CP1,IS1,MT1-8-11,OB9,PQ4-5,RS300,OFU0,V1.2,DM3
TXT usb_MDL = MFC-J650DW
TXT qtotal = 1
TXT usb_MFG = Brother
TXT UUID = e3248000-80ce-11db-8000-3c77e657ab52
TXT Scan = T
TXT Color = T
TXT pdl =
application/octet-stream,application/vnd.brother-hbp,image/pwg-raster,image/urf,image/jpeg
TXT TBCP = F



This is the information which the printer broadcasts into the network. 
The "image/urf" in the "TXT pdl = ..." line is the MIME type of Apple 
Raster, the print data format of Apple AirPrint. The other lines tell 
about the capabilities of the printer, like whether it has duplex, is a 
color printer, ... and the URL of the administration web interface.


The driverless utility and cups-browsed read this information to decide 
whether the printer supports driverless printing.


This especially means that cups-browsed will automatically set up a 
print queue if it is appropriately configured.


As you already told that you have set the needed configuration bits for 
cups-browsed, I want to ask you to have the printer turned on, let it 
complete start up, and now run the command


lpstat -v

Does your printer appear in the list, with a URI which starts with ipp: 
or ipps:?


If so, please attach its PPD file (in /etc/cups/ppd/, file name is the 
same as the queue name, with ".ppd" extension) to your reply.


Also try to print on the queue with different option settings.

Note that this print queue only exists as long as the printer is turned on.


--

I checked my printer setup with a browser and AirPrint is active.

I tried to setup the printer with /usr/bin/system-config-printer and  I
had the choice between 3 protocols for the same printer :

  * ipp://BRW3C77E657AB52.local:631/ipp/print
  * lpd printer BRW3C77E657AB52
  * Network printer via DNS-SD for ipp://BRW3C77E657AB52.local:631/ipp/print

I choosed the first one, and this time I had a message saying "Searching
for driver" and it did not prompt me with the usual list of all printers
that it knows,


This is because it found the correct PPD, which is auto-generated based 
on a query for capabilities to the printer, automatically. 
system-config-printer only asks for make/model/driver if there is no 
exact match.



but it ask me for the name of the printer and a name for
the place it is.


This system-config-printer always asks for, as it does not know how you 
want to organize your print queues.



  I printed the "Printer test page" and everything
works OK now.



So you are successfully doing driverless printing with your Brother 
printer and for the first time it works solely with free software, 
without the awkwardnesses of Brother's proprietary driver.


Next steps to be sure whether everything works as intended:

Attach the PPD file (in /etc/cups/ppd/, file name is the same as the 
queue name, with ".ppd" extension) to the answer of this e-mail. I asked 
you for a PPD file earlier, but you have probably two print queues now, 
one created by cups-browsed and one created by system-config-printer. I 
want to know via the PPD files whether they are both created correctly.


Print some jobs with different settings (duplex, quality, input tray, 
...) and from different applications. 

Re: Call for testing : Driverless printing on Zesty

2016-12-27 Thread Till Kamppeter

[ Re-posting to ubuntu-devel mailing list ]

Please check whether you have the up-to-date versions of CUPS and 
cups-filters:


--
till@virt-devel:~$ dpkg -l | grep cups
ii  cups 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - PPD/driver support, web interface
ii  cups-browsed 1.13.1-1 
amd64OpenPrinting CUPS Filters - 
cups-browsed
ii  cups-client 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - client programs (SysV)
ii  cups-common 
2.2.1-46-g10887d272-2   all  Common UNIX 
Printing System(tm) - common files
ii  cups-core-drivers 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - PPD-less printing
ii  cups-daemon 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - daemon
ii  cups-filters 1.13.1-1 
amd64OpenPrinting CUPS Filters - 
Main Package
ii  cups-filters-core-drivers1.13.1-1 
amd64OpenPrinting CUPS Filters - 
PPD-less printing
ii  cups-ipp-utils 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - IPP developer/admin utilities
ii  cups-ppdc 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - PPD manipulation utilities
ii  cups-server-common 
2.2.1-46-g10887d272-2   all  Common UNIX 
Printing System(tm) - server common files
ii  libcups2:amd64 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - Core library
ii  libcupscgi1:amd64 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - CGI library
ii  libcupsfilters1:amd641.13.1-1 
amd64OpenPrinting CUPS Filters - 
Shared library
ii  libcupsimage2:amd64 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - Raster image library
ii  libcupsmime1:amd64 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - MIME library
ii  libcupsppdc1:amd64 
2.2.1-46-g10887d272-2   amd64Common UNIX 
Printing System(tm) - PPD manipulation library

till@virt-devel:~$
--

If you have older versions, please run a system update.

Please run the following command:

driverless

This should show an entry for your printer, starting with "ipp".

If not, run

ippfind

Does your printer have an entry here?

If not, open the web administration interface of your printer, opening

http:///

in a web browser. Go into the network settings and make sure that IPP 
support and/or AirPrint is enabled.


Do

sudo apt-get install avahi-discover

and then run

avahi-discover

Look for your printer. It should be available under your standard 
network interface (usually "eth0" or "wlan0"), IPv4, and there under 
"Unix Printer" and "Internet Printer". Click on its "Internet Printer" 
entry. Then you will see some data about it in the lower part of the 
window and the data also appearing in the terminal window from which you 
started avahi-discover, something like this:


--
Service data for service 'Deskjet 2540 series [E7DDC7]' of type 
'_ipp._tcp' in domain 'local' on 3.0:
	Host HP5CB901E7DDC7.local (192.168.223.1), port 631, TXT data: 
['Scan=T', 'Duplex=F', 'Color=T', 
'UUID=1c852a4d-b800-1f08-abcd-5cb901e7ddc7', 'Fax=F', 'note=', 
'adminurl=http://HP5CB901E7DDC7.local./#hId-pgAirPrint', 
'mac=02:ba:d0:3f:7f:fe', 'priority=20', 'usb_MDL=Deskjet 2540 series', 
'usb_MFG=HP', 'product=(HP Deskjet 2540 series)', 'ty=Deskjet 2540 
series', 
'URF=CP1,MT1-2-8-9-10-11,OB9,OFU0,PQ3-4-5,RS300-600,SRGB24,W8-16,DEVW8-16,DEVRGB24-48,ADOBERGB24-48,IS1,V1.3', 
'kind=document,envelope,photo', 'PaperMax='pdl=application/vnd.hp-PCL,image/jpeg,application/PCLm,image/urf', 
'qtotal=1', 'txtvers=1']

--

Please post what you get for your printer.

It should have "image/urf" in the "pdl=..." part and it should have a 
"URF=..." part.


Please post the output of all commands in your reply. Thanks.

   Till


On 12/27/2016 11:01 PM, Bernard Tremblay wrote:

Sorry to email directly, I'm new on the ubuntu-devel list. I have
installed ubuntu-mate 17.04 and tried to setup a driverless printer
according to your following post
https://lists.ubuntu.com/archives/ubuntu-devel/2016-December/039586.html

I have a brother printer MFC-J650DW and it is listed in the
support.apple.com  list of printers that
should be able to do "airprint".

I have changed my cups-browsed.conf file and restart services.  I can
see my printer if I try to add a printer.  But I can't set it up without
being asked for the driver.   

Call for testing: Driverless printing on Zesty

2016-12-23 Thread Till Kamppeter

Hi,

Here is something nice to try out during the holidays or to save some 
Christmas present which you got from a not so Linux-savvy relative.


Are you using Zesty and do you have a (network) printer which you never 
got working with Linux?


It is possible that Zesty is now able to make it work. Zesty supports 
printing on IPP Everywhere printers and on printers supporting Apple 
AirPrint (these are the printers where you can print from your iPhone or 
iPad).


Please try the following:

Have the printer connected to your network. It works with wired Ethernet 
or WiFi. For WiFi have it correctly set up for WiFi access, either 
connecting to your router's WiFi or using its built-in print-only WiFi 
server. At least one of these methods should be possible to set up 
without a Windows or Mac computer, so that users only having a mobile 
device can print.


Have a Zesty box accessing your local network. Do a complete update of 
it, to make sure to have the newest CUPS and cups-filters packages.


Now there are two methods to get you printer available:


1. Fully automatic setup


Edit /ect/cups/cups-browsed.conf to have a line

CreateIPPPrinterQueues All

and restart cups-browsed:

sudo systemctl stop cups-browsed
sudo systemctl start cups-browsed

Now look for new print queues on your system and try to print.

Note that these queues will get automatically removed when the printer 
is turned off or cups-browsed not running. But don't worry about your 
option setting, cups-browsed saves them for you.



2. Setup via http://localhost:631/ (or other printer setup tools)
-

Open http://localhost:631/ and choose "Administration" at the top. Then 
click "Add Printer" at the left. Log in in the log-in pop-up with your 
usual user name and password.


Look for your printer under the "Discovered Network Printers:". Prefer 
an entry which contains the word "driverless". Select the entry and 
click "Continue".


On the next screen your can decide whether to share your printer to your 
other machines in your local network (these do not need to be Zesty) and 
you should check the "Connection". It should start with "ipp://" or 
"ipps://", if not, go back a step and check whether you have selected 
the correct entry. Click "Continue".


On the next page choose the correct model, preferring the entry 
containing "driverless". Usually this already happens automatically. 
Then click "Add Printer".


Now set the option defaults, especially the correct page size/media size 
and click "Set Default Options".


Select "Print Test Page" under "Maintenance". Also try printing from 
your preferred applications.



What we want to know


Independent whether you have used the first or the second method, tell us:

1. Which printer models did you try?

2. Does the manufacturer claim, via the packaing, the manual, or the 
printer itself that the printer supports:


- IPP Everywhere
- Apple AirPrint
- Prints from iPhone and iPad
- Prints from mobile devices

3. Is the printer listed here?

- http://www.pwg.org/dynamo/eveprinters.php
- https://support.apple.com/en-us/HT201311

4. Did you get the printer to be discovered as described and to set up 
and print?


5. If yes, tell us whether it prints correctly, whether you can control 
things like double-sided printing, print quality, input tray, ...?


6. If something goes wrong, please report a bug.

7. Independent whether you are successful or not, please reply here and 
tell us your results, so that we know how well the support for 
driverless printing works.


Have a great Christmas and a working printer!

Happy printing!

   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Using the dummy0 interface for a local-only service to be broadcasted by Avahi

2016-12-19 Thread Till Kamppeter

[ TL;DR: Skip to "Adding dummy0 interface to the distro" ]

Hi,

as most of you know I am working on the printing stack, and one part of 
it is IPP-over-USB. IPP is the Internet Printing Protocol, a 
sophisticated network protocol to access printers and multi-function 
devices in a way that one cannot only send out print jobs, but also 
monitor their status, and especially poll capability info from the 
printers. The latter allows for using printers without drivers (= 
printer-model-specific software and/or data) as long as the printer 
knows a standardized language.


To not confine IPP and so driverless printing to network printers, 
IPP-over-USB was introduced, which allows to use IPP also on 
USB-connected printers. For this I am maintaining ippusbxd:


https://github.com/tillkamppeter/ippusbxd

In the beginning, I simply mirrored an IPP-over-USB printer to 
localhost:6 (and following ports if there is more than one printer) 
so that the IPP backend of CUPS can access it like a network printer.


Then I ran into a problem: Printer setup tools like 
system-config-printer and the built-in CUPS tool http://localhost:631/ 
do not auto-discover a printer on localhost:6 also cups-browsed, a 
daemon to auto-setup network printers does not discover such a printer. 
The auto discovery is done via Bonjour (Avahi on Linux) and ippusbxd is 
not broadcasting the printers via Avahi.


Now I added the Avahi broadcasting to ippusbxd and ran into another 
problem: Avahi does not broadcast on the loopback interface "lo". So it 
cannot broadcast a service on localhost (note that I only want to 
broadcast it on the local machine, not on the network). "lo" does not 
support multicast devices.


So I googled and posted on the Avahi mailing list and ended up with

http://unix.stackexchange.com/questions/151980/how-can-i-use-avahi-without-a-network-connection

making me try the "dummy0" device and it works for me (after adding 
functionality for selecting the interface to broadcast on to ippusbxd).


I add the interface

sudo modprobe dummy
sudo ifconfig dummy0 10.0.0.1 netmask 255.255.255.0 multicast
sudo ifconfig dummy0 up multicast

and then run ippusbxd like that:

ippusbxd -v 0x03F0 -m 0xC211 -p 6 -i dummy0

This mirrors the USB printer with VID 0x03F0 and PID 0xC211 to 
10.0.0.1:6 and broadcasts it only on my local machine via 
Bonjour/Avahi. cups-browsed picks up the broadcast and auto-creates a 
driverless print queue for this printer then.



Adding dummy0 interface to the distro
-

What I would like to do is to add the "dummy0" interface as a 
local-only, multicast interface to the distro, either as a default part 
like "lo" or initiated by the maintainer scripts of the ippusbxd Debian 
package (or the printing snap).


WDYT?

Does it cause any problems using "dummy0" for a production purpose? Is 
there any better way? Perhaps even one which would allow me to work with 
localhost?


How should I implement this? Simply run above commands from maintainer 
scripts of ippusbxd? Get them run when the first IPP-over-USB printer is 
detected via UDEV? Or implementation in network-manager or so?


   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: cups-browsed uses GMainLoop and global variables, how to introduce locks against race conditions?

2016-12-07 Thread Till Kamppeter

On 12/02/2016 04:13 PM, Till Kamppeter wrote:

The way how cups-browsed works is the following:

First, a GMainLoop is created:

gmainloop = g_main_loop_new (NULL, FALSE);

Browsing for legacy CUPS broadcasts is attached to the mail loop via

GIOChannel *browse_channel = g_io_channel_unix_new (browsesocket);
g_io_channel_set_close_on_unref (browse_channel, FALSE);
g_io_add_watch (browse_channel, G_IO_IN, process_browse_data, NULL);

Many other things are added via

g_idle_add ()

and

g_timeout_add_seconds ()

Reaction to D-Bus notifications is added via the

g_signal_connect()

function.

Avahi browsing is set up with these calls

/* Allocate main loop object */
if (!glib_poll)
  if (!(glib_poll = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT)))
  {
debug_printf("ERROR: Failed to create glib poll object.\n");
goto avahi_init_fail;
  }

/* Allocate a new client */
if (!client)
  client = avahi_client_new(avahi_glib_poll_get(glib_poll),
AVAHI_CLIENT_NO_FAIL,
client_callback, NULL, &error);

/* Check wether creating the client object succeeded */
if (!client) {
  debug_printf("ERROR: Failed to create client: %s\n",
   avahi_strerror(error));
  goto avahi_init_fail;
}

Strange is that this Avahi browsing setup is done before creation of the
main loop. Also some g_timeout_add_seconds () calls are done before
creating the main loop.

After that, the main loop gets started via

g_main_loop_run (gmainloop);

My questions are now:

- Is this way everything attached to the main loop?

- Do I have to do function calls in the beginning and in the end of each
callback function to acquire and release a lock? Which ones?

- If something of this is not attached to the main loop, how do I attach
it?

I do not explicitly start any new threads.

   Till



No one has any idea to help me here?

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: cups-browsed uses GMainLoop and global variables, how to introduce locks against race conditions?

2016-12-02 Thread Till Kamppeter

On 12/02/2016 02:28 PM, Ted Gould wrote:

On Fri, 2016-12-02 at 12:58 -0200, Till Kamppeter wrote:

The solution would be to acquire a lock when starting to manipulate the
printer list and releasing the lock when done.

Now my qestion is, which functions I have to use for acquiring and
releasing locks when using GLib and GMainLoop? Probably it is not
correct to use the locks of pthread. Also it is probably best to use
Read/Write locks where only writing is exclusive but reading is allowed
to more than one thread at a time.


Generally speaking the best way to do this is to use the mainloop itself
as the lock. The mainloop is always on a single thread, so you should
have the other threads put events into the main loop context and have
them operate there on the data structure. So you'd, for instance, get
all the information together on your Bonjour thread and when you're
ready to add it put an action on the main loop with all that information.

The functions you're probably looking for are (as starting points):

g_main_context_get_thread_default()
g_idle_source_new()
g_source_attach()



The way how cups-browsed works is the following:

First, a GMainLoop is created:

gmainloop = g_main_loop_new (NULL, FALSE);

Browsing for legacy CUPS broadcasts is attached to the mail loop via

GIOChannel *browse_channel = g_io_channel_unix_new (browsesocket);
g_io_channel_set_close_on_unref (browse_channel, FALSE);
g_io_add_watch (browse_channel, G_IO_IN, process_browse_data, NULL);

Many other things are added via

g_idle_add ()

and

g_timeout_add_seconds ()

Reaction to D-Bus notifications is added via the

g_signal_connect()

function.

Avahi browsing is set up with these calls

/* Allocate main loop object */
if (!glib_poll)
  if (!(glib_poll = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT)))
  {
debug_printf("ERROR: Failed to create glib poll object.\n");
goto avahi_init_fail;
  }

/* Allocate a new client */
if (!client)
  client = avahi_client_new(avahi_glib_poll_get(glib_poll),
AVAHI_CLIENT_NO_FAIL,
client_callback, NULL, &error);

/* Check wether creating the client object succeeded */
if (!client) {
  debug_printf("ERROR: Failed to create client: %s\n",
   avahi_strerror(error));
  goto avahi_init_fail;
}

Strange is that this Avahi browsing setup is done before creation of the 
main loop. Also some g_timeout_add_seconds () calls are done before 
creating the main loop.


After that, the main loop gets started via

g_main_loop_run (gmainloop);

My questions are now:

- Is this way everything attached to the main loop?

- Do I have to do function calls in the beginning and in the end of each 
callback function to acquire and release a lock? Which ones?


- If something of this is not attached to the main loop, how do I attach it?

I do not explicitly start any new threads.

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


cups-browsed uses GMainLoop and global variables, how to introduce locks against race conditions?

2016-12-02 Thread Till Kamppeter

Hi,

cups-browsed is a daemon which automatically creates local print queues 
when it discovers remote printers on the network.


For this it has to observe different sources for appropriate events:

- Bonjour: For IPP network printers and for remote CUPS queues of CUPS 
1.6.x or newer

- Legacy CUPS broadcasts: For remote CUPS queues of CUPS 1.5.x or older
- D-Bus notifications: For load-balancing and maintenance of the local 
queues.


In addition, timeouts are used to repeat failed attempts of creating and 
taking down queues, to wait until all jobs are printed before 
auto-shutdown, for expiring legacy CUPS queues, ...


All this is managed via a GLib GMainLoop and the list of discovered 
printers is held in a global variable.


Now there come error reports from time to time, reporting crashes of 
cups-browsed and as I did not find any problem with memory allocation 
and freeing for the data structure I am assuming that the problem is 
missing locking.


Probably (I am not sure how it works exactly) events like appearing or 
disappearing printers, legacy CUPS broadcasts, ... make the main loop 
starting threads to treat the events appropriately, as for example 
adding and removing printers in the list of discovered printers.


Here probably race conditions come up when events happen close to each 
other and the printer list gets manipulated by various threads at the 
same time.


The solution would be to acquire a lock when starting to manipulate the 
printer list and releasing the lock when done.


Now my qestion is, which functions I have to use for acquiring and 
releasing locks when using GLib and GMainLoop? Probably it is not 
correct to use the locks of pthread. Also it is probably best to use 
Read/Write locks where only writing is exclusive but reading is allowed 
to more than one thread at a time.


Any kind of help is welcome.

   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Knocking Python 2 off the desktop iso

2016-03-07 Thread Till Kamppeter

On 03/05/2016 02:31 PM, Barry Warsaw wrote:


I don't know the code or expected workflow here, so I could be totally off
base, but it looks like _installSMBBackendIfNeeded() is trying to install
samba-client, which is a virtual package provided by smbclient.  smbclient
depends on libsmbclient.

If you changed that to installing python3-smbc, you'd still get libsmbclient,
but I don't know if you're depending on something in smbclient that's not in
libsmbclient.  If so, then I think you can just modify s-c-p's
PackageKit.InstallPackageName() method to accept multiple package names (or
add a new method that accepts more than one).  Then you'd pass smbclient and
python3-smbclient to them.

But that may still hit the problem you're describing above.



I have it all fixed now and uploaded as system-config-printer 
1.5.7+20160212-0ubuntu2. Here python3-smbc is demoted to Suggests: and 
the option for setting up a "Windows Printer via SAMBA" is already 
available in the list of available devices if smbclient (contains the 
"smb" CUPS backend) is not installed.


If the user chooses the "Windows Printer via SAMBA" and clicks either 
the "Browse" or the "Verify" button, python3-smbc gets installed, as it 
is used by these functions.


If the user sets up a printer with a "smb://..." URI, the smbclient 
package gets installed as the "smb" CUPS backend is needed to use this 
printer.


To make the installation of the packages exit only when the packages are 
actually installed, I succeeded to solve after some Googling. The 
InstallPackageNames() D-Bus method of PackageKit has a parameter to 
select which stages of the installation process should be displayed or 
not and the method exits after the last displayed stage, and lets the 
installation go on in the background if there are more stages. Now I let 
the last stage get displayed and everything works as intended.


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Knocking Python 2 off the desktop iso

2016-03-04 Thread Till Kamppeter

On 03/04/2016 04:27 PM, Barry Warsaw wrote:

A long standing goal for Ubuntu has been the demotion of Python 2 off of the
default installation images[1].  This is something many folks have been
working on for quite a few cycles, and it's finally within our reach for
desktop (server and touch already have no Python 2 on it).  Of course this is
within the context of a much longer term, cross distro effort to port the
entire world to Python 3 .

We have one last thing holding Python 2 on the desktop image, and it's a
problematic one: system-config-printer.  Actually s-c-p is already itself
ported to Python 3, but it transitively depends on Python 2 through the chain
of python3-smbc -> libsmbclient -> samba-libs -> libpython2.7.  So the real
problem is fully porting Samba to Python 3.  Ubuntu is not the only distro
converging on this bottleneck.

Clearly, we won't have an untangled the Samba stack in time for 16.04.  I'm
proposing instead to demote python3-smbc to a Suggests[2] for
system-config-printer, which should drop it from the desktop image, thus
allowing us to purge libpython2.7, python2.7, and python.

The downside of course is that you won't be able to automatically detect
Windows printers after a default install.  For users who don't have network
attached (e.g. IPP) printers, that's a hardship.  The question is whether
there are enough users who fall into that category to outweigh keeping the
full Python 2 stack on the image.

There's a middle way perhaps.  It's not fantastic, but there is precedence.
In a similar situation, deja-dup depends on duplicity which has not yet been
ported, so in order to do backups, deja-dup exposes a button to install some
additional packages.  That of course pulls Python 2 back in, but it does at
least keep the desktop iso smaller and doesn't affect anybody who doesn't want
to do backups[3].

In a similar way, we could do a runtime check in system-config-printer to see
if the python3-smbc library is available, and if not, expose a button to
install the necessary package if the user wants to search for a Windows
printer.  There are already places in the code that catch ImportErrors if the
Samba-requiring bits aren't available, so s-c-p should continue to work
without it.  That would allow us to knock Python 2 off of desktop, and users
without Windows printers could ignore the reduction in functionality, while
users with Windows printers would at least have a discoverable path to adding
that functionality back.

Given how close we are to completing this long-term effort, I'd vote for just
the Suggests demotion or adding the button.  But I'm admittedly biased. :)



See also

https://bugs.launchpad.net/bugs/1552868
Demote python3-smbc to a Suggests

I am already investigating. I will in any case demote python3-smbc to 
Suggests, but I am also looking for whether there is a way to let the 
package being installed (with user confirmation) when he clicks "Browse" 
or "Verify" on the panel for finding Windows (SMB) network printers. 
This is the only place where s-c-p uses python3-smbc.


I am trying with the functionality in 
/usr/share/system-config-printer/installpackage.py which is used at 
another place in /usr/share/system-config-printer/newprinter.py to 
install the package, but the problem here is that the call of 
self.iface.InstallPackageNames() already exits after the user has 
entered his password, and does not wait until the package is installed. 
It also does not tell me whether the user has actually opted for 
installing the package or cancelled, so I do not even know whether to 
wait or not. Jiri, could you help here?


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Python 3 only for 16.04

2015-11-04 Thread Till Kamppeter

On 11/04/2015 07:46 PM, Barry Warsaw wrote:

In today's UOS session on dropping Python 2 from the default
installs/seeds/images, we captured a bunch of work items.  For those of you on
the session, please look at both the wiki and blueprint linked below, and make
any additions or corrections you might find to my note taking.

https://blueprints.launchpad.net/ubuntu/+spec/foundations-x-python3-only
https://wiki.ubuntu.com/Python/FoundationsXPythonVersions

You might also want to subscribe to the wiki page.  Of course, we welcome any
help in this important LTS goal, so please get in touch.


I have an update: system-config-printer is already converted.

I have edited the two linked pages appropriately.

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: PackageKit/Python: pk.install_packages() not able to install a package

2014-09-16 Thread Till Kamppeter
On 09/16/2014 05:36 PM, Till Kamppeter wrote:
> 
>> in a second terminal and then execute your script and attach the
>> output of the packagekit daemon somewhere?
> 
> I tried, but my "install-printerdriver" script already failed installing
> the signature.
>

So I have removed the "try: ... except: ..." around the signature
installation and so I could see that the call for the signature
installation needs the package ID to be supplied. So I moved the call to
after the resolving step in the script and nmow the script pops up the
password dialog and starts signature installation. Then it simply hangs.

Can you tell me what steps do I have to do in which order if I have the
three parameters

- package name
- package repo
- package signature

as I have for the call of my script and want to have the package
installed, with the signature, and with the repo in the local repo list
for later automatic updates.

   Till



> Good news: "pkcon install openprinting-gutenprint" popped up a window
> for the password and then installed the package.


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: PackageKit/Python: pk.install_packages() not able to install a package

2014-09-16 Thread Till Kamppeter
On 09/16/2014 04:45 PM, Matthias Klumpp wrote:
> 2014-09-16 16:41 GMT+02:00 Till Kamppeter :
>> On 09/16/2014 04:14 PM, Matthias Klumpp wrote:
>>>>
>>>>> (Also, using PkTask instead of PkClient is recommended)
>>>>
>>
>> After Googling and having seen
>>
>> https://gitorious.org/appstream/software-center/commit/7d50219075436e2f74cd5a7380e8776eb9d87b03?diffmode=sidebyside
>>
>> I simply tried replacing
>>
>> pk = PackageKitGlib.Client()
>>
>> by
>>
>> pk = PackageKitGlib.Task()
>>
>> in install-printerdriver.py
>>
>> The script kept working as before, including giving the same error when
>> installing the package.
> That's odd. Maybe reporting a bug is a good option now, since I don't
> see an obvious mistake you made here.
> Can you run
> sudo /usr/lib/packagekit/packagekid --verbose

I had to install the package "packagekit" for that, which also installs
"packagekit-backend-aptcc" and uninstalls "python3-aptdaemon.pkcompat".
so it seems to switch over from apt-daemon to PackageKit mode. This
would probably be a too high impact to fix the problem.

Advantage of PackageKit mode is that pkcon is fully functional. Things
like "pkcon backend-details" and "pkcon repo-list" work now.

> in a second terminal and then execute your script and attach the
> output of the packagekit daemon somewhere?

I tried, but my "install-printerdriver" script already failed installing
the signature.

Good news: "pkcon install openprinting-gutenprint" popped up a window
for the password and then installed the package.

> Cheers,
> Matthias
> 
> Btw, let's see if posting with my d.o address gets the message pass
> through to the list ;-)
> 

I got it at least.

   Till


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: PackageKit/Python: pk.install_packages() not able to install a package

2014-09-16 Thread Till Kamppeter
On 09/16/2014 04:14 PM, Matthias Klumpp wrote:
>>
>>> (Also, using PkTask instead of PkClient is recommended)
>>

After Googling and having seen

https://gitorious.org/appstream/software-center/commit/7d50219075436e2f74cd5a7380e8776eb9d87b03?diffmode=sidebyside

I simply tried replacing

pk = PackageKitGlib.Client()

by

pk = PackageKitGlib.Task()

in install-printerdriver.py

The script kept working as before, including giving the same error when
installing the package.

   Till


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: PackageKit/Python: pk.install_packages() not able to install a package

2014-09-16 Thread Till Kamppeter
On 09/16/2014 04:14 PM, Matthias Klumpp wrote:
> 2014-09-16 16:00 GMT+02:00 Till Kamppeter :
>> On 09/16/2014 02:29 PM, Matthias Klumpp wrote:
>>> Hi!
>>>
>>> 2014-09-15 21:48 GMT+02:00 Till Kamppeter :
>>>> Hi,
>>>>
>>>> I am using the Python bindings of PackageKit in system-config-printer for
>>>> the automatic driver download )as DEB packages in Ubuntu).
>>>> [...]
>>> PackageKit developer here ;-) If you say "Python-bindings" you mean
>>> the python3-packagekit package? It looks like you are using the GIR,
>>> which is the correct way to talk to PackageKit from Python.
>>
>> Yes, I do. The script starts with
>>
>> #!/usr/bin/python3
>> from gi.repository import GLib, PackageKitGlib
>>
>> which for me means use of GIR, with Python 3.
>>
>>> (Also, using PkTask instead of PkClient is recommended)
>>
>> What is the difference between PkTask and PkClient?
> PkTask is more high-level, it can show Eula actions, set up Debconf
> and handle GPG-keys.
> PkClient is pretty low-level.
> 
>>> The "printdriver" part means that the origin of this package is from
>>> the "printdriver" repository.
>>
>> Does thios mean that Epson has used the name "printdriver" somewhere on
>> their server?
> Yes: "'deb http://www.openprinting.org/download/printdriver/debian/";
> 

This path is not at Epson but only at OpenPrinting, but at both Epsn and
OpenPrinting there is an apt-lsb3.2-release.conf file like this:

--
APT::FTPArchive::Release::Origin
\"http://www.openprinting.org/download/printdriver/debian/\";;
APT::FTPArchive::Release::Label "printdriver";
APT::FTPArchive::Release::Suite "lsb3.2";
APT::FTPArchive::Release::Codename "lsb3.2";
APT::FTPArchive::Release::Architectures "i386 amd64";
APT::FTPArchive::Release::Components "contrib lsbddk main main-nonfree";
APT::FTPArchive::Release::Description "Distribution-independent printer
driver packages in Debian package format, for LSB-3.2-based distros";
--

(Epson uses my server setup script which creates this file). It seems
that the "printdriver" comes from the "APT::FTPArchive::Release::Label"
entry, for what ever this is good for.

>>> Are you using Ubuntus apt-daemon, or PackageKits aptcc backend?
>>
>> I think that Ubuntu's apt-daemon is used. What is aptcc and how can I
>> check what gets actually used ("pkcon backend-details" gives no answer
>> at all)?
> Aptcc is the default PackageKit backend for Apt-based systems. It's
> implemented in C++ and pretty fast.
> You can install it using the packagekit-backend-aptcc package.
> Aptdaemon should jump out of the way then.
> The backend-details command should display the backend capabilities then.
>

I tried

sudo apt-get install packagekit-backend-aptcc

now.

pkcon backend-details

still gives no answer and trying to install openprinting-gutenprint via
my script or via pkcon still gives the same error.

>>> Can you install the package using pkcon? (you can also supply
>>> package-ids to the tool)
>>
>> "pkcon install openprinting-gutenprint" gives the same error ("Fatal
>> error: The versuion 5.2.7-1lsb3.2/printdriver of openprinting-gutenprint
>> isn't available.").
> Looks like somehow the backend does not handle 3rd-party repos properly.
> (apt update runs without errors?)

"apt-get update" indeed runs without errors, and I can install the
package with "apt-get install".

   Till



-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: PackageKit/Python: pk.install_packages() not able to install a package

2014-09-16 Thread Till Kamppeter
On 09/16/2014 02:29 PM, Matthias Klumpp wrote:
> Hi!
> 
> 2014-09-15 21:48 GMT+02:00 Till Kamppeter :
>> Hi,
>>
>> I am using the Python bindings of PackageKit in system-config-printer for
>> the automatic driver download )as DEB packages in Ubuntu).
>> [...]
> PackageKit developer here ;-) If you say "Python-bindings" you mean
> the python3-packagekit package? It looks like you are using the GIR,
> which is the correct way to talk to PackageKit from Python.

Yes, I do. The script starts with

#!/usr/bin/python3
from gi.repository import GLib, PackageKitGlib

which for me means use of GIR, with Python 3.

> (Also, using PkTask instead of PkClient is recommended)

What is the difference between PkTask and PkClient?

> The "printdriver" part means that the origin of this package is from
> the "printdriver" repository.

Does thios mean that Epson has used the name "printdriver" somewhere on
their server?

> Are you using Ubuntus apt-daemon, or PackageKits aptcc backend?

I think that Ubuntu's apt-daemon is used. What is aptcc and how can I
check what gets actually used ("pkcon backend-details" gives no answer
at all)?

> Can you install the package using pkcon? (you can also supply
> package-ids to the tool)

"pkcon install openprinting-gutenprint" gives the same error ("Fatal
error: The versuion 5.2.7-1lsb3.2/printdriver of openprinting-gutenprint
isn't available.").

   Till


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


PackageKit/Python: pk.install_packages() not able to install a package

2014-09-15 Thread Till Kamppeter

Hi,

I am using the Python bindings of PackageKit in system-config-printer 
for the automatic driver download )as DEB packages in Ubuntu).


s-c-p calls these command lines for example:

install-printerdriver 'openprinting-gutenprint' 'deb 
http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib' 
'F8897B6F00075648E248B7EC24CBF5474CFD1E2F'


or

install-printerdriver 'epson-inkjet-printer-201209j' 'deb 
http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main' 
'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'


The script install-printerdriver calls 
/usr/share/system-config-printer/install-printerdriver.py which uses 
PackageKit to add the supplied repository, install the supplied key and 
then install the requested package.


What works for me is the adding of the repository and installing of the 
key. The installation of the package via pk.install_packages() function 
always fails.


The server could not be the problem, as once run the script and so added 
the repo and the key, I can install the package with "sudo apt-get 
install ...".


The problem persists also when not supplying the key and also when 
running as root (so seems not to be an authentication problem).


To investigate the failure I have removed the "try: ... except: ..." 
around the pk.install_packages() and re-run. Then I get the following output


--
till@till-twist:~/ubuntu/system-config-printer/test$ 
install-printerdriver 'openprinting-gutenprint' 'deb 
http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib' 
'F8897B6F00075648E248B7EC24CBF5474CFD1E2F'

Signature key supplied
pk.install_signature
pk.install_signature succeeded
pk.resolve
pk.resolve succeeded
pk.refresh_cache
pk.refresh_cache succeeded
pk.resolve
pk.resolve succeeded
package_id: openprinting-gutenprint;5.2.7-1lsb3.2;amd64;printdriver
package not installed
pk.install_packages
Signature key supplied
Traceback (most recent call last):
  File "/usr/share/system-config-printer/install-printerdriver.py", 
line 109, in 

res = pk.install_packages(True, [package_id], None, progress, None)
GLib.Error: pk_client_error: The version 5.2.7-1lsb3.2/printdriver of 
openprinting-gutenprint isn't available. (263)

till@till-twist:~/ubuntu/system-config-printer/test$
--

and

--
till@till-twist:~/ubuntu/system-config-printer/test$ 
install-printerdriver 'epson-inkjet-printer-201209j' 'deb 
http://download.ebz.epson.net/dsc/op/stable/debian/ lsb3.2 main' 
'E5220FB7014D0FBDA50DFC2BE5E86C008AA65D56'

Signature key supplied
pk.install_signature
pk.install_signature succeeded
pk.resolve
pk.resolve succeeded
pk.refresh_cache
pk.refresh_cache succeeded
pk.resolve
pk.resolve succeeded
package_id: epson-inkjet-printer-201209j;1.0.1-1lsb3.2;amd64;printdriver
package not installed
pk.install_packages
Signature key supplied
Traceback (most recent call last):
  File "/usr/share/system-config-printer/install-printerdriver.py", 
line 109, in 

res = pk.install_packages(True, [package_id], None, progress, None)
GLib.Error: pk_client_error: The version 1.0.1-1lsb3.2/printdriver of 
epson-inkjet-printer-201209j isn't available. (263)

till@till-twist:~/ubuntu/system-config-printer/test$
--

A strange thing here is also that the package ID always ends with 
"printdriver" as the Python script does not contain the word 
"printdriver" and at least for the Epson driver also the repo path or 
package name does not contain this word.


Anyone has an idea what is going on here or how to do further debugging?

Thanks in advance.

   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


SLP (Service Location Protocol)

2014-07-23 Thread Till Kamppeter
Hi,

I want to make use of SLP to discover printers in the network and
especially to discover their capabilities. Unfortunately documentation
on the internet is sparse.

I want to let cups-browsed do this automatically, so that I can set up
driver-less print queues for printers with known languages (PDF,
PostScript, PCL, ...) but without polling the printer directly to not
wake up the printer from power save mode.

What I would like to know is:

1. How do I scan the network for SLP services without knowing service
names and types and without knowing which hosts in the network provide
services or are SLP directory agents?

2. In a typical SoHo network, are there SLP services or directory
agents? Are the usual SoHo routers directory agents? Or do we need to
make it part of the Ubuntu standard installation to run an SLP server
daemon to be able to make use of SLP?

3. How can I test my environment with command line tools?

I am very grateful for any help towards this.

   Till

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: On-demand starting/stopping of cups [was: [Blueprint client-1305-printing-stack-with-mobile-in-mind] Printing Stack with Mobile in Mind]

2014-02-13 Thread Till Kamppeter
On 02/05/2014 07:53 PM, Till Kamppeter wrote:
> So we will modify cups-browsed:
> 
> - Keep running independent of avahi-daemon running, simply remove the
> empty avahi-detected queues if avahi-daemon disappears and recover to
> avahi use if avahi-deamon reappears.
> - Command line option to stop if 30 sec without cups-browsed-created
> queues.

These steps I have done now in cups-filters 1.0.45 which I have released
upstream today.

   Till



-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: On-demand starting/stopping of cups [was: [Blueprint client-1305-printing-stack-with-mobile-in-mind] Printing Stack with Mobile in Mind]

2014-02-05 Thread Till Kamppeter

I had some thoughts about running the daemons on-demand.

Principally, we want the following:

When a user opens the print dialog, avavhi-daemon, cups, and 
cups-browsed should be started (can get called explicitly), as 
cups-browsed will get D-Bus signals from avahi-daemon when printers 
appear or disappear and it will send requests to cupsd to create or 
remove print queues pointing to these printers. The dialog is now 
supposed to watch the print queues appearing and to update the 
user-visible list appropriately, until the user clicks a printer. Then 
printer capabilities should be polled via IPP (using libcups) and if the 
user clicks "Print", the job is sent to CUPS (also using libcups).


When the dialog is closed, we check whether other instances of the 
dialog (or other avahi-daemon-using apps, how do we identify them 
without having an explicit list?) are still running and if not, we kill 
avahi-daemon. cups-browsed and cupsd keep running, we modify 
cups-browsed that it keeps running when avahi-daemon appears and 
disappears and let it remove the job-less (empty) Avahi-discovered 
queues if avahi-daemon disappears.cupsd closes by itself 30 sec after 
there are no jobs any more and cups-browsed closes by itself if it runs 
30 sec without having any cups-browsed-generated print queues, meaning 
that all but the queue which is printuing the user# s job get removed 
when avahi-daemon is killed by the dialog closing and the remaining 
queue gets removed when the job finishes, if within 30 seconds no new 
print dialog gets opened )which starts avahi-daemon) cups-browsed 
closes. These non-permanent (auto-closing) modes of cups-browsed and 
cupsd we are triggered by a special command line option which we will 
introduce to the daemons and use it when calling from the print dialog 
)or when calling cupsd socket-triggered by Upstart).


So we will modify cups-browsed:

- Keep running independent of avahi-daemon running, simply remove the 
empty avahi-detected queues if avahi-daemon disappears and recover to 
avahi use if avahi-deamon reappears.

- Command line option to stop if 30 sec without cups-browsed-created queues.

and cupsd:

- Support for Upstart-induced startup: 
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1276713
- Command line option for stopping when 30 sec without jobs and without 
shared printers (default when Upstart-socket-induced).


WDYT? Should we go this way?

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: On-demand starting/stopping of cups [was: [Blueprint client-1305-printing-stack-with-mobile-in-mind] Printing Stack with Mobile in Mind]

2014-02-05 Thread Till Kamppeter

On 04.02.2014 20:06, Seth Arnold wrote:

Lets hope it isn't 30 actual seconds; I'm accustomed to hearing the
printer spool up near immediately. Thirty seconds is long enough that I'd
suspect something is broken and begin troubleshooting.


Since CUPS broadcasting/browsing was replaced by Bonjour/Avahi the times 
of 30 seconds are over. Bonjour/Avahi-broadcasted printers appear in a 
few seconds.


   Till



--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: On-demand starting/stopping of cups [was: [Blueprint client-1305-printing-stack-with-mobile-in-mind] Printing Stack with Mobile in Mind]

2014-02-05 Thread Till Kamppeter

On 05.02.2014 06:40, Martin Pitt wrote:

Yes, agreed. I'm not concerned about cups' start up time, that's
negligible. I'm primarily concerned about the time that it takes to
detect remote printers, as they are only advertised/broadcast every so
often (30s?). For that I think we ought to have at least avahi running
permanently, so that it can pick up remote services and then when
cups/cups-browsed get activated they can immediately use remote
printers. That assumes that it's actually avahi-daemon which
stores/caches those; if that's not the case, then cups-browsed needs
to run all the time instead.


pitti, I remember that the old CUPS broadcasting (by CUPS itself, 
without Avahi/Bonjour) was happening only every 30 sec. The new 
Avahi/Bonjour method seems to be faster. But note that for testing I 
have run the following script


--
sudo stop cups-browsed
sudo stop cups
sudo stop avahi-daemon
sleep 10
sudo start avahi-daemon
sudo start cups
sudo start cups-browsed
watch lpstat -v
--

Now I do not know whether avahi-daemon is creating a cache file to 
conserve the cached items while being shut down and restarted later. 
With this script the queues appear in ~4 sec.


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: On-demand starting/stopping of cups [was: [Blueprint client-1305-printing-stack-with-mobile-in-mind] Printing Stack with Mobile in Mind]

2014-02-04 Thread Till Kamppeter

On 04.02.2014 15:24, Stéphane Graber wrote:

One case we need to make sure is properly covered is job queuing.

Specifically, if I attempt to print something to a disabled printer (not
plugged in, no paper, ...), then reboot my laptop for whatever reason, I
then expect cups to start immediately after reboot to try and process
its queue. Having to wait till the next time you try and print something
to process the queue seems odd and wrong to me.



This I have already planned: On boot we should check whether there are 
jobs left over from the previous session and if so, start CUPS so that 
they get printed.


   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: CUPS 1.7.x ready for testing!

2013-07-22 Thread Till Kamppeter
I have updated to CUPS 1.7.0 RC1 now. If you have already added my PPA
to your system all what you need to do is updating your system,
otherwise add my PPA as described in my initial posting (copy below).

If you have network printers and/or remote CUPS servers (Linux, Mac, and
also some routers) around, try also the command line tools ipptool and
ippfind.

   Till

On 06/11/2013 12:16 PM, Till Kamppeter wrote:
> Hi,
> 
> I have packaged CUPS 1.7b1, a first beta version of the 1.7.x series of
> CUPS and uploaded it to my PPA [1] for both Raring and Saucy, both based
> on the current Debian 1.6.2-8 package of CUPS (source packages of Raring
> and Saucy version are identical).
> 
> There are only a few new features, mainly API enhancements [2]:
> 
>  - Improved support for paid, PIN, and release printing
>  - Expanded support for IPP Everywhere
>  - Automatic support for data compression
>  - Improved CUPS APIs
> 
> Note that most of the upstream web site is down currently, so I do not
> have much more info about the new release.
> 
> Please try it out and report your experiences here.
> 
>Till
> 
> 
> [1]https://launchpad.net/~till-kamppeter/+archive/ppa
> [2]http://www.cups.org/index.php
> 


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Tested X for Saucy on x-staging PPA with touch screen

2013-07-18 Thread Till Kamppeter
On 07/18/2013 05:24 PM, Till Kamppeter wrote:
> The issues are the following:
> 
> 1. (Most important) In Firefox, drop-down lists on web pages do not work
> when operating via touch screen but they work when using a mouse. In
> Chrome the drop-downs work.
> 

Found another browser problem:

In Chrome you cannot access the main menu which is reached by the button
on the upper right corner. This works only with a mouse and notr with touch.

Touch should emulate a mouse and work wherever a mouse works. Or are
there apps which communicate directly with a mouse, surrounding X?

   Till



-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Tested X for Saucy on x-staging PPA with touch screen

2013-07-18 Thread Till Kamppeter
Hi,

some days ago you asked me for testing the touch screen behavior on my
Lenovo Thinkpad Twist again using Saucy with the newest X from the
x-staging PPA. Unfortunately, I was on vacation that day, so now I was
able to do the testing.

It seems to be stable, not getting stuck after some time as it happened
before.

The issues are the following:

1. (Most important) In Firefox, drop-down lists on web pages do not work
when operating via touch screen but they work when using a mouse. In
Chrome the drop-downs work.

2. In "Universal Access" in the system settings one can emulate a right
click by a long left click. This would be a great feature for the touch
screen to make the right click easily available. Unfortunately, this
only works with a mouse and not with the touch screen. Could this be
fixed to also work with touch?

3. In the application XBMC (media player) touch operation does not work
at all. When touching the screen at an arbitrary place, the mouse
pointer jumps to the lower right corner. It is unclear whether this is
actually X's fault or XBMC's fault (also reported to XBMC as
http://trac.xbmc.org/ticket/14300). On the Nexus 7 with Raring and XBMC
11.x this works and XBMC's interface is great for touch.

(3) is not working with all X versions, both official and from the
x-staging PPA, (2) I only discovered today, and for (1) I do not know
whether it worked before.

   Till

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: xserver 1.14 ready for testing in saucy

2013-07-03 Thread Till Kamppeter
On 06/24/2013 03:45 PM, Till Kamppeter wrote:
> On 06/24/2013 03:08 PM, Maarten Lankhorst wrote:
>> With the upload of a newer fglrx all bits are in place for a smooth 
>> transition to x1.14.
>> Considering there are no version changes for mesa or any of the ddx drivers 
>> I don't expect
>> any driver specific regression with the open source drivers.
>>
>> For now it requires the unity ppa, and the unity from the x-staging ppa:
>>
>> sudo add-apt-repository ppa:ubuntu-unity/daily-build
>> sudo add-apt-repository ppa:canonical-x/x-staging
>> sudo apt-get update
>> sudo apt-get dist-upgrade
>>
>> All test results welcome, but unity specific bugs that don't disappear with 
>> x-staging
>> purged with should be filed against unity.
>>
>> The binary drivers for the pandaboard don't work with the new abi and there
>> will not be a new driver for them. If you really want to upgrade install
>> xserver-xorg-core-omap-revert from the ppa. It is only provided to have
>> a xserver for pandaboards that's compatible with the new pointer barriers,
>> and it will very likely not receive any further updates.
>>
>> ~Maarten
>>
>>
> 
> I have installed it on Saucy on my Lenovo Thinpad Twist (Core i7
> Ultrabook/Convertible with touch screen) and the touch left click still
> gets stuck after some time, as described in
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=56578:
>race condition with active/passive grabs when opening menus with
>touch
> 
> https://launchpad.net/bugs/1068994:
>button1 gets stuck after a while
> 
> https://launchpad.net/bugs/1015183:
>Inconsistent mouse events for Acer T231H multitouch monitor
> 
> On Raring with the x-staging stuff the touch left click keeps working
> for me and does not get stcuk after some time.
> 
> I hope this gets fixed in Saucy (or is it already given up as X is
> approaching EOL due to being replaced by MIR and Wayland?).
> 
>Till
> 

I tested again on Saucy, after having Raring running for some time and
afater updating Saucy to the newest state (still with X staging PPA) and
now touch operation seems to be stable. I did a lot of touch movements,
both clicks and drags and the touch screen keeps working.

A little hint to make touch operation of the Ubuntu desktop easier is to
turn off the overlay scrollbars. The classic scrollbars are much easier
to operate via finger-based touch screen.

Command to turn off overlay scrollbars

gsettings set com.canonical.desktop.interface scrollbar-mode normal

and to get overlay scrollbars back

gsettings reset com.canonical.desktop.interface scrollbar-mode

These changes get active immediately, even on already running
applications. The settings are also persistent (I tested by logging out
and in again).

   Till


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: xserver 1.14 ready for testing in saucy

2013-06-24 Thread Till Kamppeter
On 06/24/2013 03:08 PM, Maarten Lankhorst wrote:
> With the upload of a newer fglrx all bits are in place for a smooth 
> transition to x1.14.
> Considering there are no version changes for mesa or any of the ddx drivers I 
> don't expect
> any driver specific regression with the open source drivers.
> 
> For now it requires the unity ppa, and the unity from the x-staging ppa:
> 
> sudo add-apt-repository ppa:ubuntu-unity/daily-build
> sudo add-apt-repository ppa:canonical-x/x-staging
> sudo apt-get update
> sudo apt-get dist-upgrade
> 
> All test results welcome, but unity specific bugs that don't disappear with 
> x-staging
> purged with should be filed against unity.
> 
> The binary drivers for the pandaboard don't work with the new abi and there
> will not be a new driver for them. If you really want to upgrade install
> xserver-xorg-core-omap-revert from the ppa. It is only provided to have
> a xserver for pandaboards that's compatible with the new pointer barriers,
> and it will very likely not receive any further updates.
> 
> ~Maarten
> 
> 

I have installed it on Saucy on my Lenovo Thinpad Twist (Core i7
Ultrabook/Convertible with touch screen) and the touch left click still
gets stuck after some time, as described in

https://bugs.freedesktop.org/show_bug.cgi?id=56578:
   race condition with active/passive grabs when opening menus with
   touch

https://launchpad.net/bugs/1068994:
   button1 gets stuck after a while

https://launchpad.net/bugs/1015183:
   Inconsistent mouse events for Acer T231H multitouch monitor

On Raring with the x-staging stuff the touch left click keeps working
for me and does not get stcuk after some time.

I hope this gets fixed in Saucy (or is it already given up as X is
approaching EOL due to being replaced by MIR and Wayland?).

   Till


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


CUPS 1.7.x ready for testing!

2013-06-11 Thread Till Kamppeter
Hi,

I have packaged CUPS 1.7b1, a first beta version of the 1.7.x series of
CUPS and uploaded it to my PPA [1] for both Raring and Saucy, both based
on the current Debian 1.6.2-8 package of CUPS (source packages of Raring
and Saucy version are identical).

There are only a few new features, mainly API enhancements [2]:

 - Improved support for paid, PIN, and release printing
 - Expanded support for IPP Everywhere
 - Automatic support for data compression
 - Improved CUPS APIs

Note that most of the upstream web site is down currently, so I do not
have much more info about the new release.

Please try it out and report your experiences here.

   Till


[1]https://launchpad.net/~till-kamppeter/+archive/ppa
[2]http://www.cups.org/index.php

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Ubuntu Touch: Poppler or MuPDF as PDF renderer

2013-05-30 Thread Till Kamppeter
Is it reliable, fast, resource-saving?

Does it display all files, also large and complex ones?

Does it allow different output formats (screen, PNG, PostScript, CUPS
Raster, PCL, ...)?

Does it allow filling and saving forms?

Probably it is a good idea for the future, but above features need to
get implemented first (especially output formats). There also needs to
get added support for it in the cups-filters package.

   Till


On 05/30/2013 08:34 AM, Jan Henke wrote:
> Hi,
> 
> would a JavaScript implementation help? pdf.js from Mozilla is available
> under the Apache v2 licence at github: https://github.com/mozilla/pdf.js/
> 
> Best Regards
> Jan Henke
> 
> Am 29.05.2013 23:26, schrieb Till Kamppeter:
>> On 05/21/2013 12:32 AM, Alexander Antimonov wrote:
>>> As both Poppler and MuPDF are strong copylefted, question is if
>>> either of two may be turned into "standard API" for pdf rendering?
>>> Because doing so would require third-party apps be GPL compatible.
>> Seems that someone needs to start writing a new PDF renderer from
>> scratch then. All Open Source PDF renderers seem to be strict GPL.
>>
>>Till
>>
>>
>>
> 


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Ubuntu Touch: Poppler or MuPDF as PDF renderer

2013-05-29 Thread Till Kamppeter
On 05/21/2013 12:32 AM, Alexander Antimonov wrote:
> As both Poppler and MuPDF are strong copylefted, question is if
> either of two may be turned into "standard API" for pdf rendering?
> Because doing so would require third-party apps be GPL compatible.

Seems that someone needs to start writing a new PDF renderer from
scratch then. All Open Source PDF renderers seem to be strict GPL.

   Till



-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Ubuntu Touch: Poppler or MuPDF as PDF renderer

2013-05-20 Thread Till Kamppeter
On 05/18/2013 10:37 PM, Alexander Antimonov wrote:
> 
> What exact testing do we want: render speed, memory consumption,
> robustness, supported features comparison, code quality, all of these
> and more?
> 
> Cheers.
> 

Most importnt is resource consumption: disk space, RAM, CPU, battery.
Does MuPDF give a significant advantage against Poppler? Output quality
also needs to be checked. If low resource consumption is gained by a
terrible output quality, this will not help much.

   Till


-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Ubuntu Touch: Poppler or MuPDF as PDF renderer

2013-05-18 Thread Till Kamppeter
On 05/18/2013 07:17 AM, Steve Langasek wrote:
> Hi Till,
> 
> On Fri, May 17, 2013 at 01:25:12PM +0200, Till Kamppeter wrote:
>> So Ghostscript is out of the question here as it is large and the PDF
>> interpreter is written in PostScript. Poppler has the advantage of
>> having a long history and so it should deal best with quirky files.
>> MuPDF is written with lightweightness in mind, is the only free software
>> which allows filling and saving PDF forms,
> 
> This doesn't sound accurate to me - I've used evince before (which is
> poppler based) to fill out PDF forms and save them.  Maybe this should be
> checked?

See

https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1153517

   Till



-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Ubuntu Touch: Poppler or MuPDF as PDF renderer

2013-05-17 Thread Till Kamppeter
Hi,

during my thoughts about the printing stack for Ubuntu Touch [1] I came
to the conclusion that printing needs a PDF renderer to turn incoming
PDF into the printer's language (PWG Raster, PostScript, PCL, ...) but a
PDF renderer needs already to be on a mobile device to make it able to
display PDF files on the screen.

The Ubuntu desktop uses Poppler for screen display and Ghostscript for
printing. On a mobile device this is overkill. We need only one PDF
renderer and also no PostScript interpreter as for printing we expect
all apps to send PDF.

So Ghostscript is out of the question here as it is large and the PDF
interpreter is written in PostScript. Poppler has the advantage of
having a long history and so it should deal best with quirky files.
MuPDF is written with lightweightness in mind, is the only free software
which allows filling and saving PDF forms, and is written by the
Ghostscript developers who are experts on the field of printing.

So I want to call for testing the two (Poppler, MuPDF) and for discussion.

We have also a Blueprint [2] and a Wiki page [3].

   Till

[1]https://blueprints.launchpad.net/ubuntu/+spec/client-1305-printing-stack-with-mobile-in-mind
[2]https://blueprints.launchpad.net/ubuntu/+spec/client-1305-pdf-renderer-for-ubuntu-touch
[3]https://wiki.ubuntu.com/Touch/PDFRenderer

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: [CFT] Intel graphics SNA acceleration

2013-01-18 Thread Till Kamppeter

On 01/18/2013 10:43 AM, Timo Aaltonen wrote:

On 10.01.2013 21:05, Timo Aaltonen wrote:


 Hi!

   The Ubuntu X team would like people running raring on machines with
Intel graphics to try the new acceleration method called 'SNA'. It
should have slightly better performance and less bugs than the current
default. Check this wiki page for further details on how to participate:

http://wiki.ubuntu.com/X/Testing/IntelSNA


Thanks to all who provided feedback!

The testing was a success, though we've identified a minor rendering
issue with gen4 chips (#1098334), which is already known upstream.
Despite this bug we will flip the default to SNA early next week.




I have added a small glitch:

https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1101159

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Please test AirPrint on Natty and Oneiric

2011-07-18 Thread Till Kamppeter

Thank you very much.

   Till

On 07/17/2011 05:06 PM, Sven Sorgenfrey wrote:

Dear Mr Kamppeter,

I just configured the support for airprint on my ubuntu 11.04 system and
it works perfectly. The only problem I had following your instructions
(https://lists.ubuntu.com/archives/ubuntu-devel/2011-June/033611.html)
was accessing the server settings in system-config-printer. I tried
http://localhost:631/admin which worked.

Thanx a lot! This is real fun!

Yours
Sven Sorgenfrey


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Please test AirPrint on Natty and Oneiric

2011-06-28 Thread Till Kamppeter

On 06/28/2011 06:52 PM, Daniel Chen wrote:

Hi Till,

On Jun 28, 2011 10:31 AM, "Till Kamppeter" mailto:till.kamppe...@gmail.com>> wrote:
 >
 > Before reporting bugs, please check your CUPS package version. It
must be 1.4.6-5ubuntu1.3 on Natty and 1.4.6-11 on Oneiric. Wait for the
mirrors to catch up if needed.
 >

Did you mean -9 for Oneiric? I don't see -11 on Launchpad or Debian PTS
(or Incoming), only -9.

Cheers,
-Dan



It must contain the following entry in debian/changelog:

  [ Till Kamppeter ]
  * debian/patches/cups-avahi.dpatch: Updated Avahi patch to fix places in
the CUPS source code where libdns_sd is supported but not Avahi.
especially accept being called with a hostname with ".local" domain
so that AirPrint works without "ServerAlias *" in cupsd.conf (LP: 
#801306).


Martin Pitt told that he is currently putting it up.

   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Please test AirPrint on Natty and Oneiric

2011-06-28 Thread Till Kamppeter
Before reporting bugs, please check your CUPS package version. It must 
be 1.4.6-5ubuntu1.3 on Natty and 1.4.6-11 on Oneiric. Wait for the 
mirrors to catch up if needed.


   Till

On 06/28/2011 06:19 PM, Till Kamppeter wrote:

Hi,

as a first step into support for printing from mobile devices I have
made Apple's AirPrint working on Natty and Oneiric. AirPrint is the
method how Apple's iPhone, iPad, and iPod Touch print via IPP. I want to
ask all of you to test this feature.


What is AirPrint?
-

http://www.apple.com/iphone/features/airprint.html


What do you need?
-

1. An iPhone, iPad, or iPod Touch with iOS 4.2 or newer. Update your
device via iTunes if needed. If no update gets offered to you, update
iTunes first, if after that you do not get an update offered, your
device is too old.

2. A computer running Ubuntu Natty or Oneiric. Please update your
computer to the newest state of the art with the update-manager. For
Natty you need to activate the natty-proposed repository.

3. A print queue on your computer. If you do not have a printer, create
a pseudo printer with the following commands in a terminal:

cupsctl FileDevice=yes
lpadmin -p test -E -v file:/tmp/test.ps -m drv:///sample.drv/generic.ppd
-o PageSize=A4

When printing on this printer, you get a PostScript file /tmp/test.ps.
Make it world-readable and display it with evince.

If you have a printer, every printer which works under Ubuntu does
AirPrint with Ubuntu, not only the HP printers listed on Apple's web
site (they do AirPrint directly, without computer).

4. WLAN. Switch the internet access of your mobile device to WLAN. Your
computer must be in the same LAN (on the same router), but it does not
matter whether it is connected via ethernet cable or WLAN.


How do you test?


1. On your computer start system-config-printer via System ->
Administration -> Printing (GNOME Classic) or via Turn-off-button at the
upper right -> System Settings -> Hardware -> Printing (Unity Natty) or
via the command line (all systems including Unity Oneiric).

2. In system-config-printer choose Server -> Settings and activate
"Published shared printers connected to this system". Click OK and then
right-click on the icon of your print queue and choose Properties in the
pop-up menu. In the Policies section of the dialog make sure that
"Shared" is activated.

3. Make sure your mobile device is accessing your local network using
WLAN and then open an application with printing functionality on it
(like for example the browser or the photo viewer). Print something. The
print dialog should show your print queue and allow some basic settings.
Note that the Description/Info field and not the name of the queue is
shown.

4. Check whether you get a correct printout.

5. Report your results here. If something goes wrong, report a bug on
Launchpad.


Links:
--

http://www.finnie.org/2010/11/13/airprint-and-linux/
This is the HOWTO on which my patches are based. On Natty and Oneiric
you DO NOT need to create the Avahi service definition file described
here and you DO NOT need to add a "ServerAlias *" line to cupsd.conf.

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/711779
The bug report which initiated my work on that problem.

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/801306
AirPrint only works with "ServerAlias *" in /etc/cups/cupsd.conf


Have a lot of fun with your first experience on mobile printing.

Till




--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Please test AirPrint on Natty and Oneiric

2011-06-28 Thread Till Kamppeter

Hi,

as a first step into support for printing from mobile devices I have 
made Apple's AirPrint working on Natty and Oneiric. AirPrint is the 
method how Apple's iPhone, iPad, and iPod Touch print via IPP. I want to 
ask all of you to test this feature.



What is AirPrint?
-

http://www.apple.com/iphone/features/airprint.html


What do you need?
-

1. An iPhone, iPad, or iPod Touch with iOS 4.2 or newer. Update your 
device via iTunes if needed. If no update gets offered to you, update 
iTunes first, if after that you do not get an update offered, your 
device is too old.


2. A computer running Ubuntu Natty or Oneiric. Please update your 
computer to the newest state of the art with the update-manager. For 
Natty you need to activate the natty-proposed repository.


3. A print queue on your computer. If you do not have a printer, create 
a pseudo printer with the following commands in a terminal:


cupsctl FileDevice=yes
lpadmin -p test -E -v file:/tmp/test.ps -m drv:///sample.drv/generic.ppd 
-o PageSize=A4


When printing on this printer, you get a PostScript file /tmp/test.ps. 
Make it world-readable and display it with evince.


If you have a printer, every printer which works under Ubuntu does 
AirPrint with Ubuntu, not only the HP printers listed on Apple's web 
site (they do AirPrint directly, without computer).


4. WLAN. Switch the internet access of your mobile device to WLAN. Your 
computer must be in the same LAN (on the same router), but it does not 
matter whether it is connected via ethernet cable or WLAN.



How do you test?


1. On your computer start system-config-printer via System -> 
Administration -> Printing (GNOME Classic) or via Turn-off-button at the 
upper right -> System Settings -> Hardware -> Printing (Unity Natty) or 
via the command line (all systems including Unity Oneiric).


2. In system-config-printer choose Server -> Settings and activate 
"Published shared printers connected to this system". Click OK and then 
right-click on the icon of your print queue and choose Properties in the 
pop-up menu. In the Policies section of the dialog make sure that 
"Shared" is activated.


3. Make sure your mobile device is accessing your local network using 
WLAN and then open an application with printing functionality on it 
(like for example the browser or the photo viewer). Print something. The 
print dialog should show your print queue and allow some basic settings. 
Note that the Description/Info field and not the name of the queue is shown.


4. Check whether you get a correct printout.

5. Report your results here. If something goes wrong, report a bug on 
Launchpad.



Links:
--

http://www.finnie.org/2010/11/13/airprint-and-linux/
  This is the HOWTO on which my patches are based. On Natty and Oneiric
  you DO NOT need to create the Avahi service definition file described
  here and you DO NOT need to add a "ServerAlias *" line to cupsd.conf.

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/711779
  The bug report which initiated my work on that problem.

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/801306
  AirPrint only works with "ServerAlias *" in /etc/cups/cupsd.conf


Have a lot of fun with your first experience on mobile printing.

   Till


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: lsb printing support [Was, Re: Qt3 and LSB compliance]

2011-03-02 Thread Till Kamppeter

On 03/02/2011 09:35 PM, Steve Langasek wrote:

On Wed, Mar 02, 2011 at 08:31:15PM +0100, Till Kamppeter wrote:


Nothing in main depends on the lsb package except for kubuntu-full, and
nothing installs it by default.  Are you saying that you intended to *add* a
new dependency on lsb in natty?  (If so, that would appear to require a
feature freeze exception at this point, for whatever this new feature is?)



Bear in mind that 'lsb' is the package providing the full LSB system.  If
you only need the LSB printing subsystem, there's an 'lsb-printing' package
for that.  But regardless, I don't see anything here that requires keeping
the packages in main given that they're not installed by default anyway.



I do not introduce a new feature, as "lsb" was in main before
feature freeze.


Nothing in main (except for kubuntu-full) depends on lsb; ergo nothing in
main *uses* lsb; ergo anything that would start to use lsb now would be a
new feature that doesn't currently exist, and is subject to the feature
freeze.


Moving 'lsb' from main to Universe would require a Feature Freeze
Exception.


No, that's not how it works.


Automatic printer driver downloads are a feature which we already agreed
on during the last UDSes and pitti has just completed the Jockey part of
it.


Agreeing to features in UDS is not a guarantee of these features landing in
a given Ubuntu release.  They may fail to be included for various reasons,
including: the developers may decide that the feature is technically
incorrect; there may not be sufficient resources to implement the feature;
or the feature may not be implemented on schedule, with a decision taken
that landing the feature after feature freeze is too risky.

On the other hand, since Martin is most definitely familiar with all of
this, and you say he's implementing the jockey side of things, it's likely
that he's already thought about all of this and has a FFe request planned
(if needed).


As manufacturers are told that they have to make LSB packages (so
that one package fits all distros), the full LSB needs to stay in main.
Manufacturers have for example the liberty to ship a GUI tool with the
driver.  Therefore we need to keep the LSB.


That's a complete non sequitur.  Jockey supports installing lots of things
that aren't part of main... in fact, that's its primary use case.




Problem is already solved. pitti told me that Universe is activated in 
default installations and so the printer drivers do not have any 
problems to pull the "lsb" package.


   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Qt3 and LSB compliance

2011-03-02 Thread Till Kamppeter

On 03/02/2011 09:04 PM, Martin Pitt wrote:

Till Kamppeter [2011-03-02 19:04 +0100]:

pitti, we need to leave LSB in main to support the automatically
downloading printer driver packages.


Why does the lsb package have to be in main for that? We enable
universe by default, and once you install third-party packages you
already left the domain of supported packages anyway..


I did not know that Universe is activated by default. Then it is no 
problem for the printer drivers to pull "lsb" from Universe. So for most 
users the drivers simply install and "just work".


But how is it working with commercial support customers who buy 
LSB-based commercial software? And how do system-config-printer and 
Jockey behave for these customers if due to missing "lsb" (when Universe 
is turned off) the printer driver packages cannot get installed?


   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: lsb printing support [Was, Re: Qt3 and LSB compliance]

2011-03-02 Thread Till Kamppeter

On 03/02/2011 07:46 PM, Steve Langasek wrote:

On Wed, Mar 02, 2011 at 07:04:45PM +0100, Till Kamppeter wrote:

On 03/02/2011 05:53 PM, Martin Pitt wrote:

I take it we'd still need to keep Qt3 around in universe for some
time. Would it be feasible to move lsb-desktop and lsb to universe as
well? The only real main dependency of it that I see is the
"kubuntu-full" task, i. e. it'd just need unseeding.



pitti, we need to leave LSB in main to support the automatically
downloading printer driver packages. Epson has them on-line for near
a year, system-config-printer supports them and now this should
finally work to get more manufacturers onto the "Plug'n'Print" boat.


Nothing in main depends on the lsb package except for kubuntu-full, and
nothing installs it by default.  Are you saying that you intended to *add* a
new dependency on lsb in natty?  (If so, that would appear to require a
feature freeze exception at this point, for whatever this new feature is?)

Bear in mind that 'lsb' is the package providing the full LSB system.  If
you only need the LSB printing subsystem, there's an 'lsb-printing' package
for that.  But regardless, I don't see anything here that requires keeping
the packages in main given that they're not installed by default anyway.


I do not introduce a new feature, as "lsb" was in main before feature 
freeze. Moving 'lsb' from main to Universe would require a Feature 
Freeze Exception. Automatic printer driver downloads are a feature which 
we already agreed on during the last UDSes and pitti has just completed 
the Jockey part of it. As manufacturers are told that they have to make 
LSB packages (so that one package fits all distros), the full LSB needs 
to stay in main. Manufacturers have for example the liberty to ship a 
GUI tool with the driver. Therefore we need to keep the LSB.


   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Qt3 and LSB compliance

2011-03-02 Thread Till Kamppeter

On 03/02/2011 05:53 PM, Martin Pitt wrote:

I take it we'd still need to keep Qt3 around in universe for some
time. Would it be feasible to move lsb-desktop and lsb to universe as
well? The only real main dependency of it that I see is the
"kubuntu-full" task, i. e. it'd just need unseeding.


pitti, we need to leave LSB in main to support the automatically 
downloading printer driver packages. Epson has them on-line for near a 
year, system-config-printer supports them and now this should finally 
work to get more manufacturers onto the "Plug'n'Print" boat.


   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: Qt3 and LSB compliance

2011-03-02 Thread Till Kamppeter

On 03/02/2011 05:05 PM, Jonathan Riddell wrote:

This leaves one dependency, lsb-desktop.  LSB upstream is pretty
inactive and doesn't seem to be updating to remove this obsolete
library.  Do we care about about LSB to keep Qt 3 in main?


LSB upstream IS active, only that they release new versions only every 
1-2 years. The problem of LSB requiring such old libraries is that LSB 
defines a set of characteristics which all currently supported 
enterprise level Linux distributions have in common, so that commercial 
software vendors can release binary packages which work on all important 
distros. Due to low release frequencies and long support periods of 
enterprise distros the LSB always requires library versions much older 
than the versions shipping in current non-LTS Ubuntu.


   Till

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel