gmenounos / kw1281test

VW KW1281 Protocol Test Tool
MIT License
111 stars 14 forks source link

Replace proprietary FTDI drivers with libFTDI (FOSS) #36

Open mvglasow opened 1 year ago

mvglasow commented 1 year ago

Due to constraints of the serial API on Linux, direct access to the serial chip is needed. This is currently done by using the official driver from FTDI. However, that driver is proprietary, which is not so nice.

There is a FOSS replacement for it, called libFTDI, which is also available as a package on Ubuntu. MacOS is also supported (not sure if it can be installed through brew – the project itself does not supply binaries).

It is not a 100% drop-in replacement, as library file names and also function names differ. I haven’t looked into the details of the APIs – if they are functionally equivalent and it is just function names (and maybe order of some struct members) that differ, maybe it would be possible to switch to that library. Upside is that it’s FOSS, and installation on Linux (at least on Ubuntu and probably also on a bunch of other distributions) is simple.

gmenounos commented 1 year ago

Given that the existing closed source FTDI driver works, I can't make it a priority to add support for libFTDI, but I can probably do that at some point. Since kw1281test already supports multiple serial drivers, it shouldn't be terribly difficult to add another one. I think it would be more even more useful if there were an open source CH340 driver for Linux that supported precise timing of the break signal, which is needed for the 5-baud module wakeup protocol. That would allow CH340 cables, which are more common than FTDI cables, to work under Linux.

mvglasow commented 1 year ago

Actually, solving #35 would make this even less of an issue, even if the timing works just on Linux but not on MacOS. For those who run a closed-source OS, an additional closed-source driver should not be too much of an issue.