-
Notifications
You must be signed in to change notification settings - Fork 136
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
SANE issues inside container #129
Comments
Hi. Just a few diagnostics questions:
|
I've got the same issue with a LiDE 400 running on Arch.
on host
on docker
|
Turns out i forgot to install and start
|
What happens if you run
On the host? |
|
Thanks for that. So we know it's something about running that command inside docker which isn't working. The bad news is it's at the outer limits of what I know about docker and Arch. I have had intermittent issues with airscan and IO errors but it usually works again with a second try. And it's presumably not a permissions problem since it can see the scanner and you're running privileged. Can you think of any other tests to find the cause? |
So I gave up on trying to passtrough USB and just set up SaneOverNetwork and it's working great now! |
Interesting - and thank you for coming back. Just so that I can try and understand (and document it) - what was the configuration you were trying? e.g. Scanner connected by USB to the host, but you were using IPP over USB to connect to the Scanner? Did it not work as a native USB connection with udev? |
sorry, had no time to report back ... unfortunately it's not working (even with privileged). Here is my compose file and some container logs. The printer is connected via usb:
|
1 similar comment
sorry, had no time to report back ... unfortunately it's not working (even with privileged). Here is my compose file and some container logs. The printer is connected via usb:
|
Can you give a short description how to set it up? |
My config was just very simply
The reason for installing ipp-usb was because the arch wiki mentioned it being required on some printers, don't know if that was the issue that fixed my first problem, but that was the last thing I did. |
That's odd. I don't understand why a USB device is being reported as I suspect that this is a matter of sharing the scanner on the host and using the network to connect from the docker container. This might help where server = host and client = docker. Although the comment above from @RafaelSchridi suggests maybe not. |
version: '3.3'
services:
scanservjs:
ports:
- '8070:8080'
environment:
- SANED_NET_HOSTS=10.0.2.100
volumes:
- 'mydir:/app/data/output'
- 'mydir2:/app/config'
container_name: scanservjs
image: sbs20/scanservjs:latest In /etc/sane.d/saned.conf add your subnets to the Access list (also had to add 172.16.0.0/12 which docker uses internally) Start & enable saned.socket and you're all good |
Airscan Is just a scanner working in driverless mode right? from the arch wiki:
|
Ahh, thank you. I've only used it to connect to a scanner wirelessly - that makes sense. The current container has its own install of sane-airscan - I wonder if that's conflicting in some way. Or perhaps something additional needs to be shared from host to container in this configuration (with USB). I don't have a way of testing this at the moment, which doesn't help. |
Honestly I'm way more conformable with my current setup with scanservjs just being a client and not having to run in privileged mode. |
Working now over network, thank you! |
Thank you! A bit off topic, but can you use the scanner from other machines? Windows or mobile devices? if so, which drivers do i need? |
Do you mean use SANE directly from Windows or Mobile? If so then you could have a look at sane-frontends - I think the options are limited. But unless I'm missing something, the point of this project is to allow sharing on the network from any web browser - can't you just use this? |
I've updated the documentation around this. And further have come to the conclusion that the docker container should focus on the app itself rather than the SANE backends. The solution outlined above (using the host as the backend and connecting over the network) is now the recommended approach. |
Has anyone managed to set AirScan up on Synology NAS? I have installed the SANE Backends package, I check the package log (which is located in
I also edited the config file (located in
In the docker-compose I also set Still, I keep getting |
Hi. It's difficult to tell what you're trying to do. But I'll take a guess. But first, in The best way to use docker is using a net backend. That means you have: The scanner (epson) <--> SANE backend (synology) <--> scanner client (SANE front end / scanservjs). Your backend can talk to your scanner, which is good. Now you need to say which clients are allowed to access your server. This will be your docker container.
Then, in your client (scanservjs) you need to point it at your synology. I don't know what the IP is of your synology but it won't be the same as your scanner. This is specified in That way, scanservjs will request a scan from the synology, which will forward the request to the epson. |
Thanks for the detailed information, this is pretty much what I thought was the overall setup. It seems like on Synology you don't have access to the to clarify:
I still get Device not found |
Sorry - I'm afraid my knowledge of how everything hangs together on a Synology is too limited. It may be worth investigating |
Ok, i'll investigate further, thanks. Still, from the official docs, I read
This seems to suggest that I should put the scanner IP here? |
Yes, the guide presupposes that the host system has saned running. |
This is where I get confused. From what I understand scanservjs => Scanner <=> NAS
If this is the case, then the scanservjs container should point (as you originally suggested) to the NAS, but the docs suggest that it should point directly to the scanner? I realize I have a lot of questions, thanks for the help so far ^^ |
You're essentially correct but I would change it to
Note that I am not a SANE expert. I am going to remove any mention of
When the docs say:
it's referring to It is possible to connect DIRECT to actual network scanners (like Scanner B) using Airscan. But docker complicates everything because it's all running at a fairly low hardware level which requires mapping all sorts of additional things. So my usual recommendation is to keep the docker part light and just use a network connection out to another SANE backend outside the container. Does that help? |
one more little tip to add here for future reference: i.e. in your compose file, make networks explicit like so:
and on your hosts saned.conf
|
Hello, I'm trying to use scanservjs with my Canon Pixma MX920 printer/scanner. On the host system,
And
I have tried with the following
I have also tried all the now commented out lines, but scanservjs is not able to find the scanner. In
and I have enabled and started saned.socket, but with no succes. What should I do? Thanks in advance. |
Previous attemptsI tried to get this working as a Docker containers inside an Unpriviledged LXC on a Proxmox Host.Approach 1I tried the approach with the network that users such as whysthatso mentioned. Inside the unpriviledged LXC:
sudo apt-get install sane-utils Step 2: Navigate to the scanner driver directory
cd "/mnt/host-data/data/software/drivers/Brother DCP-1610W/Scanner driver 64bit/" Step 3: Install the scanner driver
sudo dpkg -i brscan4-0.4.11-1.amd64.deb Step 4: Configure the scanner
sudo brsaneconfig4 -a name=Scanner model=DCP-1610W ip=192.168.30.10 Step 5: Verify the scanner
sudo scanimage -L
Modified sane.conf: 172.29.0.0/16 and added 0.0.0.0/0 just to test if I can connect to it.
Even so I was able to scan inside the unpviviledged LXC. But I wasn't able to get the docker container to connect to the on LXC, likely because it depends on The docker compose:
I suspect it doesn't work on unpriviledged LXCs for some reason but I don't know why. Approach 2As the documentation specifies in https://github.com/sbs20/scanservjs/blob/master/docs/docker.md#hosting-it-on-a-synology-nas-using-docker I tried to build the docker image inside my unpriviledged LXC but I was getting an error when running
After a while I gave up in this approach as well... Approach 3I decided to try cloning the project, master branch and to build the image, without any modifications. But I was getting this error in the container logs when running it, and also red toast notifications in the UI with this error:
I thought maybe it's some update in the latest version, so I checked out the I was hoping to build it, have it working and then afterwards add this at the end of the Dockerfile to add support for my printer.
If this worked then I hoped that At this point I just gave up completely. If anyone knows how to get this running in Docker which runs in an Unpriviledged LXC, on a Proxmox host, I'd be happy to hear about it. I refuse to install scanservjs on the LXC itself or in a VM, as I want everything possible to run as a docker (or podman) container. I managed to get it working by building it locally from the tag version: "3"
services:
scanservjs:
build:
context: ./scanservjs
args:
# ----- enter UID and GID here -----
UID: 1000
GID: 1000
target: scanservjs-user2001
container_name: scanservjs
#environment:
# ----- specify network scanners here; see above for more possibilities -----
# - SANED_NET_HOSTS="192.168.30.10"
volumes:
- /srv/compose/syncthing/syncthing/data/documents/paperless-consume:/app/data/output
- ./config:/app/config
#ports:
#- 8080:8080
restart: unless-stopped
networks:
- proxy-network
networks:
proxy-network:
external: true I modified the
|
Scanner IP: Host system:
Where I also tried setting |
I use the docker container without --privileged and direct my scanner via /dev/bus/usb into the container. It is also found in the container, but I cannot run scanimage -L. Outside the container (on my server) everything works.
docker-compose.yaml
The text was updated successfully, but these errors were encountered: