KMTronic USB One Relay Linux test script



KMTronic USB One Relay Linux test script




Download test script from:

          (Thanks to Karl for this script)



Create folder and extract these 4 files :

        You will need to mark it as executable with this command 

        chmod + x *.* 

        1.   -      This script will set the speed to 9600

        2.       -      This script will switch "ON" the relay

        3.       -      This script will switch "OFF" the relay

        4. -      This script will read the status of the relay       




The script “usbrelaystatus”  gets the status of the relay (on/off) and there are places to insert code to run commands.  Hopefully included comments explain things (I left the echo’s and comments in that I used while I wrote/tested the script).  Let me know if you have questions.

If you do test this, I’d appreciate knowing if it worked for you or not.


I’m using OpenSUSE 12.1 – had to install libftdi1 – but it came with the OpenSUSE 12.1 install.

I never got the “.cats” program to work.

The usbrelaystatus script does not require any other programs to be installed (except for the ftdi drivers – at least on my system)

And I also discovered I have to run the usbrelayspeed script before I can send/receive data to/from the usb relay card.

Also I discovered if I include the usbrelayspeed in a cron job @reboot it doesn’t work – perhaps the @reboot executes before the usb relay card is loaded.


I am not a computer expert, so there may be a more efficient/better way to get the status of the relay – if you/someone publishes a better way I won’t feel sad.  But this works.


Hope this saves someone some time.






Read 21440 times