docker icon indicating copy to clipboard operation
docker copied to clipboard

any way to give access to host USB /dev/ttyUSB0

Open roboto-cloud opened this issue 7 years ago • 6 comments

someone know how handling usb printer host from docker odoo:11 container?

I get this error: docker logs odoo.dev

? odoo.addons.hw_escpos.controllers.main: Can not get printer description: [Errno 13] Access denied (insufficient permissions)

thanks in advance,

roboto-cloud avatar Nov 03 '17 15:11 roboto-cloud

Have you tried volume mounting /dev/ttyUSB0 to the container?

thomas15v avatar Nov 03 '17 22:11 thomas15v

hi @thomas15v :) yes, I have mounted it in the docker-compose.yml

    privileged: true
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - /run/udev:/run/udev:ro

roboto-cloud avatar Nov 04 '17 09:11 roboto-cloud

Does it work if you run odoo as root? (not recommended but useful for troubleshooting)

  user: root

You could also try to add "o+rw" to the device. Permissions are inherited between container and host.

thomas15v avatar Nov 06 '17 08:11 thomas15v

You can also run without --privileged, it's a bit harder: http://marc.merlins.org/perso/linux/post_2018-12-20_Getting-Around-USB3-xhci-32-Device-Limit-Max-number-of-devices-this-xHCI-host-supports-is-32.html

marcmerlin avatar Dec 22 '18 17:12 marcmerlin

Is it solved ?

d-fence avatar Apr 14 '20 13:04 d-fence

@roboto-cloud do you still have this issue? Can you close this issue if not needed?

lathama avatar Apr 10 '24 15:04 lathama