Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canon Pixma scanner only works if /etc/sane.d/pixma.conf is modified by hand #594

Open
robertozanasi opened this issue Apr 13, 2023 · 3 comments

Comments

@robertozanasi
Copy link

robertozanasi commented Apr 13, 2023

Canon Pixma scanner not automatically recongnized
I'm trying to use scanservjs inside a docker container, with a Canon Pixma MX920 printer/scanner connected via ethernet.

This is the output of scanimage -L outside the docker container:

device `pixma:MX920_192.168.1.5' is a CANON Canon PIXMA MX920 Series multi-function peripheral
device `airscan:w0:Canon MX920 series' is a WSD Canon MX920 series ip=192.168.1.5

But if I run the same program inside the docker container, nothing is found.

After some tests, I found that adding the following line to /etc/sane.d/pixma.conf inside the docker container solves every problem:

bjnp://192.168.1.5

But this line will be overwritten at every container update. So, how can I solve the problem permanently?

My docker-compose.yml file

version: "3"
services:
  scanservjs:
    build:
      context: .
      args:
        # ----- enter UID and GID here -----
        # UID: 1034
        GID: 1000
        # target: scanservjs-user2001
    container_name: scanservjs
    image: sbs20/scanservjs:latest
    environment:
      # ----- specify network scanners here; see above for more possibilities -----
      - SANED_NET_HOSTS=192.168.1.20
      - DEVICES="pixma:MX920_192.168.1.5"
      #- DEVICES="airscan:w0:Canon MX920 series"
      #- AIRSCAN_DEVICES='Canon MX920 series = http://192.168.1.5:80/wsd/scanservice.cgi'
    volumes:
      # ---- enter your target location for scans before the ':' character -----
      - ./scans:/app/data/output
      - ./config:/app/config
      - /var/run/dbus:/var/run/dbus

    ports:
      - 8090:8080
    restart: unless-stopped

**Server:**
 - OS: Debian 11
 - Docker version 20.10.5+dfsg1, build 55c4c88

@GrumpyRobsel
Copy link
Contributor

I have the same problem with my Canon Pixma MG5550 and docker.
After adding bjnp://<scanner-ip> manually to the /etc/sane.d/pixma.conf inside the container it worked for me:
echo "bjnp://<scanner-ip>" >> /etc/sane.d/pixma.conf

Maybe there could be a way to add Canon PIXMA scanners using an extra environment variable like SANED_NET_HOSTS or AIRSCAN_DEVICES.

@Krytten
Copy link

Krytten commented May 7, 2023

Can confirm that this is also needed on my 'Canon Pixma MP620' connected via wifi. It will not find it automatically inside docker without modifying '/etc/sane.d/pixma.conf' like previously mentioned.

@sbs20
Copy link
Owner

sbs20 commented May 7, 2023

I've merged the fix from @Scowl13 into master. I'm not doing a proper release just yet, but there should be a docker nightly available tomorrow for scanservjs:staging.

Hopefully this should help everyone. If it looks good I'll see if I can get another release done soonish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants