I have a rf-reader with ftdio usb to serial chip. I was able to write a program to control it using ftdi d2xx library. So far so good.
The issue is that when the reader is reconnected to the PC I have to remove ftdi_sio and usbserial mods using this command:
sudo rmmod ftdi_sio
sudo rmmod usbserial
I can't use ftdi d2xx library to connect to the reader if I don't run the code.
I want to be able to add a udev rule so whenever the reader is connected kernel unload the ftdi_sio and usbserial (or not load them in first place)
I've added a new udev rul to /etc/udev/rules.d with name 99-ftdi-sio.rule
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", RUN+="/bin/sh -c 'rmmod ftdi_sio && rmmod usbserial'"
but it's not working. Anyone has any ideas how to solve this issue?
99-ftdi-sio.rule
, then tried reloading rules withsudo udevadm control --reload-rules
then connected the device again,lsmod | grep ftdi
still shows ftdi_sio and usbserial mods loaded. – Dialect