Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

brother printer drives #9

Closed
pordyna opened this issue Apr 4, 2021 · 16 comments
Closed

brother printer drives #9

pordyna opened this issue Apr 4, 2021 · 16 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@pordyna
Copy link

pordyna commented Apr 4, 2021

Could you please add the printer-driver-brlaser from this repo to the docker file? This would add support for more brother laser printers. 😄

@RagingTiger
Copy link
Owner

@pordyna I will begin the process of researching/testing the driver and if there are no issues I will update the Dockerfile to incorporate this driver into the Docker image build.

In the mean time, can you share what printer(s) you will be using this driver for? This will help all of the users (including myself) know more about what printers are able to successfully work with this Docker image (once the changes are incorporated).

@RagingTiger
Copy link
Owner

If you run the current tigerj/cups-airprint image as follows:

$ docker run --rm -it tigerj/cups-airprint apt list | grep printer-driver
printer-driver-all/now 0.20140714build1 all [installed,local]
printer-driver-brlaser/now 3-5~ubuntu1 amd64 [installed,local]     <-------------- Driver is listed in output
printer-driver-c2050/now 0.3b-6 amd64 [installed,local]
printer-driver-c2esp/now 27-2 amd64 [installed,local]
printer-driver-cjet/now 0.8.9-6 amd64 [installed,local]
printer-driver-cups-pdf/now 2.6.1-21 amd64 [installed,local]
printer-driver-dymo/now 1.4.0-5 amd64 [installed,local]
printer-driver-escpr/now 1.6.3-2 amd64 [installed,local]
printer-driver-foo2zjs/now 20151024dfsg0-1ubuntu1 amd64 [installed,local]
printer-driver-foo2zjs-common/now 20151024dfsg0-1ubuntu1 all [installed,local]
printer-driver-gutenprint/now 5.2.11-1 amd64 [installed,local]
printer-driver-hpcups/now 3.16.3+repack0-1 amd64 [installed,local]
printer-driver-hpijs/now 3.16.3+repack0-1 amd64 [installed,local]
printer-driver-m2300w/now 0.51-12 amd64 [installed,local]
printer-driver-min12xxw/now 0.0.9-9 amd64 [installed,local]
printer-driver-pnm2ppa/now 1.13+nondbs-0ubuntu5 amd64 [installed,local]
printer-driver-postscript-hp/now 3.16.3+repack0-1 all [installed,local]
printer-driver-ptouch/now 1.4-1 amd64 [installed,local]
printer-driver-pxljr/now 1.4+repack0-4 amd64 [installed,local]
printer-driver-sag-gdi/now 0.1-4ubuntu1 all [installed,local]
printer-driver-splix/now 2.0.0+svn315-4fakesync1 amd64 [installed,local]

You will see that it is actually installed by the package printer-driver-all seen here in the Dockerfile.

Were you unable to get your Brother printer to work? Let me know and we'll trouble shoot from there.

@pordyna
Copy link
Author

pordyna commented Apr 5, 2021

Hi, first thanks for getting on this so quickly! It looks like there is an old version of brlaser on the container (v3). Apparently the newest version (v6) that supports more printers is available as a binary since ubuntu focal (20.04LTS) link. Your docker seams to be based on ubuntu xenial. Do you use an older version for a reason?

@RagingTiger
Copy link
Owner

So the issue with updating to Ubuntu 20.04 is that Python 2 is deprecated and this repo depends on the python-cups library that (you guessed it) is for Python 2.

Now, I have started a dev branch specifically for this Python 3 migration. I have also successfully built the Docker image locally. Running the below Docker command we can see the printer drivers that will be installed in Ubuntu 20.04:

