From Frack - Hackerspace Friesland
A project to control our space beamer over serial from within python
Our beamer has recently found a place near the ceiling, freeing up valuable deskspace and removing clutter this was a good move forward. However the controls on the beamer are now mostly out of reach, unless one dares to climb onto a chair fidle with the buttons (we have no remote).
To make sure we could control our beamer over the available din-8 / serial connection from our computers, and possibly from within code.
Beamer.py allows you to connect to the nec vt45 (and other nec's) beamer, and alter various settings.
Hot to use from the CLI
You can issue the following commands:
:~: beamer.py /dev/ttyUSB0
It will then give you the avaiable options, choosing an option without specifiying the needed arguments will trigger a listing of the help for that method allowing you to find out what to say to the beamer script.
How to use in python
The code is a module that you (once inserted into the path of your choosing) can import from within Python, It exposes one class that takes the serial device and conection speed as init arguments. After that you can call various methods to control set settings.
These settings are supported on our beamer, other nec's will do more like brightness, keystone, contrast etc.
import beamer b = beamer.Beamer('/dev/ttyUSB0') b.On() # turns the beamer on b.Source('rgb-dsub') # selects an input source, previous selected device is remembered past shutdown in the beamer b.PictureMute() # Mutes the visual output, eg, makes the screen black b.PictureMute(False) # Turns the output back on b.Off() # shuts down the beamer in an orderly fashion. (this will make the beamer not respond untill it thinks the lamp has cooled down sufficiently)