• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB Enumareted Device List
#1
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.
  Reply
#2
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)

  Reply
#3
(October-22nd-2019, 11:54 AM)Armin@netPI Wrote: 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

Any option on web interface to see dmesg log or enumerated device list as a feature in the future?

I managed to open serial port through command line but still have problem accessing through python.
  Reply
#4
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)

  Reply
#5
(October-22nd-2019, 12:10 PM)Armin@netPI Wrote: 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
I mapped /dev/ttyACM0 as /dev/ttyS0. It was same as your suggestion. Luckily your yocto build and raspbian uses same driver.

I checked image file and found out pi isn't added to dialout group and mounted /dev/ttyS0 didn't have other users access.

After adding pi to dialout group i also changed permissions of /dev/ttyS0 to 666 then everything started working.

But not able to see enumareted device is still big question mark for me to continue.
  Reply
#6
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)

  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  netPI core as serial device server MGharat 1 2,647 June-16th-2021, 07:55 AM
Last Post: Armin@netPI
  USB Device not plugged in during boot rlahnsteiner 3 3,942 May-31st-2021, 04:50 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)