$  docker run --rm -it tigerj/cups-airprint:dev apt list | grep printer-driver
printer-driver-all/now 0.20170124 all [installed,local]
printer-driver-brlaser/now 6-1build1 amd64 [installed,local]      <------ Your Driver
printer-driver-c2050/now 0.3b-8 amd64 [installed,local]
printer-driver-c2esp/now 27-6 amd64 [installed,local]
printer-driver-cjet/now 0.8.9-7 amd64 [installed,local]
printer-driver-cups-pdf/now 3.0.1-6 amd64 [installed,local]
printer-driver-dymo/now 1.4.0-9build1 amd64 [installed,local]
printer-driver-escpr/now 1.7.7-1 amd64 [installed,local]
printer-driver-foo2zjs-common/now 20171202dfsg0-4 all [installed,local]
printer-driver-foo2zjs/now 20171202dfsg0-4 amd64 [installed,local]
printer-driver-fujixerox/now 1.1.0+ds-3 amd64 [installed,local]
printer-driver-gutenprint/now 5.3.3-4 amd64 [installed,local]
printer-driver-hpcups/now 3.20.3+dfsg0-2 amd64 [installed,local]
printer-driver-hpijs/now 3.20.3+dfsg0-2 amd64 [installed,local]
printer-driver-m2300w/now 0.51-14 amd64 [installed,local]
printer-driver-min12xxw/now 0.0.9-11 amd64 [installed,local]
printer-driver-pnm2ppa/now 1.13+nondbs-0ubuntu6 amd64 [installed,local]
printer-driver-postscript-hp/now 3.20.3+dfsg0-2 amd64 [installed,local]
printer-driver-ptouch/now 1.4.2-3 amd64 [installed,local]
printer-driver-pxljr/now 1.4+repack0-5 amd64 [installed,local]
printer-driver-sag-gdi/now 0.1-7 all [installed,local]
printer-driver-splix/now 2.0.0+svn315-7fakesync1build1 amd64 [installed,local]

The next step would involve migrating the Python 2 script located here to Python 3.

While this may be trivial, I am still unclear about what would be the effects of this, and will this cause any other problems.

@marchanlon
Copy link
Contributor

The creator of the airprint-generate.py seems to already have done a Python 3 rewrite, it's available here if you want to take a look.

@RagingTiger
Copy link
Owner

@marchanlon Awesome. Ok this simplifies things greatly I will look into that. Thank you!

@RagingTiger
Copy link
Owner

The dev branch has been updated to use Python 3 and the airprint-generate repo as a submodule (which means it is using the Python 3 version of the airprint-generate.py script).

Unfortunately there are issues with building this image on Raspberry Pi OS using an Ubuntu image greater than 18.04. For the time being I am going to take a break, and if you would like to build the Docker image or try to address this Raspberry Pi OS issue, please see: https://askubuntu.com/questions/1263284/apt-update-throws-signature-error-in-ubuntu-20-04-container-on-arm

@pordyna
Copy link
Author

pordyna commented Apr 9, 2021

Thank you for putting in the work. I will have a look on thr rasberry pi issue. I want to use it on a Pi anyway.

@RagingTiger
Copy link
Owner

RagingTiger commented Apr 9, 2021

Glad to do it. It's a win/win for everyone.

I tested on both an RPi 3 and RPi 4 running docker build:

 $ docker build -t tigerj/cups-airprint:dev .
Sending build context to Docker daemon  441.9kB
Step 1/11 : FROM ubuntu:20.04
20.04: Pulling from library/ubuntu
Digest: sha256:3c9c713e0979e9bd6061ed52ac1e9e1f246c9495aa063619d9d695fb8039aa1f
Status: Downloaded newer image for ubuntu:20.04
 ---> 68c2aa67c6fb
