Date: Sun, 31 May 2020 15:44:02 -0600 From: Gary Aitken <freebsd@dreamchaser.org> To: Tomasz CEDRO <tomek@cedro.info>, Hans Petter Selasky <hps@selasky.org> Cc: "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org> Subject: Re: arduino usb/com port issue Message-ID: <43628ef3-fc10-4bd8-4314-04a84a956d62@dreamchaser.org> In-Reply-To: <CAM8r67Cx9DJ8EHGYmWiZVG_UOBdeyzJWdNKfxz-z_2pzbaAbmA@mail.gmail.com> References: <59da59d9-f0f0-0b30-f112-1c0af5f5399f@dreamchaser.org> <e17b8319-69c1-de73-678e-b7c9572da927@selasky.org> <CAM8r67Cx9DJ8EHGYmWiZVG_UOBdeyzJWdNKfxz-z_2pzbaAbmA@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
Hello Tomasz and Petter, Thank you for your replies. Still working on this: >>> I installed the arduino package on an 11.3-RELEASE system. When >>> it comes up, the Tools/Serial Port menu item is greyed out, >>> apparently because it doesn't know USB ports serve as com ports, >>> or for some reason it can't find them. Is this something I need >>> to configure somehow? Is this something that should be filed as >>> a bug? ... >> Did you check the permissions on /dev/usb/XXX ? These are all set to crw------- I tried changing all to crw-rw-rw- but still no arduino success >> And output from usbconfig # usbconfig -d ugen6.2 dump_device_desc ugen6.2: <Arduino www.arduino.cc product 0x0043> at usbus6, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0110 bDeviceClass = 0x0002 <Communication device> bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0008 idVendor = 0x2341 idProduct = 0x0043 bcdDevice = 0x0001 iManufacturer = 0x0001 <Arduino (www.arduino.cc)> iProduct = 0x0002 <retrieving string failed> iSerialNumber = 0x00dc <75833353934351E05231> bNumConfigurations = 0x0001 ... > As HPS noted in the first place check if you have valid permissions > that allow you to read/write from/to usb device. I did a hint at the > OpenOCD port: > > /usr/ports/devel/openocd/pkg-message > > To allow an ordinary user to acces any of the the hotplug USB > interface add him/her to the operator group (pw groupmod operator -m > username), then setup the devfs subsystem by adding these lines to > the following files: > > ***/etc/devfs.rules: [localrules=10] add path 'ugen*' mode 0660 group > operator add path 'usb/*' mode 0660 group operator add path 'usb' > mode 0770 group operator > > ***/etc/rc.conf: devfs_system_ruleset="localrules" $ cat /etc/rc.conf | grep devfs # allow local rules as specified in /etc/devfs.rules (5) devfs_system_ruleset="localrules" $ cat /etc/devfs.rules # Allow operator group to mount USB devices [localrules=5] add path 'da*' mode 0660 group operator # for arduino hotplug USB add path 'ugen*' mode 0660 group operator add path 'usb/*' mode 0660 group operator add path 'usb' mode 0770 group operator Do I need to restart after changing devfs.rules? That would be a bit painful at the moment; already works for devices like camera and usb sticks but they are da* devices. > I use MINICOM as the Terminal emulator. Type Ctrl+A then Z for > command menu. Note that you will have to create a configuration for a > given port in the first place (as root type `minicom -s /dev/cuaU0` > set valid port name and parameters then save as the default > configuration for that port). I don't understand the need for MINICOM. I currently use xterm. Will that work for the print output? > I did not use that particular Arduino utility, but there may be a > chance that it was written for Linux and it may suggest port name > like /dev/ttyUSB0 instead /dev/cuaU0 as it is used in FreeBSD. The "Serial Port" menu item is greyed out, as if it found none. When I plug in the arduino, there are 7 new entries in /dev: $ diff dev_noarduino.txt dev_arduino.txt 29a30,32 > cuaU0 > cuaU0.init > cuaU0.lock 81a85,87 > ttyU0 > ttyU0.init > ttyU0.lock 106a113 > ugen6.2 > In general on FreeBSD COM port over USB (aka Virtual-COM-Port) is > handled by `ucom` kernel module (type `kldstat` to list loaded > kernel modules), also it may use `umodem` or even `u3g` module. Those > modules are loaded by `devd` system daemon based on USB descriptors > when you plug a device. I just found a bug in pyOCD (Python module > for ARM CPU debug) that prevents running GDB Server when `ucom` > module is loaded for the VCP port on that board. pyOCD tries to > unload the kernel module by default to gain access to the VCP using > LibUSB but it lacks permissions to do so and the whole program stops > with an exception. In that case simply unload selected modules and > `service devd stop` for the time of testing. This may be also the > case for you: 1. You lack permissions to access a resource so > temporary try run as root and see if that works. 2. You may require > some component that is already taken by other service/application. $ kldstat Id Refs Address Size Name 1 13 0xffffffff80200000 206c860 kernel 2 1 0xffffffff8226e000 15cf0 fuse.ko 3 1 0xffffffff82421000 2408 ums.ko 4 1 0xffffffff82424000 76cc tmpfs.ko 5 1 0xffffffff8242c000 1bc0 umodem.ko 6 1 0xffffffff8242e000 3c58 ucom.ko I don't think I can run arduino as root as I can't connect to X as root; do I need to reboot for the /etc/devfs.rules to take effect? (will have to do some cleanup before trying that) Thanks, Garyhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43628ef3-fc10-4bd8-4314-04a84a956d62>
