Looking for advice for a permanent installation

Hello everyone! :smiley:

I’ve been asked to do a permanent installation using openFrameworks (finally!!!). This has lead me to some interesting questions about functionality in which I would like your advice.
For starters, this installation can be either OSX or Windows and has to be there at least 3 months, working from 8:00 to 16:00 and I cannot be there all the time. Here I go with the questions:

  • Most important question How have you guys dealt with opening and closing times? (c++ code? scripting on what application?)

  • Have you guys had to turn the projector on and off somehow?

  • Have you guys had to turn the projector on and off using serial ports?

  • Did you happen to install a remote desktop client in order to control them?

  • How have you guys controlled an application when the computer is actually 20 feet over you? (bluetooth? OSC with wifi?)

  • About updating code and features, how have you dealt with that?

Other than that I welcome any advice you guys might have and any relevant personal anecdotes. I have little experience with this type of installation and making a compilation of advices would definetely help any newcomers in this forum. I’ve also not seen a thread like the one I’m proposing here so if you know one just point me to it.

Lastly, I know I’ve been away for some time but I hope you guys are all well and thank you very much! :smiley:

I don’t think is that easy to turn a projector off from within a program… what I did once was have an arduino turning things on and off… If I were in your case I would just left the computer on for 3 months… I left a very heavy video installation that handled 20 videos open for a week in a shitty pc, with no problems whatsoever, I also left many other OF programs open for very long time, the computer doesn’t care. it’s a machine. (but that’s just me)

I know you can script a mac to automatically turn on and off. But I have no idea how you can control a projector with a serial port… I mean it depends from the brand, and I don’t know… -I have no idea- if hdmi cables allow back and forth serial communication…

but with an arduino is very easy to use infrared and turn the projectors on-off. and why not , even put the computer in sleep-mode as well?

I find the idea of building an iphone/android-app that will communicate with osc from your home, very interesting and neat. but sometimes wireless networks break because the routers reset from time to time. unless you are going to use a local network but that would defeat the purpose of not going there… but maybe you can leave it there to someone as a fancy remote control or smthng.

serious (i.e. big/expensive) projectors have an RJ45 port, so you just control them via LAN. otherwise, get an usb-to-RS232 converter and switch them via that way. check with your projector’s manufacturer and/or user manual on how to do that. possibly there’s even a piece of software available.
a slightly more hackish way: even cheaper projectors sometimes have a 3.5mm audio socket on both remote control and projector. that way you string a cable between the projector (recommendation: XLR with adapters) and wherever you are, and you can control the projector without needing line-of-sight/infrared. you could find out with an oscilloscope which signal the remote control sends for power on/off, and send that with an arduino or whatever.

Thank you kkkkkkkk and bilderbuchi. Awesome ideas actually, I’m guessing they can only come from experience. :smiley:

Since I like this forum so much I’ll compile the information and success I did have this weekend. Some of you may know this already but it may be useful for the next guy.
While waiting for a response I did a little research about all this. I had used RS232 on pc using ofSerial but I had trouble running it on a mac with Mountain Lion (kext issues and such), I also read somewhere that it is impossible to send RS232 commands over ethernet because of technological differences (magnetic vs. mechanical(?)). There is more to read about it somewhere. There are drivers that only works with one very specific RS232 which is this one Prolific PL2303HX Chipset:
I happened to have an HL2303, there are open source drivers but they didn’t work on my setup.

kkkkkkkk’s idea of arduino with IR seemed like the best idea but would add clutter and I left that as a last resort.

As bilderbuchi mentions, serious projectors have an RJ45 port so I wanted to try that since I have one of those projectors now. The original software is awful and made in a flash application that might have been made by geocities in the late 90s. There is very little automation to be made there but there is one important fact, it uses PJLink standard.

PJLink™ compatible

I knew nothing about it. I searched for stuff in the forum and found this old thread:
The commands in the addon DO WORK, you just have to set it to the correct projector ip or otherwise the application seems to crash. I also had to comment the following part of the code since it wouldn’t let me compile in Mountain Lion OSX with openF 0071:

void sendPJLinkCommand(string command){  

The addon only lets me turn the projector on and off (remember to let it cool down for some time before asking it to turn on again). I wanted more and I finally found the especifications for PJ Link that give me a lot more functionality, similar to RS232 commands and IR remote control.
That website also has some downloadable programs. There is also an iPhone App in the AppStore but in my case the port configuration doesn’t match the one for my projector. I have no idea if this is was intentional or an error in following the specifications.

The standard also allows you to ask the projector about the status of the lamp, overheating and (not sure) hours left. The openF application could read this and report it on the aplication.
While I have not implemented an application that can ask the projector if it is turned on, I decided to ask the projector to turn once per minute at the startup times, I did the same when turning it off. I do not know if this is helpfull or not, it may be overkill. Any thoughts?

Some time ago we installed a VNC software to control the computer and add images or disable stuff on the remote application, it worked just fine as long as there was an internet.

That is about as much as I have but I would like to know if anybody has any more comments and advice.

That sounds like great results!
If you end up implementing the whole PJLink specification, be sure to fork the existing addon and improve/expand it. This could be really useful to OFers everywhere - the list of PJLink supported devices is pretty impressive.

edit: As far as I could see, PJLink also returns status messages, so it’s probably better to implement returning the status value of the switch-on command, and act accordingly, instead of just telling it to switch on repeatedly - in the end you don’t know if it really switched on (e.g. what if the lamp burned out during power-on).
You could then even query for the nature of the error (see ERST query in the spec pdf), and send an email to the appropriate person to e.g. please replace the bulb.

Hey @irregular,

Your projector research sounds good! Most of the stuff we’ve done has used an external show control system (Crestron or similar) to control outputs (TVs, Projectors, etc), which is total overkill for a one projector system.

We do, however, setup computer shut down / start up times every day to save energy, start fresh every day, etc. This is pretty easy to do from the default system settings in OS X (system preferences > Energy Saver > Schedule); you should also set your app to open on startup as well.

Some more tips for you… they might be obvious, but we run through these pretty much
every installation we do! Most are OS X specific:

  • Turn off energy saving + screen saver (system preferences > Energy Saver)
  • turn off software update checks (system preferences > software update; uncheck everything)
  • set desktop to black + delete any items that are on the desktop
  • remove items from dock + turn on dock hiding
  • turn bluetooth off (optional!)
  • turn off growl, Adobe updater, or any other program that might open a pop-up over your app

This one can be a little tough, but is really useful. You can load a .plist file into your system to automatically restart your app if (god forbid) it crashes for some reason. DON’T use this while you’re developing, as the app will restart every time you close it (can be really annoying).

Copy this code and save it as a .plist file (e.g. myapp.plist). Replace the line “/Applications/myApp/bin/myApp.app/Contents/MacOS/myApp” with the path to your executable (which is inside
your .app file, e.g. myApp.app == myApp.app/Contents/MacOS/myApp)

<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "[http://www.apple.com/DTDs/PropertyList-1.0.dtd">](http://www.apple.com/DTDs/PropertyList-1.0.dtd">)  
<plist version="1.0">  

Then, load this file via Terminal, by typing

launchctl load  ~/Where/you/saved/the/plist/myapp.plist  

Turn it off like this:

launchctl unload  ~/Where/you/saved/the/plist/myapp.plist  

Hope this stuff helps! Will add more stuff if + when I think of it. What do you mean when you’re talking about controlling the computer overhead via OSC? Have some tips on that as well if you can give some clarification!

I guess he means “how can you administrate a computer you can’t (easily) physically reach. is OSC good for that?”, e.g. when it’s placed overhead in the rigging somewhere.

@bilderbuchi makes sense.
@irregular Apple’s Remote Desktop is pretty great for this kind of stuff if you need to copy over apps, update system preferences, power on + off, etc. On the PC side, we use a program called Puppet, which is pretty intense… I’d recommend just doing VNC for most of the administrative stuff.

As far as updating parameters in your OF remotely, making an interface via OSC or WebSockets is pretty simple! If you use OSC, you’ll have to make another OF app that sends parameters; using ofxGui makes this really easy to go back and forth (check out ofOscParameter in ofxGui).

This is more than I ever expected. Thank you very much guys.

I have no experience making or modifying an addon but since the PJControl and PJLink is so well documented it seems like a very good place to start doing such things. I will post an update if I get it all working.

Great advice! I will try all these things out… ALL of them. :smiley:

Thanks yet again! :smiley:

robotconscience: it’s trivial, but still I want to clear it up: you mean VNC (the remote desktop protocol), not VLC (the media player), right? :slight_smile:
irregular: great! I already checked, none of the projectors I have support this protocol, so I can’t help with testing the addon, sadly. :frowning:

Thats alright. By the way, do you happen to know if there are other modes, protocols or methods available on other projectors?
I know PJControl describes PJLINK_MODE and NEC_MODE (specific for NEC projectors).

So we are left with:

  • USB to RS232 using ofSerial example, very standard and available on most projectors.Old-thread-explaining-how-to.

  • Using an arduino and an IR LED emitter following the commands from the projectors manual and with the emitter close to the projector.

  • Ethernet using a web based server available on some projectors. Some projector allow you tu use WIFI with certain same brand dongles.

  • For many projectors all with ethernet you can use a show control system (Crestron or similar)

  • Ethernet using PJLink commands, very robust but not every projector allows it.

I’m here to report some stuff.

I read the specs and everything but for some reason turning the projector on and off worked well but replied back wrong. Pages 8 and 28 mention what should happen.
The addon seems to be on the right track since it does turn the projector on and off but when this happens the application writes the “response” on the console and that response is what is wrong.
Instead of getting something like this:
You get this: [tt]PJLINK 0[/tt] which is the first response when connecting to the device (Page 28). The weird thing is that it does actually turn on the device and then seems to send back the wrong message.
Since the response is wrong I cannot ask for a Lamp status since it is part of a response to a get command but all I get are PJLINK 0.

I think I’m missing something here but I don’t really know where to start looking for the error. It could be the projector I’m using but if it is not then it would seem to me the addon works well but fails to report back the correct message, maybe even skipping it then reconnecting and getting the same “connected” message. It also seems like slugmobile (ofxPJControl poster on Github) had the same problem since the “getProjectorStatus()” just gives back a bool value that is part of the openF application and not a get command from PJLink for the projector status (which was what bilderbuchi suggested would be better).

Other than that it works great and would be very useful to anyone. The addon is really easy to use and modify but I am now stuck and don’t know what to do now. I am also very greatful for the plugin. :smiley:

this is just a shot in the dark, but maybe this while (msgRx.length() < 8) will only record the first message coming in (which is PJLINK 0), and any further messages are discarded/ignored, which is why you don’t get to see them in the console?

I think you are right. That code should make it permanent loop while waiting right? So maybe that is why it crashes when the ip is not found?

I wanted to work on this last night and I disabled parts of the code and I got to inspecting packets on OS X. The results are in the attachment. The command process is not in the correct order (as in page 28 of the specs). This was a modified code but without doing this I never got the status message.
So one connects to the projector and the computer immediately commands it to turn on, just after this the projector gives out its normal “PJLINK 0” greeting. While this is happening the console in the openF app displays two copies of this same message since it has no other. This also happens in the unmodified addon.
After the openF app has finished running void pjLink_On(), the projector sends out a %1POWR=OK status message which is what is needed to know if the projector is powering up.

So that is about as much as I know. Maybe a threading problem? I don’t know much about TCP but maybe you guys know of somebody else who can understand better what is happening here. :smiley:
Maybe I should make a more specific thread somewhere else in the forum?

Different question:
Shouldn’t an addon such as ofxPJControl be coded to use another thread? I mean, using ofThread or something. It is using ofxTCPClient (which used ofThread) for the client but not for much else.

This is an old addon that has not been updated in at least two years.