October-22nd-2019, 11:52 AM
Hi ,
Is there anyway to see enumareted USB devices on host side? I'm trying to connect our board through USB connection which uses CDC class. Docker image is netpi-netx-programming-examples. I tried to map /dev/ttyACM0 but I'm not so sure is it true name or not.
Any suggestions or ideas for how to access USB devices through docker containers?
Thanks.
October-22nd-2019, 11:54 AM
Hi there,
since on netPI there is a restricted Docker running that does not automatically map ALL host devices /dev/... into the container automatically, the only chance you have is to plug in your device in a standard raspberry pi and see which /dev/ it was mapped to. This will be the very same then as on netPI
Thx
Armin
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)
October-22nd-2019, 12:10 PM
Well, a device "/dev/..." in a container is as good as if you would access it on a native host. This is all managed by Docker automatically and is not related to netPI or its hardware.
The very same applies for any software that runs in a container. Python runs the same as on a native host.
These three restrictions we have on netPI
* privileged mode is not automatically adding all host devices /dev/ to a container
* volume bind mounts to rootfs is not supported
* the devices /dev,/dev/mem,/dev/sd*,/dev/dm*,/dev/mapper,/dev/mmcblk* cannot be added to a container
Others are not know by me or my team.
So to which device was your CDC device finally mapped to? How did you find it?
You say you have a problem with python. Which problem do you have?
Thx
Armin
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)
October-22nd-2019, 12:57 PM
Well the security restrictions of netPI are clear with the special Docker ... independent of what a user would do in a container or configure "nonsense" things in the Docker Web GUI ... in no way he would get it managed to access to any file of the host Linux. This is different with standard Docker under Raspbian for example. There you can easily volume bind a host folder into a container and "destroy it.
But it is as usual ... security against freedom. One death you have to die. We decided for security and hence you need exaclty to know which /dev/ device is present and needs to be mapped. We had similar discussions like this one under
https://forum.hilscher.com/Thread-Static...SB-devices.
But anybody using netPI is free to use his very own SD card with his image and put aside the default SD card. You could easily take a Raspbian image and run it, install Docker additionally and use containers in "privileged" mode and you have all devices mapped always as you need it.
Thx
Armin
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)