Devantech 2 Channel USB Relay

 
Info:
 
The USB relay communicates by bringing up a serial port over USB. But the vendor and product code isn't automatically recognized as a serial port by the BeagleBone.
 
To remedy this, run this command:
  •  modprobe ftdi_sio vendor=0x04d8 product=0xffee
 
The USB serial port shows up as:
  •  /dev/ttyACM0
 
The device should of course be opened as a standard serial port, 9600, N, 8, 1. But just for testing, you can try the commands below:
 
Commands:
  • Turn on both relays: echo d > /dev/ttyACM0
  • Turn on relay 1: echo e > /dev/ttyACM0
  • Turn on relay 2: echo f > /dev/ttyACM0
  • Turn off both relays: echo n > /dev/ttyACM0
  • Turn off relay 1: echo o > /dev/ttyACM0
  • Turn off relay 2: echo p > /dev/ttyACM0
Other commands:
  • 5A: Get software version - returns 2 bytes, the first being the Module ID which is 10, followed by the software version
  • 5B: Get relay states - sends a single byte back to the controller, bit high meaning the corresponding relay is powered
  • 5C Set relay states - the next single byte will set all relays states, All on = 3 (xxxxxx11) All off = 0
 
Comments