Step 2/11 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 4f1749703b9b
Step 3/11 : RUN apt-get update && apt-get install -y    cups    cups-pdf         cups-bsd         cups-filters       hplip   inotify-tools   foomatic-db-compressed-ppds     printer-driver-all      openprinting-ppds    hpijs-ppds      hp-ppd  python3-cups && rm -rf /var/lib/apt/lists/*
 ---> Running in cf2961ed10d3
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [101 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [109 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists...
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.
The command '/bin/sh -c apt-get update && apt-get install -y    cups    cups-pdf         cups-bsd         cups-filters       hplip   inotify-tools   foomatic-db-compressed-ppds     printer-driver-all  openprinting-ppds        hpijs-ppds      hp-ppd  python3-cups && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

Here is the RPi and Docker version info:

  • Raspberry Pi 4 Model B Rev 1.1 ==> Docker version 20.10.5, build 55c4c88
  • Raspberry Pi 3 Model B Rev 1.2 ==> Docker version 20.10.5, build 55c4c88

Above you can see the error that mentioned above is addressed in the SO post. See if you can build it using your RPi (maybe there's something here specific to my RPi but I doubt it).

We'll get it sorted out, will just take a little longer than first inspection suggested 👍

@RagingTiger
Copy link
Owner

Original issue: moby/moby#40734

@RagingTiger
Copy link
Owner

This is how I was able to build the image on RPi (see this linuxserver.io FAQ):

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
$ echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list.d/buster-backports.list
$ sudo apt update
$ sudo apt install -t buster-backports libseccomp2

Using the above commands I was able to successfully build the Docker image on Raspberry Pi 4 Model B Rev 1.1 and Raspberry Pi 3 Model B Rev 1.2 both running Docker version 20.10.5, build 55c4c88.

Keep in mind this is only the building of the image not the running. I will have to look into testing that next.

See MichaIng/DietPi#4260 for more information on the above Docker build solution.

@RagingTiger RagingTiger pinned this issue Apr 11, 2021
@RagingTiger RagingTiger self-assigned this Apr 11, 2021
@RagingTiger RagingTiger added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Apr 11, 2021
@saue0
Copy link

saue0 commented Apr 21, 2021

wow, waitinh for this change , i have a Brother DCP-1510, using Unraid.
Airprint display the printer, but missing the newest driver.

@RagingTiger
Copy link
Owner

RagingTiger commented Apr 21, 2021

@saue0 I have made a dev image using the dev branch:

docker pull tigerj/cups-airprint:dev

Try it instead of the latest tag. It should have what you need. Test it out and see if it works 👍

@saue0
Copy link

saue0 commented Apr 21, 2021

Just install dev branch on my unraid. Work perfectly on my Brother DCP-1510 via an IPAD.
Thanks.

@RagingTiger
Copy link
Owner

RagingTiger commented Apr 21, 2021

tl;dr

For future users any OS with libseccomp2 < 2.4.4-1 is going to have issues building or running any image/container that uses Ubuntu > 18.04. Either update your host OS libseccomp2 to 2.4.4-1 (discussed below) or pull the tigerj/cups-airprint:dev docker image and run with --privileged (if permissions problems occur).

Full Explanation

The issue with updating to Ubuntu > 18.04 has to do with libseccomp2, whichDocker uses and older versions of these libraries existing on Raspberry Pi OS. (see: moby/moby#40734 and MichaIng/DietPi#4260)

Currently, the master branch is using Ubuntu 16.04 as its base image which has no issues with the older version of libseccomp2 installed on Raspberry Pi OS.

The dev branch is the attempt to update to Ubuntu 20.04 and Python 3, but there are issues relating to libseccomp2 causing the build to fail on hosts with older versions of libseccomp2. This can be circumvented by updating libseccomp2 as shown above (see: #9 (comment))

As an alternative to updating the host OS libseccomp2, you can simply pull the tigerj/cups-airprint:dev docker image and run it, but you may need to use the --privileged flag to run it on Raspberry Pi OS or any OS with a version of libseccomp2 < 2.4.4-1. This can be checked as follows:

$ apt list | grep libseccomp

That should update any future users who come across this issue/use case on what is the current state of the Ubuntu base image update.

@pordyna
Copy link
Author

pordyna commented May 23, 2021

I think this can be closed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants