petersbingham / dae-py-relay-controller

Python code for controlling Denkovi usb relay boards.
https://denkovi.com/
14 stars 14 forks source link

Update FTD2XXDllWrap.py #3

Closed AdriaGuixa closed 6 years ago

AdriaGuixa commented 6 years ago

Upper case comparison when getting the SN ID string. Could you please update the version number?

petersbingham commented 6 years ago

Is the FTDI serial number case-insensitive?

petersbingham commented 6 years ago

OK, I see the problem now. Don't think this is the correct place for the fix though. It's a generic function and shouldn't assume that the idstring is case insensitive. I would accept if you parametrised (eg caseInsensitive) and defaulted to False. You can then add the required changes in the client code.

petersbingham commented 6 years ago

On second thoughts I'll accept this, since this file is unlikely to be used with anything else. One question first though. Take it you have seen DAE boards from their factory with serial strings with different cases?

AdriaGuixa commented 6 years ago

Hi, debugging the issue we found that the name of the serial number returned is not always the same. For example in our case idString was equal to DAE003FZ and SN returned by driver was DAE003fz and that is why we can not initialize the relay board.

petersbingham commented 6 years ago

Please can you provide more details please (sry for this but I need to be sure before changing):

The DENKOVI_ID = "DAE" in file dae_RelayBoard_Common. Curious as to why you appear to have changed this. Multiple relay boards?

Does the serial number consistently change case. I'm surprised at this behaviour.

petersbingham commented 6 years ago

Merged. Thanks for this.

AdriaGuixa commented 6 years ago

Yes @petersbingham , we want to use more than one relay boards, that's the reason we have found this "issue". Thank you again!