Automatic discovery of printers not working
Hi
Thanks for this app. And sorry for the vague title.
I have a wireless printer that has its own server and also this printer shared over a Debian Pc via the Cups server. This app finds the wireless server but no printing happens(tried with firefox page->printing). When I select the printer I see no "print" icon however I have the brothers own print plugin that seem to work.
Also it cant find any Cups printers on the network like the one I mentioned above. I have a Pdf printer that is shared over the network via Cups, that does not show up either. I also tried putting the ip addresses and the printers as I would do over with other pcs, that does not work either.
Lastly The search button does not work when I enter the add printer option. It is not clickable at all. I tried putting custom ip of the server without any suiccess.
thanks
Do you use avahi/mDNS?
Hi
I am not sure. Do you mean on Android or Linux? I did not anythign special myself, all the server printer stuff is as is.
I mean on the (Linux) server. This enables auto-discovery of printers.
For the search button for manual "discovery", I haven't tested this lately so it may not work. I'll definitely test this.
Not sure if this is the same issue, but if I enter the hostname manually in the "add printers" view, and click the search button (https://github.com/BenoitDuffez/AndroidCupsPrint/blob/master/app/src/main/res/layout/add_printers.xml#L20), nothing happens. I don't see anything relevant in the logcat either.
If I enter nothing in the field and click the button, I get
04-14 17:36:36.941 26470 26584 W System.err: java.net.UnknownHostException: http://:631/printers/ (which I expected).
Entering http://<host>:631/printers/ in my browser on my PC shows me the CUPS web page with the printers on this host. Sharing is enabled for the relevant printer.
On the other hand:
In the "main view" (Settings -> Print -> Android CUPS print) I get a logcat message
04-14 17:42:28.967 26470 27018 V CUPS : No answer in mDNS response: java.net.DatagramPacket@66d1f9b
You need to type an IP address / host name there. Then the app will try to scan that host for printers.
If you don't want to type anything you need to use mDNS.
Regarding the automatic configuration, I activated the avahi service on my Raspberry Pi, where CUPS is running (and the printer is connected). The printer was found.
The search for printers on the entered host, however, didn't return any results. I guess I'll install Android Studio in the course of the next days and try to debug it to find out what goes wrong.
Yeah that feature is flaky at best. I think that mDNS is so good that only it should be used. I didn't test the scan host feature to be honest. I'd be glad to accept your contributions though!
Automatic discovery of printers not working still not working!
I have correct setup. Linux client successfully discovers cups server with no cups* packages, only avahi-daemon.
That time I switch "Android CUPS Print" service in "Printing" settings I got in logcat:
V CUPS : No answer in mDNS response: java.net.DatagramPacket@186e79d V CUPS : No answer in mDNS response: java.net.DatagramPacket@170a412 D CUPS : onPrintersDiscovered({})
but "tcpdump -vni br-lan udp and port 5353" show answers:
10.8.8.4 - phone 10.8.8.1 - cups server with avahi-daemon 10.8.8.6 - printer, accessible only from 10.8.8.1, 10.8.8.4 doesn't see it
IP 10.8.8.4.5353 > 224.0.0.251.5353: 0 PTR (QM)? _ipp._tcp.local. (33) IP 10.8.8.6.5353 > 224.0.0.251.5353: 0*- [0q] 1/0/5 PTR Samsung ML-2160 Series (SEC001599E1EEE9)._ipp._tcp.local. (654) IP 10.8.8.1.5353 > 224.0.0.251.5353: 0*- [0q] 5/0/0 PTR Samsung ML-2160 Series @ roo._ipp._tcp.local., (Cache flush) TXT "txtvers=1" "qtotal=1" "rp=printers/printer" "ty=Samsung ML-2165, 2.0.0" "adminurl=https://roo.local:631/printers/printer" "priority=0" "product=(ML-2165)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "URF=DM3" "UUID=3154c96e-9ce7-33ae-6523-7381f61a1601" "TLS=1.2" "Duplex=T" "Copies=T" "printer-state=3" "printer-type=0x3056", (Cache flush) SRV roo.local.:631 0 0, (Cache flush) AAAA fe80::20d:b9ff:fe4a:f806, (Cache flush) A 10.8.8.1 (520) IP 10.8.8.4.5353 > 224.0.0.251.5353: 0 PTR (QM)? _ipps._tcp.local. (34) IP 10.8.8.1.5353 > 224.0.0.251.5353: 0*- [0q] 5/0/0 PTR Samsung ML-2160 Series @ roo._ipps._tcp.local., (Cache flush) TXT "txtvers=1" "qtotal=1" "rp=printers/printer" "ty=Samsung ML-2165, 2.0.0" "adminurl=https://roo.local:631/printers/printer" "priority=0" "product=(ML-2165)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "URF=DM3" "UUID=3154c96e-9ce7-33ae-6523-7381f61a1601" "TLS=1.2" "Duplex=T" "Copies=T" "printer-state=3" "printer-type=0x3056", (Cache flush) SRV roo.local.:631 0 0, (Cache flush) AAAA fe80::20d:b9ff:fe4a:f806, (Cache flush) A 10.8.8.1 (521)
When I add printer manually by https://roo.local:631/printers/printer or http://roo.local:631/printers/printer all works fine.
Is this still active? I've been using mDNS for years and it's working like a charm, and I haven't got so many feedback about this issue. I'm tempted to close this.
Yes, this is still active! I can make a qemu/virtualbox image with cups and avahi.
BTW, "Default Print Service" from the lineageos 15.1 sucessfully founds the printer.
Gah. Sorry but I don't like lineage. I've used it on a very old device to get a more recent version of Android, and it breaks a lot of internal APIs. I'm afraid I won't be providing support on non-stock versions.
Have you reproduced this on recent beta builds? If you have the Play Store, please reproduce on the version that will be released tomorrow, and post logs here. If you don't have the Play Store, please compile an apk from the latest commit in develop and post logs. Thanks
ok, I'll test it again within a week
Please let me know whether this can be closed.
Sorry for late response. I still experience this issue. I'll do more tests for research.
I've done more tests for research and now I don't experience this issue more (: The main change was an upgrade from debian stretch to buster (cups 2.2.1-8+deb9u3 -> 2.2.10-6, avahi-daemon 0.6.32-2 -> 0.7-4+b1)
So it can be closed.