computerthoughts

Did you ever take that test yourself?

Adding a new FTDI USB device to gentoo that it does not know about

October 22, 2025 — number9

I like model trains, although I have very few, and no real railroad layout (just break out an oval at Christmas and put it under the tree and stare at a diesel loco and three cars). After much reading, a JMRI controller seemed the best option, and an SPROG IIv3 was purchased. On my PC I use gentoo, and for some reason, the built in ftdi driver has the SPROG, but not the SPROG II (btw, that took a lot longer to figure out than just typing it out there. As in, lsub looked ok, kernel saw the device, but was not creating /dev/ttyUSB0, etc). At any rate, the fix is the following:

lsusb (or use lsub -v or dmesg after unplug/plug) and get the vendorID and productID.

vim /usr/src/linux/drivers/usb/serial/ftdi_sio_ids.h

search for SPROG, it should say:

#define FTDI_SPROG_II           0xF0C8

But you want to insert this under that line:

#define FTDI_SPROG_IIv4_PID       0xF91C

Where 0xF91C is your Product ID

After that, we need to edit this file:

vim /usr/src/linux/drivers/usb/serial/ftdi_sio.c

Again, search for SPROG, you should see:

{ USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },

Under that line, insert:

{ USB_DEVICE(FTDI_VID, FTDI_SPROG_IIv4_PID) }

Now you should just have to do (depends on your exact install or if you use genkernel, but if you are old school like me you do it the real-man way):

cd /usr/src/linux

make && make modules_install

make install

reboot

Now when you reboot there is one last item, we need to tell ftdi driver that it is there: Let us pretend your venderID is 01a1 and your productid is 02b2:

echo 01a1 02b2 >> /sys/bus/usb-serial/drivers/ftdi_sio/new_id

Now when you unplug / insert your device, dmesg and or tail /var/log/messages should see it and create /dev/ttyUSB0.

Tags: gentoo, linux, USB, railroad, hotrains