USB Controlled relay

Posted on
Thu Dec 16, 2021 11:32 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

USB Controlled relay

I need a very simple relay to operate a wired electric door latch. The connection to the door is available at the Indigo server location. So, all I need is a very basic relay. This one was low priced and looked like it would do the job. https://www.amazon.com/dp/B01CN7E0RQ

I can probably create a simple virtual device with a couple of shell scripts. But, I was wondering if anyone here had any experience with this or some similar product.

TIA

Posted on
Thu Dec 16, 2021 1:32 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: USB Controlled relay

No experience with such things, but looks interesting.

You may have already seen it, but someone added a simple Python script in the review section so it looks like Indigo integration would be straight-forward (not including the script here in case it's not the way to go with this device).

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Dec 16, 2021 5:31 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: USB Controlled relay

DaveL17 wrote:
No experience with such things, but looks interesting.
You may have already seen it, but someone added a simple Python script in the review section so it looks like Indigo integration would be straight-forward...
Thanks. Could you send me the link to that post. Not sure where the "review section" is :oops:

BTW, there sis a USB driver for the Mac as well as some VERY rudimentary software support at https://download948.mediafire.com/xjxqv ... S-1_EN.zip

Posted on
Thu Dec 16, 2021 5:37 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: USB Controlled relay

The reviews of the product at Amazon you linked to. :D

https://www.amazon.com/dp/B01CN7E0RQ

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Dec 16, 2021 5:39 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: USB Controlled relay

DaveL17 wrote:
The reviews of the product at Amazon you linked to. :D
https://www.amazon.com/dp/B01CN7E0RQ
Doh. I figured you meant in the Indigo forums.

Posted on
Thu Dec 16, 2021 5:58 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: USB Controlled relay

DaveL17 wrote:
The reviews of the product at Amazon you linked to. :D
https://www.amazon.com/dp/B01CN7E0RQ

I missed it on the first pass. I just needed to search the reviews for Python. So, it would be pretty easy to just pass an arg on the command line for on or off. Or, a similar shell script calling nc (netcat), or even
Code: Select all
echo -n -e '\xA0\x01\x00\xA1' > /dev/ttyUSBfoo #on
echo -n -e '\xA0\x01\x01\xA2' > /dev/ttyUSBfoo #off
Too bad there does not seem to be a status command. In any case, I have ordered one and will report back as to how it works.

EDIT: There is a status query: FF :D

Posted on
Tue Dec 21, 2021 11:51 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: USB Controlled relay

Ok. I received the relay and it works. Though, it has limitations, although you can supposedly get a status from it, attempts to read from it return nothing. Other than that, it is really perfect for my application, releasing a door lock.
Code: Select all
import serial
import time

ser = serial.Serial('/dev/cu.wchusbserialfd130', 9600)
ser.write(serial.to_bytes([0xA0, 0x01, 0x01, 0xA2]))
time.sleep(5.0)
ser.write(serial.to_bytes([0xA0, 0x01, 0x00, 0xA1]))

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest