|
Close a serial port with Serial IOHi all, I'm developing a composition for an installation that controls a PTZ cam trough serial commands with a UC-232A cable connected. All works fine, but I would like to make it more usable for my setup. It seems, when stopping the composition the serial port isn't closed by the plugin. When restarting the composition it can't send any commands because the serial port is still in use. The only solution I came up with now is quitting QC, disconnect and reconnect the serial cable and start QC+the composition again. Does anyone know a way to close the port somehow without having to restart&replug the cable, or is it maybe possible with an update of the serialIO plugin? Thanks!
|
you might try matti's MonsteriSerialOut patch and see if it has the same issue or not, there is some discussion of it in this thread: http://kineme.net/release/SerialIO/20080326#comment-20634
the Apple example CommandLineTool or the old Kineme Shell patch or somebody's AppleScript patch might be useful for OS cleanup tasks like this?
The applescript/commandlinescript patch gave me bad results earlier when doing system tasks, check:
http://kineme.net/forum/Discussion/General/CreateNewFolder#comment-14552
I'm hoping for a more reliable solution.
I'll give the mansterii patch another try, I forgot about the single character output.
No luck with the mansteri serial patch, it seems to be sending, but i presume as a string or ASCII, and not as binary (what the VISCA protocol needs). Also the single character output would probably decrease the responsiveness I'd like to have.
Just wondering, could it be possible to update the kineme Serial IO patch with a trigger that opens/closes the serial port from the patch settings?
hmm, does the kineme serial writer have a data input port that is a numerical value, not a string? it appears as though the serial patch is now missing from the downloads section or i'd just give it a try.
It has both, a data and binary input field. I'm using the binary for this one, to send hex messages.
I'm using this version: http://kineme.net/release/SerialIO/20091206 (It's under the beta releases)
I've attached sample patch, so you can see how I use it.
my error, somehow i disabled the beta access flag in my account -- thanks for the sample composition, that nicely explains the issue though your binary data '8101046300FF' is actually hex no? maybe the kineme patch scans the input string and divines the format before converting and sending.
Yes, it's hex. The binary data input seems to be handling it fine. The sending and receiving part works well with this setup, the only thing is, is that it doesn't work anymore when running the composition for a second time. It only works when I un- and replug the usb-serial cable and quit/restart QC.
Now when I start inspecting the serialIO log from the console it says that it closes the connection the first time, but it doesn't say it opens the device the second time I try to run the composition (openDevice: using alread-opened device for /dev/tty.UC-232AC)
This is my console log:
open QC, start composition
Console:
result: serial in/output works
stop composition
Console:
start composition (2nd time)
Console:
Now the serialIO doesn't seem to work anymore.
stop composition
Console:
Now I'm wondering, is this a serialIO bug?
yeah, it might just be a defect in the Serial IO patch, though it is interesting that the device was already open when first opened (and confined on first close), but on the second open the device is not said to be open already. could something else on your system be opening the serial port? i can't say how the Serial IO patch is constructed, but generally speaking serial ports can have exclusive access holders, i wonder if that is at play here.
No other programs seem to be using the serial port. From the console log when I open the connection the first time I read that the KinemeSerialInput patch opens it first, and then the KinemeSerialIO seems to access the address '/dev/tty.UC-232AC' that openDevice passes.
Now when I stop/start the composition the same log events show up, except that 'KinemeSerialIO: openDevice: using alread-opened device for /dev/tty.UC-232AC' isn't included.
My technical knowledge is limited to know what's actually happening here, but it might be a clue?
i think you are doing everything right and this is just a defect in the SerialIO patch, it might not be fully releasing the port after opening it. if you quit the application and restart that works though?
Yeah, restarting&replugging works, but It would be nice if I didn't have to during a performance.
did you find a solution to this? do you need to send binary data or are you using hex?
The solution I'm using now is sending hex data trough the binary data port. That works like a charm but I still have to reconnect the serial cable and restart QC to be able to use my composition again if I stopped it.