libftdi Archives

Subject: Re: ftdi_usb_open*() functions now require root access?

From: Nathael Pajani <nathael.pajani@xxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 13 Sep 2019 09:08:43 +0200
Hi !

Paul : if your user is not already a member of the group plugdev (the command 
"groups"
will tell you), then :
 "adduser paul plugdev" as root (replace "paul" by your username).
and then logout and login back (groups are updated only when you login)

Have fun :)


On 13/09/2019 01:39, E.S. Rosenberg wrote:
> Hi Paul,
> You just need to be a member of the right group and/or set permissions right 
> in udev rules
> afaik.
> HTH,
> Eli
> 
> For instance:
> ~$ cat /etc/udev/rules.d/99-ftdi-usb.rules
> SUBSYSTEM=="usb",ACTION=="add",ATTRS{idVendor}=="0e50",MODE="0666"
> 
> Op vr 13 sep. 2019 om 00:49 schreef Paul E Ourada <paul@xxxxxxxxxxxxxxxxxxx
> <mailto:paul@xxxxxxxxxxxxxxxxxxx>>:
> 
>     Some of you may recognize me from earlier posts. 
> 
>     I am working on an RPi3 B+ system running the most recent Raspbian Buster 
> which has
>     been updated. Results of uname -a:
> 
>         Linux tse09b 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 
> armv7l GNU/Linux
> 
> 
>     The target FTDI devices are on a custom board on which there are four 
> FT4232H/Q
>     devices. Two are used for normal serial I/O such as rs232, 422, 485, and 
> the others
>     are used mostly for GPIO. The FTDI devices are hardwired to a Microchip 
> USB hub, which
>     is then connected to the RPi3 via cable. We keep track of which FTDI does 
> what
>     function by programming a FLASH eeprom. The /dev/ttyUSB* devices are all 
> set up using
>     udev rules, and everything seems to be playing nicely there wrt to group 
> and
>     permissions. All 16 interfaces get assigned to a /dev/ttyUSBx device via 
> the kernel
>     and the ftdi_sio driver, mode 664 and group plugdev. When I run minicom on
>     /dev/ttyUSB[0-9]*, it runs fine. All of this part of the system seems to 
> be copacetic.
> 
>     The issue is that I cannot open the FTDI devices used for GPIO via the 
> methods that
>     use a device handle or a description (ftdi_usb_open*() ) unless I elevate 
> permissions
>     to sudo/root.
> 
>     To troubleshoot, I pulled the latest libftdi1 sources down, and built 
> directly on the
>     RPi3. Since I'm using the FT4232, I modified the product code to 0x6011. 
> Then I used
>     the example programs to see how they compared to my custom programs. They 
> fared no
>     better. I attempted to use the bitbang example, and I get an error like 
> this:
> 
>         $./bitbang
> 
>         unable to open ftdi device: -4 (usb_open() failed)
> 
> 
>     But when I run bitbang with sudo, it runs just fine.  Other example 
> programs have the
>     same issue.
> 
>         $sudo ./bitbang
>         ftdi open succeeded: 0
>         enabling bitbang mode
>         turning everything on
>         turning everything off
>         fe fd fb f7 ef df bf 7f
>         fe fd fb f7 ef df bf 7f
>         fe fd fb f7 ef df bf 7f
>         fe fd fb f7 ef df bf 7f
>         disabling bitbang mode
> 
>     Previously, I had been running on an RPi2 B+ system with Raspbian Jessie. 
> I had no
>     issues needing root access on this system. I used libftdi1-1.4 on both 
> systems.
> 
>     Was there some change in udev or the kernel that messes w/the usb device 
> permissions?
>     I looked through the git log and saw that there is a new
>     AUTO_DETACH_REATACH_SIO_MODULE enum and this gets initialized in the 
> ftdi_init()
>     function, just like the old AUTO_DETACH_SIO_MODULE.
> 
>     Thanks in Advance,
> 
>     Paul E Ourada
> 
>     Principal/Owner
> 
>     BluSkai Systems, LLC
> 
>     paul@xxxxxxxxxxxxxxxxxxx <mailto:paul@xxxxxxxxxxxxxxxxxxx>
> 
>     (m) 303-396-2872
> 
> 
>     
> ------------------------------------------------------------------------------------------
> 
>     *libftdi* - see http://www.intra2net.com/en/developer/libftdi for details.
>     To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
>     <mailto:libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx>
> 
> 
> 
> ------------------------------------------------------------------------------------------
> 
> *libftdi* - see http://www.intra2net.com/en/developer/libftdi for details.
> To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
> <mailto:libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx>
> 
> 


-- 
Nathaël PAJANI - ED3L - Techno-Innov
Internet : http://www.ed3l.fr - http://www.techno-innov.fr

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread