Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

looking for a simple relay controller

Discuss graphics hardware, computer hardware, and input/output devices to use with TouchDesigner

looking for a simple relay controller

Postby cod65 » Sat Dec 01, 2018 6:57 pm

wish to trigger camera shutters that have a simple open/close circuit jack input . Im thinking an USB based relay that can be controlled via Touch. Python ? serial? wired ? wireless ? What is relatively painless and inexpensive that you have used ? Arduino with a shield I guess, was hoping for something simpler.
<.o'>
cod65
 
Posts: 555
Joined: Mon May 10, 2010 2:55 pm

Re: looking for a simple relay controller

Postby nettoyeur » Sat Dec 01, 2018 7:17 pm

If you google for 'usb relay module python' you'll find several which can be controlled from python over usb for <30 dollars.

For instance here are a few which seem to come with python example code
https://denkovi.com/usb-relay-boards
Idzard Kwadijk | freelance TouchDesigner consultant | IdzArd.com
Checkout ChopChopChop.org - the TouchDesigner marketplace!
nettoyeur
 
Posts: 1103
Joined: Mon Oct 15, 2012 12:00 pm
Location: Amsterdam, The Netherlands

Re: looking for a simple relay controller

Postby carloalan » Sun Dec 02, 2018 7:29 am

The simplest way to go in my opinion is an IP power switch. You give it a fixed ip address and with some simple udp string you can switch it off an on. Out of the box, no additional wiring etc needed. I guess the cheapest ones you'll find are around 20-30€.
carloalan
 
Posts: 12
Joined: Wed Jul 27, 2011 1:10 pm

Re: looking for a simple relay controller

Postby doctorhandshake » Sun Dec 02, 2018 10:35 am

Check out Phidgets!
https://www.phidgets.com/

I’ve used their relay board before in the context of a pure python installation. Worked great.
Noah Norman
http://hardwork.party

codename: massapequa
User avatar
doctorhandshake
 
Posts: 132
Joined: Wed Aug 17, 2011 6:31 pm
Location: Brooklyn, NY

Re: looking for a simple relay controller

Postby doctorhandshake » Mon Dec 03, 2018 9:12 am

To be more specific, check out:

https://www.phidgets.com/?tier=3&catid= ... rodid=1020
4 SPDT relays 210W for DC or 1750VA for AC, they have one with 8 relays on board as well. Controlled from a simple API in C, C#, Java, JS, Python, Max/MSP, Obj-C, .NET, and Swift
Noah Norman
http://hardwork.party

codename: massapequa
User avatar
doctorhandshake
 
Posts: 132
Joined: Wed Aug 17, 2011 6:31 pm
Location: Brooklyn, NY

Re: looking for a simple relay controller

Postby cod65 » Wed Dec 05, 2018 11:24 pm

thanks everyone.
<.o'>
cod65
 
Posts: 555
Joined: Mon May 10, 2010 2:55 pm

Re: looking for a simple relay controller

Postby cod65 » Thu Jan 24, 2019 11:28 pm

hi drhandshake,
Are you saying 'pure python' as in you have only used outside of Touch?
We got the Phidget relay here you pointed to. I've managed to get it working in a 3.5.1 Idle environment and am now trying to weed through the one example script I found relevant to the relay (Digital_output.py).
it would be great if somebody has actually got this to work in Touch and slimmed down the example script to just the essentials it takes to actually control the relay in Touch.

If you used within Touch, was this 088 or 099? what version of Python ?
regards,
c.o'd
<.o'>
cod65
 
Posts: 555
Joined: Mon May 10, 2010 2:55 pm

Re: looking for a simple relay controller

Postby doctorhandshake » Fri Jan 25, 2019 11:38 am

Hey yeah I meant the project I did with that relay was a python-only application ...

I think probably the easiest way to deal with a device like that is to run the relay handling stuff in a standalone (python, javascript, whatever) process and communicate with it from TD over sockets or whatever suits you.
Noah Norman
http://hardwork.party

codename: massapequa
User avatar
doctorhandshake
 
Posts: 132
Joined: Wed Aug 17, 2011 6:31 pm
Location: Brooklyn, NY

Re: looking for a simple relay controller

Postby matthewwachter » Fri Jan 25, 2019 5:06 pm

We use the Phidget Python module directly inside TouchDesigner and haven't seen any issues. Relays a pretty easy to interface with as you are just setting values

The challenging part is using the devices that allow you to set a callback. They run on a separate thread and TD will complain or crash if you reference any TD objects. Best solution I've found is to open a socket to a tcpip dat from within the callback and send the callback args back via a json dict.
matthewwachter
 
Posts: 286
Joined: Fri Jul 08, 2011 3:18 pm
Location: Los Angeles

Re: looking for a simple relay controller

Postby doctorhandshake » Fri Jan 25, 2019 5:26 pm

Yes - to clarify - the callback stuff is the use case I was recommending a separate thread for. IIRC the Phidgets handler keeps a connection open to the device and sends an ack when coms are established so if you don't want to keep re-opening that for every change you could run that in a standalone context and communicate to it from your main TD process.
Noah Norman
http://hardwork.party

codename: massapequa
User avatar
doctorhandshake
 
Posts: 132
Joined: Wed Aug 17, 2011 6:31 pm
Location: Brooklyn, NY

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 2 guests