Skip to content
Library to help control your projector over a serial connection
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Aug 6, 2013
LICENSE Initial commit Aug 6, 2013
pyjector_controller add time to logs Oct 19, 2015
requirements.pip requirements: Add argparse Aug 9, 2013 Bump version to 0.2.3 Jan 12, 2017


A generic library to easily send serial commands to your projector. Install via pip: pip install pyjector.

Not sure how to use this library? Check this blog post for a more in-depth tutorial on how to set everything up.


from pyjector import Pyjector

# Look up what port your projector is connected to, using something
# like `dmesg` if you're on linux.
port = '/dev/ttyUSB0'

# The only valid device id at the moment is `benq`. This is used
# to figure out what commands are supported, and the format needed.
device_id = 'benq'

pyjector = Pyjector(port=port, device_id=device_id)

# Let's check what commands claim to be supported by our device.

# Let's check the actions associated with each command

# Turn the projector on
# We need to change the source, which are supported?
# Change the source to hdmi-2
# It's too loud!
# We're done here

# We can also interact directly with the underlying `PySerial` instance
pyjector.serial.write('some other command here')

From the command line

Want to control your projector from the command line? Use the pyjector_controller script included.

Usage: pyjector_controller [-h] [-s SERIAL] {benq} port command action

positional arguments:
  {benq}                The device you wish to control
  port                  The serial port your device is connected to
  command               The command to send to the device
  action                The action to send to the device

optional arguments:
  -h, --help            show this help message and exit
  -s SERIAL, --serial SERIAL
                        Extra PySerial config values

Example: ./pyjector_controller benq "/dev/ttyUSB0" power on to turn the projector on.

Your device isn't supported?

You should be able to easily add support for other devices using a simple json file. Check the files in pyjector/projector_configs for examples.

It should follow the template below...

    "left_surround": "\r\n*",
    "right_surround": "#\r\n",
    "seperator": "=",
    "wait_time": 1,
    "command_failed_message": "*Block item#",
    "exception_message": "*Illegal format#",
    "serial": {
        "baudrate": 57600,
        "parity": "none",
        "stopbits": 1,
        "bytesize": 8
    "command_list": {
        "power": {
            "command": "pow",
            "actions": {
                "on": "on",
                "off": "off",
                "status": "?"

Please do make pull requests for any other devices. If code changes need made in order for your device to work, open an issue and I'll work to resolve it.

You can’t perform that action at this time.