Projector control
I am installing a permanent evening-time projection piece that need to be completely autonomous: needs to come on at sunset (ie. variable) & go off at midnight. Am trying to find the right solution for switching on and off the projector. It's a question of sending simple command codes (C00: projector on; C01: projector off) via RS232 (but operating from a Mac, so via usb/RS232 adapter?) following to a year round schedule (I have a patch that does this, but for a DMX system). Has anyone any experience of doing this using Max?
I was looking at this and it seems it should be as simple as connecting with an adapter and using the serial object with the right port, haven't tried it yet though. Possibly more fun using a microcontroller with a light sensor?
Have just ordered some USB to RS232 adapters, will let you know how I get on!
Thanks Luke!
Look forward to hearing how you get on. I usually muddle through and find a solution, but I don't want to buy the projector (big beast: Sanyo XF1000) until I'm sure it will work for me.
Will keep you posted, for reference I am using 'Projection Design' kit which can receive ASCII commands over RS232 or indeed over LAN. For example, to turn one on:
:POWR1’CR’
And I have ordered this adapter:
Just got the adapter and rigged up a quick patch and it seems to work fine!
Luke
Wow! I completely zapped your last reply with the patch! I thought the thread had gone dead and I have been following up another solution. I have just opened the maxpatch. I am getting a message in the maxwindow which says 'no such object'for 'toascii.
Will have a look, see if I can find it.
`Thanks so much for looking into this. Not too late for me as it happens.
Its part of the Jasch object library:
http://www.maxobjects.com/?v=objects&id_objet=2973&requested=toascii&operateur=AND&id_plateforme=0&id_format=0
Got my projector control system going great now, but don't send too many messages through too fast or it seems to crap out the serial port or something.
Thanks again Luke.
I've installed 'toascii' and am building a patch to run the installation.
Two quick questions:
1. Will any USB to Serial adaptor do?
2. Any way I test the patch before I hook up the projector (I don't have it here where I'm building the patch)?
3. Someone told me it's a good idea to send the code to the projector several times (to be sure, to be sure). What do you think?
Again my thanks & kicking myself I didn't keep my eye on this thread!
I am going this morning to buy a usb I'm sending 'set C00' to your text editor
I don't have the projector with me here (it's alreada
Sorry Luke, that was three questions! (plus some unfinished gobbledeegook i forgot to delete.
Hi,
I just had an installation a week ago with rs232, dmx and midi.
And I had the problem that while testing serial communication, my mac freezes after a couple of minutes (between 10-15).
I was using different USB to serial adapters but no change.
At the end I used a PC with USB to serial adapter and windows XP on to run the patch. And it works perfect.
Take a look on this topic
https://cycling74.com/forums/freezingperipheral-problems-with-serial-communication-arduino
Its about Arduino but I think it is a OSX problem.
Edit: If your projector supports this and you would like to stay on a mac I would turn it on/off via LAN
I assumed this was an efficiency limitation of RS232 resulting in buffer overflows. I have no problems when sending individual button press type commands triggered by an OSC controller, but if I try to use a fader to control a parameter then things go wrong because the messages come through too fast. I haven't had problems with Arduino serial and OSX either, but then I haven't particularly had to send lots of messages in quick succession. Maybe this is a OSX limitation if it doesn't happen on XP?
@Knud
1. I would have thought any adapter that mentions RS232 would be alright, should be fairly inexpensive
2. Once you have the adapter plugged in you should stop getting the 'serial port not available' error message
3. Probably a good idea, there are occasions when things don't get through. There is a pretty basic communication going on here after all!
This method should be fine for just turning a projector on and off.
Thanks Luke
Patch built and everything seems to work fine!
Flying over to Ireland tonight to install & will add a final post to let you all know how it works.
Thanks again!
For anyone who is interested here is my final patch. I haven't yet tested it on the Sanyo XF1000 because the museum has been closed over the Christmas period, and I don't have any big beasts like that lying around here!
Would really appreciate it if anyone could have a look over it (Luke!) and see if I've everything in the right place. Not being a programmer, am a little fuzzy (or a big fuzzy if you prefer) regarding the exact line I need to send. The XF1000 manual says "C00"[CR] for power on, and "C01"[CR]. Is that all I need the patch to type in?
Luke, I don't understand what the 'sprintf' object is, and I've left it out for the moment. Do I need it for some reason?
Thanks for all your help
Knud
Another question:
A programmer friend (unfamiliar with max) suggested there is usually some sort of initiation signal to open a serial port followed by the command sequence. Is that taken care of by the serial object?
Don't worry about the sprintf, that was just for messages with changing values like brightness.
You don't really need all the ascii conversion stuff if you are only sending on and off messages, you can just send the ascii code from a message box. I've included a patch that simplifies this somewhat, I'm sure yours will work fine, but it seemed a little convoluted and there are lots of delays and onebangs that I wasn't sure what they were doing.
Some simple devices like module boards might need a certain message to put them into serial communication mode, but I would expect this not to be the case with your projector (certainly isn't with mine) and the documentation for your projector's communication protocol would certainly mention it if there was.
Good luck!
Wow! That is good: You managed to reduce my patch to about a quarter the size!
It looks lovely. From my lowly altitude on the learning curve, can't quite figure out the coll object (where is the data stored?). But it seems to work fine. Thanks for that. Very much.
No mention of any initiation in the XF1000 documentation, though there is a specification for the serial protocol:
Baud rate : 9600 / 19200 bps
Parity check : none
Stop bit : 1
Flow control : none
Data bit : 8
The serial object seems to allow control of those properties (except flow control, but as there is 'none'…)
Anyway I've added those properties to your patch. Do you think it's neccessary?
Thanks again
Denis
If you look in the reference file for [serial] you will see that the default baud rate is 4800 so you will need to change that, but everything else should be fine.
If you lock the patch and double click on the [coll] you will see and can edit the data I have put inside it, check the help file for a proper run down of its workings, you can tick an attribute to save the data with the patch or save a named text file separately.
Thanks for that Luke. I reckon it's ready to go. Just have to try it out on the XF1000 (next week). Many thanks again.
As usual, another question:
The Sanyo XF1000 manual specifies, with beautiful Japanese inscrutability, that "Dedicated serial cables that come with a projector must be used for the connection to a computer and the projector" followed by a diagram. Is this just a standard 9 pin serial cable , or do I need to get a cable made up?
Sorry if this is a silly question.
Hmm, I don't know enough about this to give you solid advice, but it seems to suggest that you might need an adapter or cable to cross the wires, I think this is what a 'null modem' or 'crossover cable' does? Anyone?
My projector manual seems to say there is no crossover required so I think I may have just been lucky with my set up!
"Connect the projector and host using a standard serial cable with 9-pin female to the host, and 9-pin male to the projector. Pin 2 connects to pin 2, pin 3 connects to pin 3 and pin 5 connects to pin 5."
Had a chat with an engineer who did her thesis on serial communication (my sister in law in fact!). Seems that the cable required is - as you figured Luke - a null modem, which is for computer to computer and female/female. The crossing is so that the TxD (transmits data) is connected RxD (receives data) on the other computer. So that's it I think (though I wouldn't bet on it). If so I want to thank you all for your help. Luke especially. Knud